Пример #1
0
        //查询单头单身
        protected void search(object sender, EventArgs e)
        {
            try
            {
                string Invoice_no = DropDownList_invoice_no.SelectedValue.ToString();

                string   first_time = "2016-07-01 00:00:00";
                DateTime start_time = Convert.ToDateTime(first_time);
                DateTime end_time   = DateTime.Now;

                if (Invoice_no == "--选择领料单号--")
                {
                    Invoice_no = "";
                }

                IssueHeaderReater.DataSource = invoiceDC.getIssueHeaderBySome(Invoice_no, "", "");
                IssueLineReater.DataSource   = invoiceDC.getIssueLineBySome(Invoice_no, "", "", start_time, end_time);

                if (IssueHeaderReater.DataSource == null)
                {
                    PageUtil.showToast(this, "无相关领料单头信息");
                }
                IssueHeaderReater.DataBind();

                if (IssueLineReater.DataSource == null)
                {
                    PageUtil.showToast(this, "无相关领料单身信息");
                }
                IssueLineReater.DataBind();
            }
            catch (Exception e1)
            {
                PageUtil.showToast(this, "查询失败");
            }
        }
Пример #2
0
        //显示打印页面中的所有数据
        protected void DataView()
        {
            InvoiceDC invoiceDC = new InvoiceDC();

            try
            {
                //绑定其他数据
                DataSet dataset_header = new DataSet();
                dataset_header    = invoiceDC.getIssueHeaderBySome(select_text.Value, "", "");
                flex_value.Value  = dataset_header.Tables[0].Rows[0]["flex_value"].ToString();
                description.Value = dataset_header.Tables[0].Rows[0]["description"].ToString();
                remark.Value      = dataset_header.Tables[0].Rows[0]["remark"].ToString();
                issue_type.Value  = dataset_header.Tables[0].Rows[0]["issue_type"].ToString();
                status.Value      = dataset_header.Tables[0].Rows[0]["status"].ToString();


                //绑定Repeater中数据
                DataSet dataset_line = new DataSet();
                dataset_line = invoiceDC.getIssueLineBySome(select_text.Value, "", "", Convert.ToDateTime("2016-07-01 00:00:00"), DateTime.Now);

                printMaterialRequisitionRepeater.DataSource = dataset_line;
                printMaterialRequisitionRepeater.DataBind();
            }
            catch (Exception e)
            {
                PageUtil.showToast(this, "数据库中没有对应数据,请重新输入领料单号");
            }
        }
Пример #3
0
        protected void Select(object sender, EventArgs e)
        {
            try
            {
                //string Invoice_no = DropDownList_issue_no.SelectedValue.ToString();
                //string Item_name = DropDownList_item_name.SelectedValue.ToString();
                string Invoice_no = invoice_no.Value;
                string Item_name  = item_name.Value;
                string Issue_type = Request.Form["issue_type"];

                //if (Invoice_no == "--选择领料单号--")
                //    Invoice_no = "";
                //if (Item_name == "--选择料号--")
                //    Item_name = "";

                string FIRST_TIME = inpend.Value;
                if (FIRST_TIME == "")
                {
                    FIRST_TIME = "2016-07-01 00:00:00";
                }

                start_time = Convert.ToDateTime(FIRST_TIME);
                string LAST_TIME = inpstart.Value;
                end_time = Convert.ToDateTime(LAST_TIME);

                GridView_header.DataSource = invoiceDC.getIssueHeaderBySome(Invoice_no, Issue_type, Item_name);
                GridView_header.DataBind();

                GridView_line.DataSource = invoiceDC.getIssueLineBySome(Invoice_no, Item_name, Issue_type, start_time, end_time);
                GridView_line.DataBind();

                if (GridView_header.DataSource == null)
                {
                    PageUtil.showToast(this, "无相关领料单头信息");
                }
                if (GridView_line.DataSource == null)
                {
                    PageUtil.showToast(this, "无相关领料单身信息");
                }
            }
            catch (Exception e1)
            {
                PageUtil.showToast(this, "查询失败");
            }
        }
