Beispiel #1
0
        //显示打印页面中的所有数据
        protected void DataView()
        {
            Transaction_operationDC           transaction_operationdc    = new Transaction_operationDC();
            List <ModelTransaction_operation> modelTransaction_operation = new List <ModelTransaction_operation>();
            WorkSheetInDC worksheetindc = new WorkSheetInDC();

            string transaction_type = "workSheetIn";

            modelTransaction_operation = transaction_operationdc.getTransactionByTransaction_qty(transaction_type, int.Parse(select_text2.Value));

            transaction_time.Value        = modelTransaction_operation[0].Transaction_time.ToLongDateString();
            transaction_create_user.Value = modelTransaction_operation[0].Create_user;

            try
            {
                //绑定Repeater中数据
                DataSet dataset = new DataSet();
                dataset = worksheetindc.getSomeByWo_no(select_text.Value);

                printStorageListRepeater.DataSource = dataset;
                printStorageListRepeater.DataBind();
            }
            catch (Exception e)
            {
                PageUtil.showToast(this, "数据库中没有对应数据,请重新输入需要入庫的工單號");
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            string        wo_no   = context.Request.Form["wo_no"];
            WorkSheetInDC dc      = new WorkSheetInDC();
            string        item_id = dc.getItem_IdByWO_no(wo_no);
            List <string> list    = dc.getOnhand_qtyAndItem_NameByItem_id(item_id);

            string json = toJson(list);

            context.Response.ContentType = "text/plain";

            context.Response.Write(json);
        }
Beispiel #3
0
        //通过工单模糊搜索
        protected void search(object sender, EventArgs e)
        {
            string WO_no = Request.Form["wo_no"];

            WorkSheetInDC dc = new WorkSheetInDC();
            DataSet       ds = dc.getItemOnhandQty(WO_no);

            if (ds != null)
            {
                GridView1.DataSource = ds;
                GridView1.DataBind();

                //GridView2.DataSource = ds;
                //GridView2.DataBind();
                PageUtil.showToast(this, "查询成功!");
            }
        }
Beispiel #4
0
        //工单入库
        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, "入库失败!");
            }
        }