/// <summary> /// 初始化界面 /// </summary> private void InitUI() { string produceid = Request.QueryString["orderid3"].ToString(); TB_ORDER_LEVEL3 order_lv3 = order_lv3_bll.GetOrderProduce(produceid); TB_ORDER_LEVEL2 order_lv2 = order_lv2_bll.GetOrderItemByID(order_lv3.ORDERITEMID); TextBoxProduceNo.Text = order_lv3.PRODUCEORDERNAME; TextBoxProduceNum.Text = order_lv3.QTY.ToString(); TextBoxAddedNum.Text = order_lv3.ADDEDQTY.ToString(); string pro_sort = "2";//根据产品类型决定条码的特点,单相条码以2开头,其他以9开头 if (order_lv2.PRO_SORT == "01") { pro_sort = "2"; } else { pro_sort = "5"; } int intAddNum = 0; txtOrderAddNum.Text = "1"; txtOrderAddStartBarCode.Text = order_lv3_bll.GetstrBarcodeStart(pro_sort);//获取起始模板号 //设置只读属性 TextBoxProduceNo.ReadOnly = true; TextBoxProduceNum.ReadOnly = true; TextBoxAddedNum.ReadOnly = true; txtOrderAddStartBarCode.ReadOnly = true; }
private void InitUI() { DropDownListORDERSTATUS.DataSource = order_lv1_bll.GetOrderStatu(); DropDownListORDERSTATUS.DataTextField = "DICT_NAME_CN"; DropDownListORDERSTATUS.DataValueField = "DICT_ID"; DropDownListORDERSTATUS.DataBind(); string OrderLevel4ID = Request.QueryString["orderid4"].ToString(); TB_ORDER_LEVEL4 order_lv4 = order_lv4_bll.GetOrderLevel4(OrderLevel4ID); TB_ORDER_LEVEL3 order_lv3 = order_lv3_bll.GetOrderProduce(order_lv4.PRODUCEID); TB_ORDER_LEVEL2 order_lv2 = order_lv2_bll.GetOrderItemByID(order_lv3.ORDERITEMID); TextBoxOrderItem.Text = order_lv2.ITEMNO; LabelOrderLv4no.Text = order_lv4.ORDER_LV4_NO; TextBoxOrderLv4.Text = order_lv4.ORDER_LV4_NO.Replace(order_lv2.ITEMNO.Trim(), ""); TextBoxOrderLv4Num.Text = order_lv4.PRODUCE_LV4_NUM.ToString(); DropDownListORDERSTATUS.SelectedValue = order_lv4.ORDERSTATE; TextBoxStateChangeTime.Text = order_lv4.STATE_CHANGETIME.ToString("yyyy-MM-dd"); DataTable dt = model_scheme_bll.GetModelSchemeAll(""); DropDownListModelNo.DataSource = dt; DropDownListModelNo.DataValueField = "modelid"; DropDownListModelNo.DataTextField = "modelno"; DropDownListModelNo.DataBind(); InitListBox(OrderLevel4ID); }
/// <summary> /// 初始化界面 /// </summary> private void InitUI() { hidcount.Value = "0"; Ord_Produce produce = null; string produceid = Request.QueryString["orderid3"].ToString(); if (Request["suffix"] != null) { produce = produceid.GetProduce(); if (produce != null) { produceid = produce.Produceid; hidorderid3.Value = produceid; DataTable dt = order_lv3_bll.GetOrderBarcodeAll(produceid); //if(dt.Rows.Count==produce.Qty) hidcount.Value = dt.Rows.Count.ToString(); } if (Request["first_tfcode"] != null) { hidfirst_tfcode.Value = Request["first_tfcode"].baseTechflow().Tfcode; } } TextBoxStartBarCode.Text = ""; TextBoxEndBarCode.Text = ""; if (produce != null) { TB_ORDER_LEVEL3 order_lv3 = order_lv3_bll.GetOrderProduce(produceid); TB_ORDER_LEVEL2 order_lv2 = order_lv2_bll.GetOrderItemByID(order_lv3.ORDERITEMID); TextBoxProduceNo.Text = order_lv3.PRODUCEORDERNAME; if (Request["suffix"] != null) { TextBoxProduceNo.Text = Request.QueryString["orderid3"].ToString(); } TextBoxProduceNum.Text = order_lv3.QTY.ToString(); hidorderqty.Value = order_lv2.ITEMNO.Level2order().OrderQuantity.ToString(); string pro_sort = "2";//根据产品类型决定条码的特点,单相条码以2开头,其他以9开头 if (order_lv2.PRO_SORT == "01") { pro_sort = "2"; } else { pro_sort = "5"; } TextBoxStartBarCode.Text = order_lv3_bll.GetstrBarcodeStart(pro_sort);//获取起始模板号 TextBoxEndBarCode.Text = (decimal.Parse(TextBoxStartBarCode.Text.Trim()) + order_lv3.QTY * order_lv3.SingleVolume - 1).ToString(); } //设置只读属性 TextBoxProduceNo.ReadOnly = true; if (Request["modifyorder"] == "1") { TextBoxProduceNum.ReadOnly = false; } else { TextBoxProduceNum.ReadOnly = true; } TextBoxStartBarCode.ReadOnly = true; TextBoxEndBarCode.ReadOnly = true; }
/// <summary> /// 初始化界面 /// </summary> private void InitUI() { TextBoxOrderItem.ReadOnly = true; string uid = Request.QueryString["orderid2"].ToString(); TB_ORDER_LEVEL2 order_lv2 = order_lv2_bll.GetOrderItemByID(uid); TextBoxOrderItem.Text = order_lv2.ITEMNO; }
private void InitUI() { DropDownListORDERTYPE.DataSource = order_lv1_bll.GetOrderType(); DropDownListORDERTYPE.DataTextField = "DICT_NAME_CN"; DropDownListORDERTYPE.DataValueField = "DICT_ID"; DropDownListORDERTYPE.DataBind(); DropDownListPCBType.DataSource = order_lv3_bll.GetPcbType(); DropDownListPCBType.DataTextField = "DICT_NAME_CN"; DropDownListPCBType.DataValueField = "DICT_ID"; DropDownListPCBType.DataBind(); string produceid = Request.QueryString["orderid3"].ToString(); TB_ORDER_LEVEL3 order_lv3 = order_lv3_bll.GetOrderProduce(produceid); TB_ORDER_LEVEL2 order_lv2 = order_lv2_bll.GetOrderItemByID(order_lv3.ORDERITEMID); TextBoxBASEFUNPLAN.Text = order_lv3.BASEFUNPLAN; TextBoxBASETECHNICSFLOW.Text = order_lv3.BASETECHNICSFLOW; TextBoxCompeleteNum.Text = order_lv3.COMPLETEQTY.ToString(); TextBoxCOMPLETEDATE.Text = order_lv3.COMPLETEDATE.ToString("yyyy-MM-dd"); TextBoxEXPECTCOMPLETEDATE.Text = order_lv3.EXPECTCOMPLETEDATE.ToString("yyyy-MM-dd"); TextBoxMemo.Text = order_lv3.REMARK; TextBoxORDERDATE.Text = order_lv3.ORDERDATE.ToString("yyyy-MM-dd"); TextBoxOrderItemID.Text = order_lv3.ORDERITEMID; TextBoxOrderItemNo.Text = order_lv2.ITEMNO; TextBoxOrderProduceID.Text = order_lv3.PRODUCEID; TextBoxORDERUSER.Text = order_lv3_bll.GetUser(produceid);; TextBoxProduceNo.Text = order_lv3.PRODUCEORDERNAME; TextBoxProduceNum.Text = order_lv3.QTY.ToString(); DropDownListORDERTYPE.SelectedValue = order_lv3.PRODUCETYPE; TextBoxSCHEMECHANGETIMES.Text = order_lv3.SCHEMECHANGETIMES.ToString(); TextBoxTECHNICSFLOW.Text = order_technicsflow.GetTechnicsFlowByID(order_lv3.TECHNICSFLOW).tfname; TextBoxUPDATEDATE.Text = order_lv3.UPDATEDATE.ToString("yyyy-MM-dd"); TextBoxUPDATEUSER.Text = order_lv3_bll.GetChangeUser(produceid); TextBoxSingleVolume.Text = order_lv3.SingleVolume.ToString(); DataTable dt = tfnode_bll.GetTFRuleType(); DataRow dr = dt.NewRow(); dr["DICT_ID"] = "";//由毛志凯于2016-10-28修改 dr["DICT_NAME_CN"] = "无"; dt.Rows.InsertAt(dr, 0); DropDownListGuiyue.DataSource = dt; DropDownListGuiyue.DataTextField = "DICT_NAME_CN"; DropDownListGuiyue.DataValueField = "DICT_ID"; DropDownListGuiyue.DataBind(); if (order_lv3.RULETYPE != null && order_lv3.RULETYPE.Length > 0) { DropDownListGuiyue.SelectedValue = order_lv3.RULETYPE; } }
/// <summary> /// 初始化页面 /// </summary> private void InitUI() { string orderitemid = Request.QueryString["OrderItemID"].ToString(); DataTable dt = order_lv3_bll.GetOrderProduceListByItemId(orderitemid); TB_ORDER_LEVEL2 orderitem = order_lv2_bll.GetOrderItemByID(orderitemid); lblFTFMMN.Text = orderitem.ITEMNO; GridView_OrderProduce.DataSource = dt; GridView_OrderProduce.DataBind(); PageQueryAdapter1.RecordCount = dt.Rows.Count; int tmp = PageQueryAdapter1.RecordCount / PageQueryAdapter1.PageSize; PageQueryAdapter1.PageCount = PageQueryAdapter1.RecordCount % PageQueryAdapter1.PageSize > 0 ? tmp + 1 : tmp; }
/// <summary> /// 快速建立生产订单 /// </summary> private void CreateOrderProduceQuickly() { HXPMSPJ.Model.TB_S_PROD_INFO pro = new TB_S_PROD_INFO(); string orderitemid = Request.QueryString["OrderItemID"].ToString(); TB_ORDER_LEVEL2 orderitem = order_lv2_bll.GetOrderItemByID(orderitemid); if (Request.QueryString["mt_id"] == null) { pro = mt_technicsflow_bll.GetModelByID(orderitem.prod_id, orderitem.prod_number); if (pro == null) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "<script type='text/javascript'>alert('请返回上一页先维护该订单的产品编码!');</script>", false); return; } } else { pro = mt_technicsflow_bll.GetModelByID(Request.QueryString["mt_id"].ToString()); } DataTable dt = prod_pcba_bll.GetPCBA_ALL(pro.ID.ToString(), "1");//只取出有效 DataTable dt_orderproduce = order_lv3_bll.GetOrderProduceListByItemId(orderitemid); //系统中已存在生产订单 int index = 1; foreach (DataRow dr_pcb in dt.Rows) { DataRow dr = dt_orderproduce.NewRow(); //string flag = orderitem.ITEMNO.Split('.')[orderitem.ITEMNO.Split('.').Length - 1]; //string flag = orderitem.ITEMNO.Replace(orderitem.ITEMNO.Split('.')[0] + ".", ""); string pcba_index = string.Format(@"-P{0}/{1}", dt.Rows.Count, index++); dr["PRODUCEORDERNAME"] = string.Format(@"{0}{1}", orderitem.ITEMNO, pcba_index); dr["DICT_NAME_CN"] = "未录入"; dr["QTY"] = orderitem.QTY; dr["COMPLETEQTY"] = "0"; dr["PRODUCEID"] = ""; dr["ORDERCONTROL"] = "1"; //默认控制 dr["PROD_CONTROL"] = "1"; //默认控制 dt_orderproduce.Rows.Add(dr); } GridView_OrderProduce.DataSource = dt_orderproduce; GridView_OrderProduce.DataBind(); PageQueryAdapter1.RecordCount = dt_orderproduce.Rows.Count; int tmp = PageQueryAdapter1.RecordCount / PageQueryAdapter1.PageSize; PageQueryAdapter1.PageCount = PageQueryAdapter1.RecordCount % PageQueryAdapter1.PageSize > 0 ? tmp + 1 : tmp; }
protected void ButtonSure_Click(object sender, EventArgs e) { string orditemid = Request.QueryString["orderid2"].ToString(); TB_ORDER_LEVEL2 order_lv2 = order_lv2_bll.GetOrderItemByID(orditemid); TB_ORDER_LEVEL1 order_lv1 = order_lv1_bll.GetOrderOrderByID(order_lv2.ORDERID); //添加三级订单 TB_ORDER_LEVEL3 order_lv3 = new TB_ORDER_LEVEL3(); order_lv3.ORDERDATE = DateTime.Now; order_lv3.ORDERITEMID = order_lv2.ORDERITEMID; order_lv3.ORDERUSERID = this.Staff.StaffId; order_lv3.PRODUCEORDERNAME = TextBoxOrderItem.Text.Trim() + TextBoxOrdProduce.Text.Trim(); //order_lv3.PRODUCEORDERNAME = TextBoxOrdProduce.Text.Trim();//2014.06.03 三级订单随意命名 order_lv3.PRODUCESTATE = "01"; order_lv3.PRODUCETYPE = order_lv1.ORDERTYPE; order_lv3.QTY = int.Parse(order_lv2.QTY); order_lv3.REMARK = TextBoxMemo.Text; order_lv3.EXPECTCOMPLETEDATE = new DateTime(); order_lv3.FIRST_TFCODE = "0"; if (TextBoxOrdProduce.Text.Trim() != "") { order_lv3.SingleVolume = int.Parse(TextBoxSingleVolume.Text.Trim().ToString()); if (order_lv3.SingleVolume != 0) { string message = ""; if (order_lv3_bll.bAddProduce(order_lv3, out message)) { //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "<script type='text/javascript'>alert('添加三级订单成功!');</script>", false); //触发查询功能刷新页面 ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "<script type='text/javascript'>alert('添加三级订单成功!');window.parent.document.getElementById('ContentPlaceHolder1_btnSearch').click();</script>", false); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "<script type='text/javascript'>alert('" + message + "');</script>", false); } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "<script type='text/javascript'>alert('单量不能为0!');</script>", false); } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "<script type='text/javascript'>alert('三级订单号不能为空!');</script>", false); } }
private void InitUI() { TextBoxOrderItem.ReadOnly = true; string orderid3 = Request.QueryString["orderid3"].ToString(); TB_ORDER_LEVEL3 order_lv3 = order_lv3_bll.GetOrderProduce(orderid3); TB_ORDER_LEVEL2 order_lv2 = order_lv2_bll.GetOrderItemByID(order_lv3.ORDERITEMID); TextBoxOrderItem.Text = order_lv2.ITEMNO; LabelOrderLv4no.Text = order_lv2.ITEMNO; TextBoxOrderLv4.Text = ""; TextBoxOrderLv4Num.Text = "0"; DataTable dt = model_scheme_bll.GetModelSchemeAll(""); DropDownListModelNo.DataSource = dt; DropDownListModelNo.DataValueField = "modelid"; DropDownListModelNo.DataTextField = "modelno"; DropDownListModelNo.DataBind(); }
private void InitUI() { TextBoxOrderNo.ReadOnly = true; string id = ""; if (Request.QueryString["orderid2"] != null) { id = Request.QueryString["orderid2"].ToString(); TB_ORDER_LEVEL2 order_lv2 = order_lv2_bll.GetOrderItemByID(id); TB_ORDER_LEVEL1 order_lv1 = order_lv1_bll.GetOrderOrderByID(order_lv2.ORDERID); TextBoxOrderNo.Text = order_lv1.ORDERNO; TextBoxENDASSETCODE.Text = order_lv2.ENDASSETCODE; TextBoxENDASSETNO.Text = order_lv2.ENDASSETNO; TextBoxINSPECTIONNO.Text = order_lv2.INSPECTIONNO; TextBoxMemo.Text = order_lv2.NOTE; TextBoxMETERCONSTANT.Text = order_lv2.METERCONSTANT.ToString(); //TextBoxOrderNo.Text = order_lv2.ORDERID; TextBoxOrderNum.Text = order_lv2.QTY; TextBoxSTARTASSETCODE.Text = order_lv2.STARTASSETCODE; TextBoxSTARTASSETNO.Text = order_lv2.STARTASSETNO; TextBoxSuffix.Text = order_lv2.ITEMNO; TextBoxTEMPNOEND.Text = order_lv2.TEMPNOEND; TextBoxTEMPNOSTART.Text = order_lv2.TEMPNOSTART; DropDownListACCURACY.SelectedValue = order_lv2.ACCURACY; DropDownListFREQUENCY.SelectedValue = order_lv2.FREQUENCY; DropDownListMETERCURRENT.SelectedValue = order_lv2.METERCURRENT; DropDownListProductIndex.SelectedValue = DropDownListProductIndex.Items.FindByText(order_lv2.prod_number) == null ? "" : DropDownListProductIndex.Items.FindByText(order_lv2.prod_number).Value; DropDownListPRODUCTMODEL.SelectedValue = DropDownListPRODUCTMODEL.Items.FindByText(order_lv2.prod_id) == null?"":DropDownListPRODUCTMODEL.Items.FindByText(order_lv2.prod_id).Value; DropDownListVOLTAGE.SelectedValue = order_lv2.VOLTAGE; ChooseDate1.SelectedDate = int.Parse(order_lv2.DELEVERYDATE.Year.ToString()) < 2000 ? DateTime.Now.AddDays(30) : order_lv2.DELEVERYDATE; DropDownListPro_Sort.SelectedValue = order_lv2.PRO_SORT; } else { id = Request.QueryString["orderid1"].ToString(); TB_ORDER_LEVEL1 order_lv1 = order_lv1_bll.GetOrderOrderByID(id); TextBoxOrderNo.Text = order_lv1.ORDERNO; } }
protected void btnAdd_Click(object sender, EventArgs e) { string orderitemid = Request.QueryString["OrderItemID"].ToString(); TB_ORDER_LEVEL2 orderitem = order_lv2_bll.GetOrderItemByID(orderitemid); DataTable dt_orderproduce = order_lv3_bll.GetOrderProduceListByItemId(orderitemid); DataRow dr = dt_orderproduce.NewRow(); dr["PRODUCEORDERNAME"] = ""; dr["DICT_NAME_CN"] = "未录入"; dr["QTY"] = orderitem.QTY; dr["COMPLETEQTY"] = "0"; dr["PRODUCEID"] = ""; dr["ORDERCONTROL"] = "0"; dr["PROD_CONTROL"] = "0"; dt_orderproduce.Rows.Add(dr); GridView_OrderProduce.DataSource = dt_orderproduce; GridView_OrderProduce.DataBind(); PageQueryAdapter1.RecordCount = dt_orderproduce.Rows.Count; int tmp = PageQueryAdapter1.RecordCount / PageQueryAdapter1.PageSize; PageQueryAdapter1.PageCount = PageQueryAdapter1.RecordCount % PageQueryAdapter1.PageSize > 0 ? tmp + 1 : tmp; }
//添加二级订单 protected void ButtonSure_Click(object sender, EventArgs e) { TB_ORDER_LEVEL2 order_item = new TB_ORDER_LEVEL2(); if (Request.QueryString["orderid2"] != null) { string id = Request.QueryString["orderid2"].ToString(); order_item = order_lv2_bll.GetOrderItemByID(id); } else { order_item.ORDERID = Request.QueryString["orderid1"].ToString(); } order_item.ACCURACY = DropDownListACCURACY.SelectedValue; order_item.ANALYSEDATE = DateTime.Now; order_item.ANALYSUSERID = this.Staff.StaffId; order_item.COMPLETEQTY = 0; order_item.ENDASSETCODE = TextBoxENDASSETCODE.Text; order_item.ENDASSETNO = TextBoxENDASSETNO.Text; order_item.FREQUENCY = DropDownListFREQUENCY.SelectedValue; order_item.INSPECTIONNO = TextBoxINSPECTIONNO.Text; //二级订单号 = 上级订单号 + 后缀 //order_item.ORDERID = Session["OrderM_orderid1"].ToString(); order_item.ITEMNO = TextBoxSuffix.Text.Trim(); order_item.ITEMSTATE = "01"; order_item.METERCONSTANT = int.Parse(TextBoxMETERCONSTANT.Text); order_item.METERCURRENT = DropDownListMETERCURRENT.SelectedValue; order_item.prod_id = DropDownListPRODUCTMODEL.SelectedItem.Text; if (DropDownListProductIndex.SelectedItem == null) { order_item.prod_number = ""; } else { order_item.prod_number = DropDownListProductIndex.SelectedItem.Text; } order_item.NOTE = TextBoxMemo.Text.Trim(); order_item.ORDER_DESCRIPTION = ""; order_item.QTY = TextBoxOrderNum.Text; order_item.STARTASSETCODE = TextBoxSTARTASSETCODE.Text; order_item.STARTASSETNO = TextBoxSTARTASSETNO.Text; order_item.TEMPNOEND = TextBoxTEMPNOEND.Text; order_item.TEMPNOSTART = TextBoxTEMPNOSTART.Text; order_item.VOLTAGE = DropDownListVOLTAGE.SelectedValue; order_item.PRO_SORT = DropDownListPro_Sort.SelectedValue; if (ChooseDate1.SelectedDate.HasValue) { order_item.DELEVERYDATE = (DateTime)ChooseDate1.SelectedDate; if (Request.QueryString["orderid2"] != null) { order_item.ORDERITEMID = Request.QueryString["orderid2"].ToString(); if (order_lv2_bll.bAlterOrd_OrderItem(order_item)) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "<script type='text/javascript'>alert('变更二级订单成功!');RefreshFatherAspx();</script>", false); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "<script type='text/javascript'>alert('变更二级订单失败!');</script>", false); } } else { int intMETERCONSTANT = 0; int intOrderNum = 0; bool resultMETERCONSTANT = int.TryParse(TextBoxMETERCONSTANT.Text.Trim(), out intMETERCONSTANT); bool resultOrderNum = int.TryParse(TextBoxOrderNum.Text.Trim(), out intOrderNum); //bool bool_datetime = DateTime.TryParse(); if (TextBoxSuffix.Text.Trim() != "" && resultMETERCONSTANT && order_item.METERCONSTANT > 0 && resultOrderNum && intOrderNum > 0) { string message = ""; if (!order_lv2_bll.bAddOrder(order_item, out message)) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "<script type='text/javascript'>alert('" + message + "');</script>", false); } else { //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "<script type='text/javascript'>alert('添加二级订单成功!');</script>", false); //触发查询功能刷新页面 ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "<script type='text/javascript'>alert('添加二级订单成功!');window.parent.document.getElementById('ContentPlaceHolder1_btnSearch').click();</script>", false); } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "<script type='text/javascript'>alert('存在必填项没有填写正确,请确认:二级订单号不能为空;电表常数、订单数量不能为空且要大于0!');</script>", false); } } } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "<script type='text/javascript'>alert('请选择交货时间!');</script>", false); } }