Пример #4
0
        //领料工单号改变时
        protected void DropDownList_issue_wo_no_SelectedIndexChanged(object sender, EventArgs e)
        {
            //领料工单号与料号的的二级联动
            try
            {
                DropDownList_item_name.Items.Clear();

                string  text         = DropDownList_issue_wo_no.SelectedValue.ToString();
                DataSet ds_item_name = invoiceDC.getItem_nameByIssue_wo_no(text);
                if (ds_item_name != null)
                {
                    DropDownList_item_name.DataSource     = ds_item_name.Tables[0].DefaultView;
                    DropDownList_item_name.DataValueField = "item_name";
                    DropDownList_item_name.DataTextField  = "item_name";
                    DropDownList_item_name.DataBind();
                }

                DropDownList_item_name.Items.Insert(0, "--选择小料号--");
                DropDownList_item_name.SelectedIndex = 1;
            }
            catch (Exception e2)
            {
                PageUtil.showToast(this, "领料工单号与小料号二级联动失败,请检查工单物料需求表");
                return;
            }

            //根据工单号,和料号。拿需求量和发料量
            try
            {
                if (invoice_no.Value == "")
                {
                    PageUtil.showToast(this, "请输入领料单号再操作");
                    return;
                }

                //检测是否为工单领料,如果是,则需求量,发料量从工单物料需求表中带出
                DataSet ds = invoiceDC.getIssueHeaderBySome(invoice_no.Value, "", "");
                if (ds == null)
                {
                    PageUtil.showToast(this, "该领料单号不存在,请重新输入(确保已经申请成功)");
                    return;
                }

                if (ds.Tables[0].Rows[0]["issue_type"].ToString() == "工单领料")
                {
                    DataSet ds2 = invoiceDC.getRequirement(DropDownList_issue_wo_no.SelectedValue.ToString(), DropDownList_item_name.SelectedValue.ToString());

                    required_qty.Value  = ds2.Tables[0].Rows[0]["required_qty"].ToString();
                    simulated_qty.Value = ds2.Tables[0].Rows[0]["issued_qty"].ToString();
                }
                else
                {
                    required_qty.Value  = "0";
                    simulated_qty.Value = "0";
                }
            }
            catch (Exception ex)
            {
                PageUtil.showToast(this, "获取需求量,发料量失败,请检查工单物料需求表");
                return;
            }

            ////料号与料架的二级联动,去库存明细表中找有此料号的料架
            //try
            //{
            //    DropDownList_frame_key.Items.Clear();

            //    string text = DropDownList_item_name.SelectedValue.ToString();
            //    DataSet ds_frame_key = invoiceDC.getFrameByItem_name(text);
            //    if (ds_frame_key != null)
            //    {
            //        DropDownList_frame_key.DataSource = ds_frame_key.Tables[0].DefaultView;
            //        DropDownList_frame_key.DataValueField = "frame_name";
            //        DropDownList_frame_key.DataTextField = "frame_name";
            //        DropDownList_frame_key.DataBind();
            //    }

            //    DropDownList_frame_key.Items.Insert(0, "--选择料架--");
            //    DropDownList_frame_key.SelectedIndex = 1;
            //}
            //catch (Exception e2)
            //{
            //    PageUtil.showToast(this, "小料号与料架二级联动失败,请检查库存明细表");
            //    return;
            //}

            ////料架与库别的二级联动
            //try
            //{
            //    DropDownList_issue_sub_key.Items.Clear();

            //    string text = DropDownList_frame_key.SelectedValue.ToString();
            //    DataSet ds_issue_sub_key = invoiceDC.getSubinventoryByFrame(text);
            //    if (ds_issue_sub_key != null)
            //    {
            //        DropDownList_issue_sub_key.DataSource = ds_issue_sub_key.Tables[0].DefaultView;
            //        DropDownList_issue_sub_key.DataValueField = "subinventory_name";
            //        DropDownList_issue_sub_key.DataTextField = "subinventory_name";
            //        DropDownList_issue_sub_key.DataBind();
            //    }

            //    DropDownList_issue_sub_key.Items.Insert(0, "--选择库别--");
            //    DropDownList_issue_sub_key.SelectedIndex = 1;
            //}
            //catch (Exception e2)
            //{
            //    PageUtil.showToast(this, "料架与库别二级联动失败,请检查是否有关联数据");
            //    return;
            //}


            //料号与库别的二级联动,去库存总表中找有此料号的库别
            try
            {
                DropDownList_issue_sub_key.Items.Clear();

                string  text             = DropDownList_item_name.SelectedValue.ToString();
                DataSet ds_issue_sub_key = invoiceDC.getSubinventoryByItem_name(text);
                if (ds_issue_sub_key != null)
                {
                    DropDownList_issue_sub_key.DataSource     = ds_issue_sub_key.Tables[0].DefaultView;
                    DropDownList_issue_sub_key.DataValueField = "subinventory";
                    DropDownList_issue_sub_key.DataTextField  = "subinventory";
                    DropDownList_issue_sub_key.DataBind();

                    DropDownList_issue_sub_key.Items.Insert(0, "--选择库别--");
                    DropDownList_issue_sub_key.SelectedIndex = 1;
                }
                else
                {
                    PageUtil.showToast(this, "料号与库别二级联动失败,请检查库存总表");
                    return;
                }
            }
            catch (Exception e2)
            {
                PageUtil.showToast(this, "料号与库别二级联动失败,请检查库存总表");
                return;
            }
        }