//提交单头 protected void insert1(object sender, EventArgs e) { Return_headerDC DC = new Return_headerDC(); WoDC DC2 = new WoDC(); string invoice_no = invoice_no2.Value; string quit_type = quit_type1.Items[quit_type1.SelectedIndex].Value; int enabled = 0; int subinventory = 0; string remark = remark1.InnerText; string return_man = Session["LoginName"].ToString(); string wo_no = return_wo_no1.Value; if (String.IsNullOrEmpty(invoice_no)) { PageUtil.showToast(this.Page, "请点击插入自动生成单据号!"); } else if (String.IsNullOrEmpty(return_wo_no1.Value)) { PageUtil.showToast(this.Page, "请输入工单号!"); } List <ModelWO> wo; wo = DC2.getWOByWo_no(wo_no); if (wo == null) { PageUtil.showToast(this.Page, "没有这个工单号,请检查数据"); } else { try { enabled = int.Parse(Enabled1.Items[Enabled1.SelectedIndex].Value); subinventory = int.Parse(Subinventory1.Items[Subinventory1.SelectedIndex].Value); } catch (Exception ex) { PageUtil.showToast(this.Page, "数据转换出错,请检查数据格式!"); } bool a = DC.insertReturn_header(invoice_no, quit_type, subinventory, enabled, wo[0].Wo_key, return_man, remark); if (a == true) { PageUtil.showToast(this.Page, "添加退料单头成功!"); Line_Repeater.DataSource = DC.getReturn_headerByLikeINVOICE_NO(invoice_no); if (Line_Repeater.DataSource == null) { PageUtil.showToast(this, "数据库中没有对应数据,请添加数据后再查询"); } else { Line_Repeater.DataBind(); } } else { PageUtil.showToast(this.Page, "添加退料单头失败!"); } } }
public void updateWo_noDate(string part_no) { Label2.InnerText = "可用工单:"; WoDC wodc = new WoDC(); DataSet ds2 = wodc.getWo_noBypart_no(part_no); enable_wo_no.DataSource = ds2; enable_wo_no.DataBind(); }
public void ProcessRequest(HttpContext context) { string wo_no = context.Request.Form["wo_no"]; WoDC dc = new WoDC(); List <string> list = dc.getWo_noByInvooice(wo_no); string json = toJson(list); context.Response.ContentType = "text/plain"; context.Response.Write(json); }
//更新单头 protected void update1(object sender, EventArgs e) { Return_headerDC DC = new Return_headerDC(); WoDC woDC = new WoDC(); string invoice_no = quit_invoice_no2.Value; string quit_type = quit_type2.Items[quit_type2.SelectedIndex].Value; int subinventory = 0; int status = 0; int quit_wo_no = 0; string remark = remark2.Value; string return_man = Session["LoginName"].ToString(); if (String.IsNullOrEmpty(quit_wo_no2.Value)) { PageUtil.showToast(this.Page, "请输入工单号!"); } else { try { subinventory = int.Parse(Subinventory4.Items[Subinventory4.SelectedIndex].Value); status = int.Parse(status2.Items[status2.SelectedIndex].Value); quit_wo_no = woDC.getWo_keyByReturn_wo_no(quit_wo_no2.Value); } catch (Exception ex) { PageUtil.showToast(this.Page, "数据转换出错,请检查数据格式!"); return; } bool a = DC.updateReturn_header(invoice_no, quit_type, subinventory, status, quit_wo_no, return_man, remark); if (a == true) { try { Line_Repeater.DataSource = DC.getReturn_headerByLikeINVOICE_NO(invoice_no); if (Line_Repeater.DataSource == null) { PageUtil.showToast(this, "数据库中没有对应数据,请添加数据后再查询"); } Line_Repeater.DataBind(); } catch (Exception ex) { PageUtil.showToast(this.Page, "数据查询失败!"); } PageUtil.showToast(this.Page, "单据号为" + invoice_no + "更新成功!"); } else { PageUtil.showToast(this.Page, "单据号为" + invoice_no + "更新失败!"); } } }
public void ProcessRequest(HttpContext context) { string item_name = context.Request["item_name"]; WoDC dc = new WoDC(); List <string> list = dc.getWo_no_by_item_name(item_name); string json = toJson(list); context.Response.ContentType = "text/plain"; context.Response.Write(json); }
public void ProcessRequest(HttpContext context) { string wo_no = context.Request["wo_no"]; WoDC dc = new WoDC(); List <string> list = dc.getItem_name_by_wo_no(wo_no); string json = toJson(list); context.Response.ContentType = "text/plain"; context.Response.Write(json); }
public void ProcessRequest(HttpContext context) { WoDC header_dc = new WoDC(); List <string> list = new List <string>(); list = header_dc.getAllWo_no(); string json = toJson(list); context.Response.ContentType = "text/plain"; context.Response.Write(json); }
//显示打印页面中的所有数据 protected void DataView() { WoDC dc = new WoDC(); try { //绑定Repeater中数据 DataSet dataset_line = new DataSet(); dataset_line = dc.getWOBySimulate_id(select_text.Value); printSinglePreparationRepeater.DataSource = dataset_line; printSinglePreparationRepeater.DataBind(); } catch (Exception e) { PageUtil.showToast(this, "数据库中没有对应数据,请重新输入领料单号"); } }
//提交单身 protected void insert2(object sender, EventArgs e) { Return_lineDC DC = new Return_lineDC(); WoDC woDC = new WoDC(); int return_header_id = int.Parse(Text1.Value); string return_wo_no1 = return_wo_no.Value; string item_name = item_name_Insert.Value; int seq_operation_num = 0; int subinventory = 0; string region = DropDownList2.Items[DropDownList2.SelectedIndex].Text; int quit_number = 0; if (String.IsNullOrEmpty(quit_num.Value)) { PageUtil.showToast(this.Page, "请输入退料量"); } //Items_onhand_qty_detailDC DC2 = new Items_onhand_qty_detailDC(); //List<ModelItems_onhand_qty_detail> item; //item = DC2.getItems_onhand_qty_detailByITEM_NAME(item_name); //if (item == null) //{ // PageUtil.showToast(this.Page, "您输入的料号不存在"); //} //else //{ try { seq_operation_num = int.Parse(seq_operation_num1.Items[seq_operation_num1.SelectedIndex].Value); subinventory = int.Parse(DropDownList1.Items[DropDownList1.SelectedIndex].Value); quit_number = int.Parse(quit_num.Value); if (quit_number > woDC.getTarget_qtyByReturn_wo_no(return_wo_no1)) { PageUtil.showToast(this.Page, "退料量大于领料量,请重新输入!"); } } catch (Exception ex) { PageUtil.showToast(this.Page, "数据转换出错,请检查数据格式!"); return; } bool a = DC.insertReturn_line(return_wo_no1, seq_operation_num, item_name, quit_number, subinventory, return_header_id, region); if (a == true) { //string return_wo_no2 = return_wo_no4.Value; try { Repeater1.DataSource = DC.getReturn_lineByLikeRETURN_WO_NO(return_wo_no1); if (Repeater1.DataSource == null) { PageUtil.showToast(this, "数据库中没有对应数据,请添加数据后再查询"); } else { Repeater1.DataBind(); } } catch (Exception ex) { PageUtil.showToast(this.Page, "数据查询错误!"); } PageUtil.showToast(this.Page, "添加单身成功!"); } else { PageUtil.showToast(this.Page, "添加单身失败!"); } //} }
//工单入库 protected void workSheetIn(object sender, EventArgs e) { string WO_no = Request.Form["wo_no"]; string Number = number.Value; string subin = DropDownList1.Items[DropDownList1.SelectedIndex].Text; string frame_key = DropDownList2.Items[DropDownList2.SelectedIndex].Value; string create_user; string item_name = Request.Form["item_name"]; if (Session["LoginName"] == null) { PageUtil.showToast(this, "请登录!"); return; } else { create_user = Session["LoginName"].ToString(); } //判断输入是否为空 if (String.IsNullOrWhiteSpace(WO_no) || String.IsNullOrWhiteSpace(Number) || String.IsNullOrWhiteSpace(subin) || String.IsNullOrWhiteSpace(frame_key)) { PageUtil.showToast(this, "入库数据不能为空!"); return; } if (subin == "--选择库别--") { PageUtil.showToast(this.Page, "请选择库别"); return; } if (frame_key == "--选择料架--") { PageUtil.showToast(this.Page, "请选择料架"); return; } int num; int Frame_key; try { num = int.Parse(Number); Frame_key = int.Parse(frame_key); } catch (Exception e3) { PageUtil.showToast(this.Page, "请输入数字"); return; } //判断输入是否为数字 if (!IsNumber(Number)) { PageUtil.showToast(this, "数量只能为数字!"); return; } WoDC dc1 = new WoDC(); int leftNum = dc1.getLeftNum(WO_no); if (leftNum == -1) { PageUtil.showToast(this.Page, "您输入的值有误,请检查后输入"); return; } else if (num > leftNum) { PageUtil.showToast(this.Page, "数量超出,请核对后输入"); return; } TimeSpan ts = DateTime.Now - Convert.ToDateTime(DateTime.Now.ToString("yyyy") + "-01-01"); int day = int.Parse(ts.TotalDays.ToString("F0")); int oneDay = (day % 7) > 0 ? 1 : 0;//如果余数大于0 ,说明已经过了半周 string datecode = DateTime.Now.ToString("yyyy") + ((day / 7) + oneDay).ToString("F0"); SubinventoryDC dc2 = new SubinventoryDC(); List <ModelSubinventory> ds2 = dc2.getSubinventoryBySubinventory_name(subin); if (ds2 == null) { PageUtil.showToast(this.Page, "请输入存在的库别"); return; } //PnDC dc2 = new PnDC(); //int item_id = dc2.getItem_idByItem_name(item_name); //if (item_id == -1) //{ // PageUtil.showToast(this.Page, "料号有误"); // return; //} WorkSheetInDC dc = new WorkSheetInDC(); DataSet ds = dc.workSheetIn(WO_no, num, create_user, item_name, subin, Frame_key, datecode); if (ds == null) { PageUtil.showToast(this, "入库失败,请检查输入数据"); GridView1.DataSource = ds; GridView1.DataBind(); //GridView2.DataSource = ds; //GridView2.DataBind(); return; } try { GridView1.DataSource = ds; GridView1.DataBind(); //GridView2.DataSource = ds; //GridView2.DataBind(); PageUtil.showToast(this, "入库成功!"); } catch { PageUtil.showToast(this, "入库失败!"); } }