protected void Page_Load(object sender, EventArgs e)
 {
     Session["Local"] = "料架设定";
     if (!IsPostBack)
     {
         SubinventoryDC subdc = new SubinventoryDC();
         List <string>  list  = subdc.getAllSubinventory();
         DropDownList1.DataSource = list;
         DropDownList1.DataBind();
         DropDownList1.Items.Insert(0, "ALL");
         RegionDC dc = new RegionDC();
         DataSet  ds = dc.getEnableRegion();
         if (ds != null)
         {
             DropDownList2.DataSource     = ds.Tables[0].DefaultView;
             DropDownList2.DataValueField = "region_name";
             DropDownList2.DataBind();
             Region_key.DataSource     = ds.Tables[0].DefaultView;
             Region_key.DataValueField = "region_name";
             Region_key.DataBind();
             Region_key2.DataSource     = ds.Tables[0].DefaultView;
             Region_key2.DataValueField = "region_name";
             Region_key2.DataBind();
         }
         DropDownList2.Items.Insert(0, "ALL");
         Region_key.Items.Insert(0, "--------select--------");
     }
 }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["Local"] = "PO退回";
            if (Session["LoginName"] == null)
            {
                PageUtil.showToast(this, "未获取到你的登陆状态,请退出系统重新登录!");
                return;
            }
            if (!IsPostBack)
            {
                SubinventoryDC subDC    = new SubinventoryDC();
                List <string>  sub_list = subDC.getAllSubinventory();
                if (sub_list != null)
                {
                    subinventory_select.DataSource = sub_list;
                    subinventory_select.DataBind();
                }
                else
                {
                    PageUtil.showToast(this, "库别获取出错!");
                }
                subinventory_select.Items.Insert(0, "--选择库别--");

                List <string> list = new List <string>();
                list.Add("PASS");
                list.Add("NO");
                reinspect_result_select.DataSource = list;
                reinspect_result_select.DataBind();
            }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["Local"] = "PO退回";
            if (Session["LoginId"] == null)
            {
                PageUtil.showToast(this, "未获取到你的登陆状态,请退出系统重新登录!");
                return;
            }

            if (!IsPostBack)
            {
                SubinventoryDC subDC = new SubinventoryDC();
                DataSet        ds1   = subDC.getAllUsedSubinventory_name();
                if (ds1 != null)
                {
                    DropDownList1.DataSource     = ds1.Tables[0].DefaultView;
                    DropDownList1.DataValueField = "subinventory_name";
                    DropDownList1.DataBind();
                }
                //else
                //    PageUtil.showAlert(this, "库别载入出错!");
                DropDownList1.Items.Insert(0, "--选择库别--");
                DropDownList2.Items.Insert(0, "--选择区域--");
            }
        }
示例#4
0
        private void BindDrop()          //查询时的数据绑定
        {
            SubinventoryDC subDC = new SubinventoryDC();
            DataSet        ds1   = subDC.getAllUsedSubinventory_name();

            Subinventory1.DataValueField = "subinventory_name";
            Subinventory1.DataSource     = ds1.Tables[0].DefaultView;
            Subinventory1.DataBind();
            Subinventory1.Items.Insert(0, "选择库别");
        }
示例#5
0
        private void BindDrop()
        {
            SubinventoryDC subDC = new SubinventoryDC();
            DataSet        ds1   = subDC.getAllUsedSubinventory_name();

            DropDownList1.DataTextField  = "subinventory_name";
            DropDownList1.DataValueField = "subinventory_key";
            DropDownList1.DataSource     = ds1.Tables[0].DefaultView;
            DropDownList1.DataBind();
            DropDownList1.Items.Insert(0, new ListItem("--选择库别--"));
            DropDownList2.Items.Insert(0, new ListItem("--选择区域--"));
        }
示例#6
0
        /*得到并关联仓库(select标签)*/

        public void ProcessRequest(HttpContext context)
        {
            SubinventoryDC subinventorydc = new SubinventoryDC();

            List <string> list = new List <string>();

            list = subinventorydc.getAllSubinventory();

            string json = toJson(list);

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

            context.Response.Write(json);
        }
示例#7
0
        private void BindDrop1()  //更新的数据绑定
        {
            SubinventoryDC subDC = new SubinventoryDC();
            DataSet        ds1   = subDC.getAllUsedSubinventory_name();

            if (ds1 != null)
            {
                DropDownList3.DataValueField = "subinventory_name";
                DropDownList3.DataSource     = ds1.Tables[0].DefaultView;
                DropDownList3.DataBind();
            }
            else
            {
                PageUtil.showToast(this.Page, "数据载入出错!");
            }
            DropDownList3.Items.Insert(0, "选择库别");
        }
示例#8
0
        public void ProcessRequest(HttpContext context)
        {
            SubinventoryDC subDC = new SubinventoryDC();
            DataSet        ds    = subDC.getAllSubinventory_name();

            List <string> modellist = new List <string>();

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    modellist.Add(dr["subinventory_name"].ToString());
                }
            }
            string json = toJson(modellist);

            context.Response.ContentType = "text/plain";
            context.Response.Write(json);
        }
示例#9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["Local"] = "退料单";
            if (!IsPostBack)
            {
                BindDrop();
                SubinventoryDC  subDC = new SubinventoryDC();
                DataSet         ds1   = subDC.getAllUsedSubinventory_name();
                Wip_operationDC regDC = new Wip_operationDC();
                DataSet         ds2   = regDC.getRegion_nameBySubinventory_name();
                if (ds1 != null)
                {
                    Subinventory4.DataSource     = ds1.Tables[0].DefaultView;
                    Subinventory1.DataSource     = ds1.Tables[0].DefaultView;
                    Subinventory4.DataValueField = "subinventory_key";
                    Subinventory4.DataTextField  = "subinventory_name";
                    Subinventory1.DataValueField = "subinventory_key";
                    Subinventory1.DataTextField  = "subinventory_name";
                    Subinventory4.DataBind();
                    Subinventory1.DataBind();
                }
                else
                {
                    PageUtil.showToast(this.Page, "数据载入出错!");
                }
                Subinventory1.Items.Insert(0, "选择库别");
                if (ds2 != null)
                {
                    seq_operation_num1.DataSource = ds2.Tables[0].DefaultView;

                    seq_operation_num1.DataValueField = "route_id";

                    seq_operation_num1.DataBind();
                }
                else
                {
                    PageUtil.showToast(this.Page, "数据载入出错");
                }
                seq_operation_num1.Items.Insert(0, "选择制程");
            }
        }
示例#10
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, "入库失败!");
            }
        }