protected void Page_Load(object sender, EventArgs e) { _workshop = "四车间"; // Request.QueryString["workshop"].ToString(); // "四车间";// _dh = "G0051234"; // Request.QueryString["dh"].ToString();// "W0000456"; // lotno = "G0000301"; //_dh = "W0000450"; dt_append = new DataTable(); dt_append.Columns.Add("pgino"); dt_append.Columns.Add("workorder"); dt_append.Columns.Add("need_off_qty"); //dt_append.Columns.Add("need_no"); dt_append.Columns.Add("idno"); if (WeiXin.GetCookie("workcode") == null) { Response.Write("<script>layer.alert('登入信息过期,请退出程序重新进入。');window.history.back();location.reload();</script>"); return; } string strsql = @"select pgino,emp_name,hege_qty,create_date,qc_dh from Mes_App_WorkOrder_QC_History where qc_dh = '{0}' UNION ALL select pgino,emp_name,-1*act_qty,create_date,workorder from Mes_APP_WorkOrder_CKCK_Hege where reason ='成品领用' AND workorder='{0}'" ; strsql = string.Format(strsql, _dh); DataTable re_dt = SQLHelper.Query(strsql).Tables[0]; if (re_dt.Rows.Count > 0) { Repeater_record.DataSource = re_dt; Repeater_record.DataBind(); } if (!IsPostBack) { LoginUser lu = (LoginUser)WeiXin.GetJsonCookie(); txt_emp.Text = lu.WorkCode; txt_dh.Text = _dh; ViewState["STEPVALUE"] = ""; } }
protected void Bind_reperter() { string sql = @"exec usp_app_yz_hsolve_load_v1 '{0}','{1}','{2}','{3}','{4}'"; sql = string.Format(sql, txt_emp.Text, _workshop, txt_dh.Text, txt_xmh.Text, dh_record.Text); DataSet ds = SQLHelper.Query(sql); DataTable dt1 = ds.Tables[0]; if (dt1.Rows.Count > 0) { txt_xmh.Text = dt1.Rows[0]["pgino"].ToString(); txt_pn.Text = dt1.Rows[0]["pt_desc1"].ToString(); txt_qty.Text = dt1.Rows[0]["pt_ord_mult"].ToString(); txt_ztsl.Text = dt1.Rows[0]["pt_ord_mult"].ToString(); txt_off_qty.Text = dt1.Rows[0]["off_qty"].ToString(); txt_curr_qty.Text = dt1.Rows[0]["curr_qty"].ToString(); txt_desc2.Text = dt1.Rows[0]["pt_desc2"].ToString(); } //else //{ // ScriptManager.RegisterStartupScript(Page, this.GetType(), "setinfo", "alert('员工未上岗,请先上岗');", true); // return; //} //ViewState["DT_Grid"] = ds.Tables[1]; //DataTable dtnew = GetAll(); Repeater_lotno.DataSource = ds.Tables[1]; Repeater_lotno.DataBind(); DataTable dt_record = ds.Tables[2]; if (dt_record.Rows.Count > 0) { Repeater_record.DataSource = dt_record; Repeater_record.DataBind(); } string stepvalue = ds.Tables[3].Rows[0]["StepValue"].ToString(); int op = int.Parse(ds.Tables[3].Rows[0]["op"].ToString()); g2.Checked = (stepvalue == "终检") ? true : false; g3.Checked = (stepvalue == "GP12") ? true : false; g4.Checked = (stepvalue == "入库") ? true : false; if (ds.Tables[3].Rows[0]["cz"].ToString() == "Y") { g2.Attributes.Add("disabled", "disabled"); g3.Attributes.Add("disabled", "disabled"); g4.Attributes.Add("disabled", "disabled"); } if (op < 600) { lb2.Visible = false; lb3.Visible = false; } else { lb2.Visible = true; lb3.Visible = true; } if (op > 600) { lb4.Visible = false; } else { lb4.Visible = true; } }
protected void Bind_reperter() { string sql = @"exec usp_app_yz_xmh_sel_ver '{0}','{1}','{2}','{3}','{4}'"; sql = string.Format(sql, txt_emp.Text, _workshop, txt_dh.Text, txt_pgino.Text, txt_yzj.Text); DataSet ds = SQLHelper.Query(sql); //DataTable dt1 = ds.Tables[2]; //if (dt1.Rows.Count > 0 && txt_pgino.Text != "") //{ // txt_pn.Text = dt1.Rows[0]["pt_desc1"].ToString(); // txt_qty.Text = dt1.Rows[0]["pt_ord_mult"].ToString(); // txt_ztsl.Text = dt1.Rows[0]["pt_ord_mult"].ToString(); // txt_off_qty.Text = dt1.Rows[0]["off_qty"].ToString(); // txt_curr_qty.Text = dt1.Rows[0]["curr_qty"].ToString(); // txt_desc2.Text = dt1.Rows[0]["pt_desc2"].ToString(); //} ViewState["DT_Grid"] = ds.Tables[3]; DataTable dtnew = GetAll(); Repeater_lotno.DataSource = dtnew; Repeater_lotno.DataBind(); DataTable dt_record = ds.Tables[4]; if (dt_record.Rows.Count > 0) { Repeater_record.DataSource = dt_record; Repeater_record.DataBind(); } string stepvalue = ds.Tables[5].Rows[0]["StepValue"].ToString(); int op = int.Parse(ds.Tables[5].Rows[0]["op"].ToString()); g1.Checked = (stepvalue == "后处理完成") ? true : false; g2.Checked = (stepvalue == "终检") ? true : false; g3.Checked = (stepvalue == "GP12") ? true : false; g4.Checked = (stepvalue == "入库") ? true : false; if (ds.Tables[5].Rows[0]["cz"].ToString() == "Y") { g1.Attributes.Add("disabled", "disabled"); g2.Attributes.Add("disabled", "disabled"); g3.Attributes.Add("disabled", "disabled"); g4.Attributes.Add("disabled", "disabled"); } if (op < 600) { lb2.Visible = false; lb3.Visible = false; } else { lb2.Visible = true; lb3.Visible = true; } if (op > 600) { lb4.Visible = false; } else { lb4.Visible = true; } }
protected void Bind_reperter() { string pgino = ""; DataTable dt1 = new DataTable(); string sql_his = "select top 1 pgino from [dbo].[Mes_App_WorkOrder_History] where workorder='{0}'"; sql_his = string.Format(sql_his, txt_dh.Text); DataTable dt_his = SQLHelper.Query(sql_his).Tables[0]; if (dt_his.Rows.Count > 0) { pgino = dt_his.Rows[0]["pgino"].ToString(); txt_xmh.SelectedValue = pgino; txt_xmh.Attributes.Add("disabled", "disabled"); } //if (txt_xmh.Items.Contains(new ListItem(pgino))) //{ //} string sql = @"exec usp_app_off_material_Bind_xmh_ver '{0}','{1}'"; sql = string.Format(sql, txt_xmh.SelectedValue, txt_emp.Text); DataTable redt = SQLHelper.Query(sql).Tables[0]; //根据项目号取整托数 if (txt_xmh.SelectedValue != "") { if (redt.Rows.Count > 0) { DataRow[] drs2 = redt.Select("pgino = '" + txt_xmh.SelectedItem.Text + "' "); if (drs2 != null && drs2.Length > 0) { txt_qty.Text = drs2[0]["ztsl"].ToString(); txt_pn.Text = drs2[0]["pn"].ToString(); txt_ztsl.Text = drs2[0]["ztsl"].ToString(); } } dt1 = SQLHelper.Query(sql).Tables[1]; ViewState["DT_Grid"] = dt1; DataTable dtnew = GetAll(); Repeater_lotno.DataSource = dtnew; Repeater_lotno.DataBind(); string strsql = @"exec usp_app_off_num_ver '{0}','{1}'"; strsql = string.Format(strsql, txt_dh.Text, txt_xmh.SelectedValue); DataTable dt2 = SQLHelper.Query(strsql).Tables[0]; txt_off_qty.Text = dt2.Rows[0]["off_qty"].ToString(); //if (double.Parse(txt_qty.Text) - double.Parse(txt_off_qty.Text) < 0) //{ // txt_qty.Text = txt_off_qty.Text; // txt_curr_qty.Text = "0"; //} //else //{ txt_curr_qty.Text = (double.Parse(txt_qty.Text) - double.Parse(txt_off_qty.Text)).ToString(); if (double.Parse(txt_qty.Text) < double.Parse(txt_off_qty.Text)) { txt_qty.Text = txt_off_qty.Text; txt_curr_qty.Text = "0"; } //} ViewState["STEPVALUE"] = dt2.Rows[0]["step"].ToString(); txt_step.Text = dt2.Rows[0]["step"].ToString(); DataTable dt_record = SQLHelper.Query(strsql).Tables[1]; if (dt_record.Rows.Count > 0) { Repeater_record.DataSource = SQLHelper.Query(strsql).Tables[1]; Repeater_record.DataBind(); } } }