446 lines
19 KiB
C#
446 lines
19 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Web;
|
|||
|
|
using System.Web.UI;
|
|||
|
|
using System.Web.UI.WebControls;
|
|||
|
|
using Maticsoft.BLL;
|
|||
|
|
using System.Data;
|
|||
|
|
using System.Data.SqlClient;
|
|||
|
|
using Ajax;
|
|||
|
|
public partial class WorkRecord_browse : CommonPage
|
|||
|
|
{
|
|||
|
|
//所有客户名称
|
|||
|
|
public string wuliaomingtishi = "";
|
|||
|
|
//创建一个共用的编码bll层
|
|||
|
|
Maticsoft.BLL.nr_sys_bianma bmb = new Maticsoft.BLL.nr_sys_bianma();
|
|||
|
|
//创建一个共用的类型BLL层
|
|||
|
|
Maticsoft.BLL.nr_sys_leixing bmlx = new Maticsoft.BLL.nr_sys_leixing();
|
|||
|
|
//创建一个操作记录模板
|
|||
|
|
Maticsoft.Model.nr_sys_rizhi rizhi = new Maticsoft.Model.nr_sys_rizhi();
|
|||
|
|
//创建一个操作记录bll
|
|||
|
|
Maticsoft.BLL.nr_sys_rizhi rizhibll = new Maticsoft.BLL.nr_sys_rizhi();
|
|||
|
|
//创建一个操作项目bll
|
|||
|
|
Maticsoft.BLL.nr_z_scdj_djjl djbll = new Maticsoft.BLL.nr_z_scdj_djjl();
|
|||
|
|
public string wulmingtishi = "";
|
|||
|
|
protected void Page_Load(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
Utility.RegisterTypeForAjax(typeof(WorkRecord_browse));
|
|||
|
|
if (!IsPostBack)
|
|||
|
|
{
|
|||
|
|
if (Session["user"] == null)
|
|||
|
|
{
|
|||
|
|
Response.Redirect("../index.aspx");
|
|||
|
|
}
|
|||
|
|
//获取角色权限
|
|||
|
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
|||
|
|
if (Request.QueryString["uid"] != null && Request.QueryString["uid"].ToString().Length > 0)
|
|||
|
|
{
|
|||
|
|
pdquanxianbj(user.juese);
|
|||
|
|
string uid = Request.QueryString["uid"].ToString();
|
|||
|
|
id.Value = uid;
|
|||
|
|
binddata();
|
|||
|
|
if (Request.QueryString["xzgy"] != null && Request.QueryString["xzgy"].ToString().Length > 0)
|
|||
|
|
{
|
|||
|
|
gyxx.SelectedValue = Request.QueryString["xzgy"].ToString();
|
|||
|
|
}
|
|||
|
|
setwxxm();
|
|||
|
|
setdjxx();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
#region 用来初始化绑定下拉框等值
|
|||
|
|
private void binddata()
|
|||
|
|
{
|
|||
|
|
//获取角色权限
|
|||
|
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
|||
|
|
xfczr.Value = user.zhanghao;
|
|||
|
|
DataSet djgxds = DBHlper.Execute("select * from view_nr_z_ryda_gxqx where glzh='" + user.zhanghao + "' and zt='在职' and qxlx='登记权限'");
|
|||
|
|
if (djgxds != null && djgxds.Tables[0].Rows.Count> 0)
|
|||
|
|
{
|
|||
|
|
gyxx.DataSource = djgxds.Tables[0].DefaultView;
|
|||
|
|
gyxx.DataValueField = "id";
|
|||
|
|
gyxx.DataTextField = "gyxx";
|
|||
|
|
gyxx.DataBind();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
string gxcode = "<ul>";
|
|||
|
|
djgxds = DBHlper.Execute("select * from view_nr_z_ryda_gxqx where glzh='" + user.zhanghao + "' and zt='在职' and qxlx='下发权限'");
|
|||
|
|
int z = 1;
|
|||
|
|
foreach (DataRow dr in djgxds.Tables[0].Rows)
|
|||
|
|
{
|
|||
|
|
if (z == 1)
|
|||
|
|
{
|
|||
|
|
gxcode += "<li class='gxli'><input type='checkbox' class='xf_gx' checked tag='" + dr["gyxx"] + "'> " + dr["gyxx"] + "</li>";
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
gxcode += "<li class='gxli'><input type='checkbox' class='xf_gx' tag='" + dr["gyxx"] + "'> " + dr["gyxx"] + "</li>";
|
|||
|
|
}
|
|||
|
|
z += 1;
|
|||
|
|
}
|
|||
|
|
gxcode += "</ul>";
|
|||
|
|
xfgy.InnerHtml = gxcode;
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
#region 待接收项目加载
|
|||
|
|
private void setwxxm()
|
|||
|
|
{
|
|||
|
|
DataSet scdjds = DBHlper.Execute("select * from view_nr_z_scdj where id='" + id.Value + "'");
|
|||
|
|
if (scdjds != null && scdjds.Tables[0].Rows.Count > 0)
|
|||
|
|
{
|
|||
|
|
cpid.Value = scdjds.Tables[0].Rows[0]["cpid"].ToString();
|
|||
|
|
scdh.Value = scdjds.Tables[0].Rows[0]["scbh"].ToString();
|
|||
|
|
cpmc.Value = scdjds.Tables[0].Rows[0]["cpmc"].ToString();
|
|||
|
|
cpbh.Value = scdjds.Tables[0].Rows[0]["cphh"].ToString();
|
|||
|
|
}
|
|||
|
|
//已接收数量总数量
|
|||
|
|
int yjszsl =0;
|
|||
|
|
//已登记总数量
|
|||
|
|
//string djzsl=DBHlper.getfirstcolmn("select isnull(SUM(djsl),0) from nr_z_scdj_djjl where scxmid='" + id.Value + "'and djgx='" + gyxx.SelectedItem.Text+ "'");
|
|||
|
|
//已下发总数量
|
|||
|
|
//string yxfzsl = DBHlper.getfirstcolmn("select isnull(SUM(xfsl),0) from nr_z_scdj_xf where scxmid='" + id.Value + "' and dqgx='" + gyxx.SelectedItem.Text + "' and xfgx=(select top 1 xfgx from nr_z_scdj_xf where dqgx='" + gyxx.SelectedItem.Text + "')");
|
|||
|
|
//已报废总数量
|
|||
|
|
//string ybfzsl = DBHlper.getfirstcolmn("select isnull(SUM(bfsl),0) from nr_z_scdj_djjl where scxmid='" + id.Value + "' and djgx='" + gyxx.SelectedItem.Text + "'");
|
|||
|
|
qrtq.Visible = false;
|
|||
|
|
sctqkc.Visible = false;
|
|||
|
|
//接收||需产总数量
|
|||
|
|
int xczsl = 0;
|
|||
|
|
string biao = "";
|
|||
|
|
tqsl.InnerText = "";
|
|||
|
|
if (gyxx.SelectedItem.Text == "制模")
|
|||
|
|
{
|
|||
|
|
DataSet zldds = DBHlper.Execute("select * from nr_z_mjzld where scdbh='" + scdh.Value + "' and xmid='"+id.Value+"' and pm='" + cpmc.Value + "'");
|
|||
|
|
biao = "<table id='djstb' class='bule'> <tr id='0' class='tbtilt'>"
|
|||
|
|
+ "<td><span>生产编号</span></td><td><span>模具代码</span></td><td><span>模具名称</span></td>"
|
|||
|
|
+ "<td><span>指令类型</span></td><td><span>计划数量</span></td>"
|
|||
|
|
+ "<td><span>备注</span></td><td><span>状态</span></td></tr>";
|
|||
|
|
foreach (DataRow r in zldds.Tables[0].Rows)
|
|||
|
|
{
|
|||
|
|
biao += "<tr><td><span>" + r["scdbh"].ToString() + "</span></td><td><span>" + r["mjh"].ToString() + "</span></td>"
|
|||
|
|
+ "<td><span>" + r["pm"].ToString() + "</span></td><td><span>" + r["djlx"].ToString() + "</span></td>"
|
|||
|
|
+ "<td><span>" + r["xcmj"].ToString() + "</span></td><td><span>" + r["bz"].ToString() + "</span></td><td><span>已接收</span></td></tr>";
|
|||
|
|
xczsl = xczsl + Convert.ToInt32(r["xcmj"]);
|
|||
|
|
}
|
|||
|
|
jsxm.InnerHtml = biao + "</table>";
|
|||
|
|
yjszsl = xczsl;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
DataSet zldds = DBHlper.Execute("select * from nr_z_scdj_xf where scxmid='"+id.Value+"' and xfgx='"+gyxx.SelectedItem.Text+"'");
|
|||
|
|
biao = "<table class='bule' id='djstb' > <tr id='0' class='tbtilt' >"
|
|||
|
|
+ "<td><span>来源工序</span></td><td><span>待接收数量</span></td><td><span>下发人员</span></td><td><span>下发时间</span></td>"
|
|||
|
|
+ "<td><span>备注</span></td><td><span>状态</span></td></tr>";
|
|||
|
|
foreach (DataRow r in zldds.Tables[0].Rows)
|
|||
|
|
{
|
|||
|
|
biao += "<tr><td><span>" + r["dqgx"].ToString() + "</span></td><td><span>" + r["xfsl"].ToString() + "</span></td>"
|
|||
|
|
+ "<td><span>" + r["czr"].ToString() + "</span></td><td><span>" + r["xfsj"].ToString() + "</span></td>"
|
|||
|
|
+ "<td><span>" + r["bz"].ToString() + "</span></td><td> <span><a class='dxzys' href='#' onclick=\"return xzjsgy('" + r["id"] + "','" + r["zt"] + "')\">" + r["zt"] + "</a></span></td></tr>";
|
|||
|
|
xczsl = xczsl + Convert.ToInt32(r["xfsl"]);
|
|||
|
|
}
|
|||
|
|
jsxm.InnerHtml = biao + "</table>";
|
|||
|
|
string gyyjssl = DBHlper.getfirstcolmn("select isnull(sum(xfsl),0) from nr_z_scdj_xf where scxmid='" + id.Value + "' and xfgx='" + gyxx.SelectedItem.Text + "' and zt='已接收'");
|
|||
|
|
if (gyxx.SelectedItem.Text == "土坯仓")
|
|||
|
|
{
|
|||
|
|
string dtqkcsl = DBHlper.getfirstcolmn("select tptqsl from dbo.nr_z_scd_cp_tqkc where xmid='" + id.Value + "' and tpzt='0'");
|
|||
|
|
string ytqkcsl = DBHlper.getfirstcolmn("select tptqsl from dbo.nr_z_scd_cp_tqkc where xmid='" + id.Value + "' and tpzt='1'");
|
|||
|
|
if (dtqkcsl == "")
|
|||
|
|
{
|
|||
|
|
dtqkcsl = "0";
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
qrtq.Visible = true;
|
|||
|
|
sctqkc.Visible = true;
|
|||
|
|
}
|
|||
|
|
if (ytqkcsl == "")
|
|||
|
|
{
|
|||
|
|
ytqkcsl = "0";
|
|||
|
|
}
|
|||
|
|
tqslbt.Visible = true;
|
|||
|
|
tqsl.InnerText = "可提取数量:" + dtqkcsl + ";已提取数量:" + ytqkcsl;
|
|||
|
|
yjszsl = Convert.ToInt32(gyyjssl) + Convert.ToInt32(ytqkcsl);
|
|||
|
|
} else if (gyxx.SelectedItem.Text == "素坯仓")
|
|||
|
|
{
|
|||
|
|
string dtqkcsl = DBHlper.getfirstcolmn("select sptqsl from dbo.nr_z_scd_cp_tqkc where xmid='" + id.Value + "' and spzt='0'");
|
|||
|
|
string ytqkcsl = DBHlper.getfirstcolmn("select sptqsl from dbo.nr_z_scd_cp_tqkc where xmid='" + id.Value + "' and spzt='1'");
|
|||
|
|
if (dtqkcsl == "")
|
|||
|
|
{
|
|||
|
|
dtqkcsl = "0";
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
sctqkc.Visible = true;
|
|||
|
|
qrtq.Visible = true;
|
|||
|
|
}
|
|||
|
|
if (ytqkcsl == "")
|
|||
|
|
{
|
|||
|
|
ytqkcsl = "0";
|
|||
|
|
}
|
|||
|
|
tqslbt.Visible = true;
|
|||
|
|
tqsl.InnerText = "可提取数量:" + dtqkcsl + ";已提取数量:" + ytqkcsl;
|
|||
|
|
yjszsl = Convert.ToInt32(gyyjssl) + Convert.ToInt32(ytqkcsl);
|
|||
|
|
}
|
|||
|
|
else if (gyxx.SelectedItem.Text == "白地仓")
|
|||
|
|
{
|
|||
|
|
string dtqkcsl = DBHlper.getfirstcolmn("select bdtqsl from dbo.nr_z_scd_cp_tqkc where xmid='" + id.Value + "' and bdzt='0'");
|
|||
|
|
string ytqkcsl = DBHlper.getfirstcolmn("select bdtqsl from dbo.nr_z_scd_cp_tqkc where xmid='" + id.Value + "' and bdzt='1'");
|
|||
|
|
if (dtqkcsl == "")
|
|||
|
|
{
|
|||
|
|
dtqkcsl = "0";
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
qrtq.Visible = true;
|
|||
|
|
sctqkc.Visible = true;
|
|||
|
|
}
|
|||
|
|
if (ytqkcsl == "")
|
|||
|
|
{
|
|||
|
|
ytqkcsl = "0";
|
|||
|
|
}
|
|||
|
|
tqslbt.Visible = true;
|
|||
|
|
tqsl.InnerText = "可提取数量:" + dtqkcsl + ";已提取数量:" + ytqkcsl;
|
|||
|
|
yjszsl = Convert.ToInt32(gyyjssl) + Convert.ToInt32(ytqkcsl);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
yjszsl = Convert.ToInt32(gyyjssl);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
jhsl.Value = xczsl.ToString();
|
|||
|
|
//int dxfzsl = Convert.ToInt32(djzsl) - Convert.ToInt32(yxfzsl);
|
|||
|
|
//int ddjzsl = yjszsl - Convert.ToInt32(djzsl) - Convert.ToInt32(ybfzsl);
|
|||
|
|
//ddjsl.Value = ddjzsl.ToString();
|
|||
|
|
//yxfsl.Value = yxfzsl.ToString();
|
|||
|
|
//dxfsl.Value = dxfzsl.ToString();
|
|||
|
|
//ybfsl.Value = ybfzsl;
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region 加载登记项目
|
|||
|
|
private void setdjxx()
|
|||
|
|
{
|
|||
|
|
string biao = "";
|
|||
|
|
biao = "<table id='djtb' class='bule' > <tr id='0' class='tbtilt'>"
|
|||
|
|
+ "<td width='25px' onclick='add_djxm()' class='head5'> <img src='../Images_Folder/Button/tjltj.png' width='25px' height='25px' /></td>"
|
|||
|
|
+ "<td><span>登记工序</span></td><td><span>登记人员</span></td><td><span>登记数量</span></td><td><span>报废数量</span></td>"
|
|||
|
|
+ "<td><span>备注</span></td>"
|
|||
|
|
+ "<td><span>登记工序</span></td><td><span>登记人员</span></td><td><span>登记数量</span></td><td><span>报废数量</span></td>"
|
|||
|
|
+ "<td><span>备注</span></td>"
|
|||
|
|
+"</tr>";
|
|||
|
|
|
|||
|
|
scdjdiv.InnerHtml = biao + "</table>";
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
[Ajax.AjaxMethod()]
|
|||
|
|
public int xzjsgy(string gyid,string cpid, string gyxx)
|
|||
|
|
{
|
|||
|
|
string cmd ="update nr_z_scdj_xf set zt='已接收' where id='"+gyid+"'";
|
|||
|
|
int fhz = DBHlper.excutecmd(cmd);
|
|||
|
|
if (fhz > 0)
|
|||
|
|
{
|
|||
|
|
string xfsl=DBHlper.getfirstcolmn("select xfsl from nr_z_scdj_xf where id='" + gyid + "'");
|
|||
|
|
if (gyxx== "土坯仓")
|
|||
|
|
{
|
|||
|
|
DBHlper.Execute("update nr_z_cpkc set tpcsl='" + xfsl + "' where id='" + cpid+ "'");
|
|||
|
|
}
|
|||
|
|
else if (gyxx== "素坯仓")
|
|||
|
|
{
|
|||
|
|
DBHlper.Execute("update nr_z_cpkc set spcsl='" + xfsl + "' where id='" + cpid + "'");
|
|||
|
|
}
|
|||
|
|
else if (gyxx== "白地仓")
|
|||
|
|
{
|
|||
|
|
DBHlper.Execute("update nr_z_cpkc set bdcsl='" + xfsl + "' where id='" + cpid + "'");
|
|||
|
|
}
|
|||
|
|
else if (gyxx== "成品仓")
|
|||
|
|
{
|
|||
|
|
DBHlper.Execute("update nr_z_cpkc set sl='" + xfsl + "' where id='" + cpid + "'");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
return fhz;
|
|||
|
|
}
|
|||
|
|
#region 获取烧成方式
|
|||
|
|
/*public string hqdjry()
|
|||
|
|
{
|
|||
|
|
string cpxmscfs = "";
|
|||
|
|
DataSet gyxxds = DBHlper.Execute("select * from view_nr_z_ryda_gxqx where gyxx='"+gyxx.SelectedItem.Text+"'");
|
|||
|
|
if (gyxxds != null && gyxxds.Tables[0].Rows.Count > 0)
|
|||
|
|
{
|
|||
|
|
foreach (DataRow r in gyxxds.Tables[0].Rows)
|
|||
|
|
{
|
|||
|
|
cpxmscfs += "<option value='" + r["bh"] + "' >" + r["xm"] + "</option>";
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
cpxmscfs += "<option value='无' >无</option>";
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return cpxmscfs;
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region 编辑时获取烧成方式
|
|||
|
|
public string hqyscpscfs(string xz)
|
|||
|
|
{
|
|||
|
|
string tccpscfs = "";
|
|||
|
|
//DataSet hylx = bmlx.GetAllList();
|
|||
|
|
//DataRow[] dr = hylx.Tables[0].Select("leixing='烧成方式'");
|
|||
|
|
//if (dr != null && dr.Length > 0)
|
|||
|
|
//{
|
|||
|
|
// DataSet hy = bm.GetList("zhongleiid='" + dr[0]["id"] + "'");
|
|||
|
|
|
|||
|
|
// if (hy != null)
|
|||
|
|
// {
|
|||
|
|
// foreach (DataRow r in hy.Tables[0].Rows)
|
|||
|
|
// {
|
|||
|
|
// if (xz == r["mingcheng"].ToString())
|
|||
|
|
// {
|
|||
|
|
// tccpscfs += "<option value='" + r["mingcheng"] + "'selected='selected' >" + r["mingcheng"] + "</option>";
|
|||
|
|
// }
|
|||
|
|
// else
|
|||
|
|
// {
|
|||
|
|
|
|||
|
|
// tccpscfs += "<option value='" + r["mingcheng"] + "' >" + r["mingcheng"] + "</option>";
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
//else
|
|||
|
|
//{
|
|||
|
|
// tccpscfs += "<option value='无' >无</option>";
|
|||
|
|
|
|||
|
|
//}
|
|||
|
|
|
|||
|
|
return tccpscfs;
|
|||
|
|
}*/
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
#region 敏感权限查看
|
|||
|
|
void pdquanxianbj(int juese)
|
|||
|
|
{
|
|||
|
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
|||
|
|
if (DBHlper.getzt(user.id) != 1)
|
|||
|
|
{
|
|||
|
|
Response.Redirect("../index.aspx");
|
|||
|
|
}
|
|||
|
|
if (DBHlper.getqx(juese, "生产登记", "view_nr_z_scdj", "生产登记"))
|
|||
|
|
{
|
|||
|
|
qrdj.Visible = true;
|
|||
|
|
scdjbt.Visible = true;
|
|||
|
|
}
|
|||
|
|
if (DBHlper.getqx(juese, "生产登记", "view_nr_z_scdj", "登记下发"))
|
|||
|
|
{
|
|||
|
|
qrxf.Visible = true;
|
|||
|
|
scxfbt.Visible = true;
|
|||
|
|
}
|
|||
|
|
if (DBHlper.getqx(juese, "生产登记", "view_nr_z_scdj_djjl", "查看个人登记") || DBHlper.getqx(juese, "生产登记", "view_nr_z_scdj_djjl", "查看全部登记"))
|
|||
|
|
{
|
|||
|
|
djjlck.Visible = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
protected void gyxx_SelectedIndexChanged(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
setwxxm();
|
|||
|
|
setdjxx();
|
|||
|
|
}
|
|||
|
|
protected void scdjbt_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
List<Maticsoft.Model.nr_z_scdj_djjl> xmmds = new List<Maticsoft.Model.nr_z_scdj_djjl>();
|
|||
|
|
xmmds = DBHlper.ConvertJsonToEntityListEntity<Maticsoft.Model.nr_z_scdj_djjl>(scdjhd.Value);
|
|||
|
|
int ci = 0;
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
int mxid = 0;
|
|||
|
|
Maticsoft.Model.nr_z_yhzh user = (Maticsoft.Model.nr_z_yhzh)(Session["user"]);
|
|||
|
|
foreach (Maticsoft.Model.nr_z_scdj_djjl x in xmmds)
|
|||
|
|
{
|
|||
|
|
ci = ci + 1;
|
|||
|
|
x.scxmid = Convert.ToInt32(id.Value);
|
|||
|
|
//判断如果存在id的时候且是修改操作时
|
|||
|
|
x.riqi = DateTime.Now;
|
|||
|
|
x.djgx = gyxx.SelectedItem.Text;
|
|||
|
|
x.ywy = user.zhanghao;
|
|||
|
|
mxid = djbll.Add(x);
|
|||
|
|
//查询物料需求列表
|
|||
|
|
DataSet wlxqds=DBHlper.Execute("select * from dbo.view_nr_z_cpkc_wlxq where cpbh='"+cpbh.Value+"' and glgx='"+x.djgx+"' and xqyl>0");
|
|||
|
|
foreach( DataRow xqr in wlxqds.Tables[0].Rows)
|
|||
|
|
{
|
|||
|
|
decimal clcksl = x.djsl * Convert.ToDecimal(xqr["xqyl"]);
|
|||
|
|
string ckbh= DBHlper.getbh("YLCK-", "nr_z_scdck", "ckbh", 4);
|
|||
|
|
int setckz=DBHlper.excutecmd("insert into nr_z_scdck(ckbh,ckrq,xmid,wlbh,sl,jsr,zt,djbh,lx,kufang) values('" + ckbh + "','" + DateTime.Now + "','" + id.Value + "','" + xqr["wlbh"] + "','" + clcksl + "','" + user.zhanghao + "','待确认','" + scdh.Value + "','生产领料','" + xqr["kufang"] + "')");
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//给日志模板赋值
|
|||
|
|
rizhi.riqi = DateTime.Now;
|
|||
|
|
rizhi.leixing = "生产登记";
|
|||
|
|
rizhi.yonghuming = user.zhanghao;
|
|||
|
|
//拼接字符串插入日志
|
|||
|
|
rizhi.jilu = user.zhanghao + "进行了生产登记;登记工序为:"+x.djgx+",登记人员为:"+x.djry+",登记数量为:" +x.djsl+ ",报废数量为" +x.bfsl+ ";";
|
|||
|
|
rizhibll.Add(rizhi);
|
|||
|
|
}
|
|||
|
|
if (mxid > 0)
|
|||
|
|
{
|
|||
|
|
Response.Write("<script Language='javascript'>alert('登记操作成功!');window.location.href='WorkRecord_browse.aspx?uid=" + id.Value + "&xzgy=" + gyxx.SelectedValue + "';</script>");
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
catch
|
|||
|
|
{
|
|||
|
|
Response.Write("<script>alert('登记项目在第'" + ci + "行时保存失败!);</script>");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
protected void scxfbt_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
int xfz = 0;
|
|||
|
|
foreach (string r in xfgxhd.Value.Split(','))
|
|||
|
|
{
|
|||
|
|
xfz = DBHlper.excutecmd("insert into nr_z_scdj_xf (dqgx,xfgx,xfsl,czr,bz,zt,scxmid,xfsj) values ('" + gyxx.SelectedItem.Text + "','" + r+ "','" + xfsl.Value + "','" + xfczr.Value + "','" + xfbz.Value + "','待接收','" + id.Value +"','"+DateTime.Now+ "')");
|
|||
|
|
}
|
|||
|
|
if (xfz > 0)
|
|||
|
|
{
|
|||
|
|
//给日志模板赋值
|
|||
|
|
rizhi.riqi = DateTime.Now;
|
|||
|
|
rizhi.leixing = "生产登记";
|
|||
|
|
rizhi.yonghuming = xfczr.Value;
|
|||
|
|
//拼接字符串插入日志
|
|||
|
|
rizhi.jilu = xfczr.Value + "进行了生产下发:从" + gyxx.SelectedItem.Text + ",下发到:" + xfgxhd.Value + ";下发数量为" + xfsl.Value+";";
|
|||
|
|
rizhibll.Add(rizhi);
|
|||
|
|
Response.Write("<script Language='javascript'>alert('下发操作成功!');window.location.href='WorkRecord_browse.aspx?uid=" + id.Value + "&xzgy=" + gyxx.SelectedValue + "';</script>");
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
protected void sctqkc_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
string upsql = "";
|
|||
|
|
if (gyxx.SelectedItem.Text == "土坯仓")
|
|||
|
|
{
|
|||
|
|
upsql = "update nr_z_scd_cp_tqkc set tpzt='1' where xmid='" + id.Value + "'";
|
|||
|
|
}
|
|||
|
|
else if (gyxx.SelectedItem.Text == "素坯仓")
|
|||
|
|
{
|
|||
|
|
upsql = "update nr_z_scd_cp_tqkc set spzt='1' where xmid='" + id.Value + "'";
|
|||
|
|
}
|
|||
|
|
else if (gyxx.SelectedItem.Text == "白地仓")
|
|||
|
|
{
|
|||
|
|
upsql = "update nr_z_scd_cp_tqkc set bdzt='1' where xmid='" + id.Value + "'";
|
|||
|
|
}
|
|||
|
|
int updz=DBHlper.excutecmd(upsql);
|
|||
|
|
if(updz>0)
|
|||
|
|
{
|
|||
|
|
Response.Write("<script Language='javascript'>alert('提取库存成功!');window.location.href='WorkRecord_browse.aspx?uid=" + id.Value + "&xzgy=" + gyxx.SelectedValue+ "';</script>");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|