2024-05-18 15:28:29 +08:00
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
{
//所有客户名称
2024-05-22 11:30:40 +08:00
public string wuliaomingtishi = "" ;
2024-05-18 15:28:29 +08:00
//创建一个共用的编码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
2024-05-22 11:30:40 +08:00
Maticsoft . BLL . nr_z_scdj_djjl djbll = new Maticsoft . BLL . nr_z_scdj_djjl ( ) ;
2024-05-18 15:28:29 +08:00
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" ) ;
}
//获取角色权限
2024-05-22 11:30:40 +08:00
Maticsoft . Model . nr_z_yhzh user = ( Maticsoft . Model . nr_z_yhzh ) ( Session [ "user" ] ) ;
2024-05-18 15:28:29 +08:00
if ( Request . QueryString [ "uid" ] ! = null & & Request . QueryString [ "uid" ] . ToString ( ) . Length > 0 )
2024-05-22 11:30:40 +08:00
{
2024-05-18 15:28:29 +08:00
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 ( ) ;
2024-05-22 11:30:40 +08:00
setdjxx ( ) ;
2024-05-18 15:28:29 +08:00
}
2024-05-22 11:30:40 +08:00
2024-05-18 15:28:29 +08:00
}
}
#region 用 来 初 始 化 绑 定 下 拉 框 等 值
private void binddata ( )
2024-05-22 11:30:40 +08:00
{
2024-05-18 15:28:29 +08:00
//获取角色权限
Maticsoft . Model . nr_z_yhzh user = ( Maticsoft . Model . nr_z_yhzh ) ( Session [ "user" ] ) ;
xfczr . Value = user . zhanghao ;
2024-05-22 11:30:40 +08:00
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 )
2024-05-18 15:28:29 +08:00
{
gyxx . DataSource = djgxds . Tables [ 0 ] . DefaultView ;
gyxx . DataValueField = "id" ;
gyxx . DataTextField = "gyxx" ;
gyxx . DataBind ( ) ;
2024-05-22 11:30:40 +08:00
2024-05-18 15:28:29 +08:00
}
2024-05-22 11:30:40 +08:00
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 ;
2024-05-18 15:28:29 +08:00
}
#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 ( ) ;
}
//已接收数量总数量
2024-05-22 11:30:40 +08:00
int yjszsl = 0 ;
2024-05-18 15:28:29 +08:00
//已登记总数量
2024-05-22 11:30:40 +08:00
string djzsl = DBHlper . getfirstcolmn ( "select isnull(SUM(djsl),0) from nr_z_scdj_djjl where scxmid='" + id . Value + "'and djgx='" + gyxx . SelectedItem . Text + "'" ) ;
2024-05-18 15:28:29 +08:00
//已下发总数量
2024-05-22 11:30:40 +08:00
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 + "')" ) ;
2024-05-18 15:28:29 +08:00
//已报废总数量
2024-05-22 11:30:40 +08:00
string ybfzsl = DBHlper . getfirstcolmn ( "select isnull(SUM(bfsl),0) from nr_z_scdj_djjl where scxmid='" + id . Value + "' and djgx='" + gyxx . SelectedItem . Text + "'" ) ;
2024-05-18 15:28:29 +08:00
qrtq . Visible = false ;
sctqkc . Visible = false ;
//接收||需产总数量
int xczsl = 0 ;
string biao = "" ;
tqsl . InnerText = "" ;
2024-05-22 11:30:40 +08:00
if ( gyxx . SelectedItem ! = null & & gyxx . SelectedItem . Text = = "制模" )
2024-05-18 15:28:29 +08:00
{
2024-05-22 11:30:40 +08:00
DataSet zldds = DBHlper . Execute ( "select * from nr_z_mjzld where scdbh='" + scdh . Value + "' and xmid='" + id . Value + "' and pm='" + cpmc . Value + "'" ) ;
2024-05-18 15:28:29 +08:00
biao = "<table id='djstb' class='bule'> <tr id='0' class='tbtilt'>"
2024-05-22 11:30:40 +08:00
+ "<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>" ;
2024-05-18 15:28:29 +08:00
foreach ( DataRow r in zldds . Tables [ 0 ] . Rows )
{
2024-05-22 11:30:40 +08:00
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>" ;
2024-05-18 15:28:29 +08:00
xczsl = xczsl + Convert . ToInt32 ( r [ "xcmj" ] ) ;
}
jsxm . InnerHtml = biao + "</table>" ;
yjszsl = xczsl ;
}
2024-05-22 11:30:40 +08:00
else
2024-05-18 15:28:29 +08:00
{
2024-05-22 11:30:40 +08:00
DataSet zldds = DBHlper . Execute ( "select * from nr_z_scdj_xf where scxmid='" + id . Value + "' and xfgx='" + gyxx . SelectedItem . Text + "'" ) ;
2024-05-18 15:28:29 +08:00
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>"
2024-05-22 11:30:40 +08:00
+ "<td><span>备注</span></td><td><span>状态</span></td></tr>" ;
2024-05-18 15:28:29 +08:00
foreach ( DataRow r in zldds . Tables [ 0 ] . Rows )
2024-05-22 11:30:40 +08:00
{
2024-05-18 15:28:29 +08:00
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>" ;
2024-05-22 11:30:40 +08:00
xczsl = xczsl + Convert . ToInt32 ( r [ "xfsl" ] ) ;
2024-05-18 15:28:29 +08:00
}
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='已接收'" ) ;
2024-05-22 11:30:40 +08:00
if ( gyxx . SelectedItem . Text = = "土坯仓" )
2024-05-18 15:28:29 +08:00
{
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 ) ;
2024-05-22 11:30:40 +08:00
}
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" ;
}
2024-05-18 15:28:29 +08:00
tqslbt . Visible = true ;
tqsl . InnerText = "可提取数量:" + dtqkcsl + ";已提取数量:" + ytqkcsl ;
yjszsl = Convert . ToInt32 ( gyyjssl ) + Convert . ToInt32 ( ytqkcsl ) ;
2024-05-22 11:30:40 +08:00
}
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 ) ;
}
2024-05-18 15:28:29 +08:00
else
{
yjszsl = Convert . ToInt32 ( gyyjssl ) ;
}
}
jhsl . Value = xczsl . ToString ( ) ;
2024-05-22 11:30:40 +08:00
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 ;
2024-05-18 15:28:29 +08:00
}
#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>"
2024-05-22 11:30:40 +08:00
//+ "<td><span>登记工序</span></td><td><span>登记人员</span></td><td><span>登记数量</span></td><td><span>报废数量</span></td>"
//+ "<td><span>备注</span></td>"
+ "</tr>" ;
2024-05-18 15:28:29 +08:00
scdjdiv . InnerHtml = biao + "</table>" ;
}
#endregion
[Ajax.AjaxMethod()]
2024-05-22 11:30:40 +08:00
public int xzjsgy ( string gyid , string cpid , string gyxx )
2024-05-18 15:28:29 +08:00
{
2024-05-22 11:30:40 +08:00
string cmd = "update nr_z_scdj_xf set zt='已接收' where id='" + gyid + "'" ;
2024-05-18 15:28:29 +08:00
int fhz = DBHlper . excutecmd ( cmd ) ;
if ( fhz > 0 )
{
2024-05-22 11:30:40 +08:00
string xfsl = DBHlper . getfirstcolmn ( "select xfsl from nr_z_scdj_xf where id='" + gyid + "'" ) ;
if ( gyxx = = "土坯仓" )
2024-05-18 15:28:29 +08:00
{
2024-05-22 11:30:40 +08:00
DBHlper . Execute ( "update nr_z_cpkc set tpcsl='" + xfsl + "' where id='" + cpid + "'" ) ;
2024-05-18 15:28:29 +08:00
}
2024-05-22 11:30:40 +08:00
else if ( gyxx = = "素坯仓" )
2024-05-18 15:28:29 +08:00
{
DBHlper . Execute ( "update nr_z_cpkc set spcsl='" + xfsl + "' where id='" + cpid + "'" ) ;
}
2024-05-22 11:30:40 +08:00
else if ( gyxx = = "白地仓" )
2024-05-18 15:28:29 +08:00
{
DBHlper . Execute ( "update nr_z_cpkc set bdcsl='" + xfsl + "' where id='" + cpid + "'" ) ;
}
2024-05-22 11:30:40 +08:00
else if ( gyxx = = "成品仓" )
2024-05-18 15:28:29 +08:00
{
DBHlper . Execute ( "update nr_z_cpkc set sl='" + xfsl + "' where id='" + cpid + "'" ) ;
}
}
return fhz ;
2024-05-22 11:30:40 +08:00
}
2024-05-18 15:28:29 +08:00
#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
2024-05-22 11:30:40 +08:00
2024-05-18 15:28:29 +08:00
#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" ) ;
}
2024-05-21 15:05:24 +08:00
if ( DBHlper . GetPermission ( juese , "生产登记" , "view_nr_z_scdj" , "生产登记" ) )
2024-05-18 15:28:29 +08:00
{
qrdj . Visible = true ;
scdjbt . Visible = true ;
}
2024-05-21 15:05:24 +08:00
if ( DBHlper . GetPermission ( juese , "生产登记" , "view_nr_z_scdj" , "登记下发" ) )
2024-05-18 15:28:29 +08:00
{
qrxf . Visible = true ;
scxfbt . Visible = true ;
}
2024-05-21 15:05:24 +08:00
if ( DBHlper . GetPermission ( juese , "生产登记" , "view_nr_z_scdj_djjl" , "查看个人登记" ) | | DBHlper . GetPermission ( juese , "生产登记" , "view_nr_z_scdj_djjl" , "查看全部登记" ) )
2024-05-18 15:28:29 +08:00
{
djjlck . Visible = true ;
}
2024-05-22 11:30:40 +08:00
2024-05-18 15:28:29 +08:00
}
#endregion
protected void gyxx_SelectedIndexChanged ( object sender , EventArgs e )
2024-05-22 11:30:40 +08:00
{
2024-05-18 15:28:29 +08:00
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 > ( ) ;
2024-05-22 11:30:40 +08:00
xmmds = DBHlper . ConvertJsonToEntityListEntity < Maticsoft . Model . nr_z_scdj_djjl > ( scdjhd . Value ) ;
2024-05-18 15:28:29 +08:00
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 ) ;
2024-05-22 11:30:40 +08:00
//查询物料需求列表
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 )
2024-05-18 15:28:29 +08:00
{
decimal clcksl = x . djsl * Convert . ToDecimal ( xqr [ "xqyl" ] ) ;
2024-05-22 11:30:40 +08:00
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" ] + "')" ) ;
2024-05-18 15:28:29 +08:00
}
//给日志模板赋值
rizhi . riqi = DateTime . Now ;
rizhi . leixing = "生产登记" ;
rizhi . yonghuming = user . zhanghao ;
//拼接字符串插入日志
2024-05-22 11:30:40 +08:00
rizhi . jilu = user . zhanghao + "进行了生产登记;登记工序为:" + x . djgx + ",登记人员为:" + x . djry + ",登记数量为:" + x . djsl + ",报废数量为" + x . bfsl + "; " ;
2024-05-18 15:28:29 +08:00
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>" ) ;
2024-05-22 11:30:40 +08:00
}
2024-05-18 15:28:29 +08:00
}
protected void scxfbt_Click ( object sender , EventArgs e )
{
int xfz = 0 ;
foreach ( string r in xfgxhd . Value . Split ( ',' ) )
{
2024-05-22 11:30:40 +08:00
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 + "')" ) ;
2024-05-18 15:28:29 +08:00
}
if ( xfz > 0 )
{
//给日志模板赋值
rizhi . riqi = DateTime . Now ;
rizhi . leixing = "生产登记" ;
rizhi . yonghuming = xfczr . Value ;
//拼接字符串插入日志
2024-05-22 11:30:40 +08:00
rizhi . jilu = xfczr . Value + "进行了生产下发:从" + gyxx . SelectedItem . Text + ",下发到:" + xfgxhd . Value + ";下发数量为" + xfsl . Value + "; " ;
2024-05-18 15:28:29 +08:00
rizhibll . Add ( rizhi ) ;
Response . Write ( "<script Language='javascript'>alert('下发操作成功!');window.location.href='WorkRecord_browse.aspx?uid=" + id . Value + "&xzgy=" + gyxx . SelectedValue + "';</script>" ) ;
2024-05-22 11:30:40 +08:00
2024-05-18 15:28:29 +08:00
}
}
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 + "'" ;
}
2024-05-22 11:30:40 +08:00
int updz = DBHlper . excutecmd ( upsql ) ;
if ( updz > 0 )
2024-05-18 15:28:29 +08:00
{
2024-05-22 11:30:40 +08:00
Response . Write ( "<script Language='javascript'>alert('提取库存成功!');window.location.href='WorkRecord_browse.aspx?uid=" + id . Value + "&xzgy=" + gyxx . SelectedValue + "';</script>" ) ;
2024-05-18 15:28:29 +08:00
}
}
2024-05-22 11:30:40 +08:00
}