Beispiel #1
0
        protected void update2(object sender, EventArgs e)
        {
            Return_lineDC DC                = new Return_lineDC();
            int           return_line_id    = int.Parse(return_line_id2.Value);
            string        return_wo_no      = return_wo_no2.Value;
            int           seq_operation_num = 0;
            string        item_name         = item_name2.Value;
            int           subinventory      = 0;
            string        locator           = DropDownList4.Items[DropDownList4.SelectedIndex].Value;
            int           quit_num          = 0;

            if (String.IsNullOrEmpty(item_name2.Value))
            {
                PageUtil.showToast(this.Page, "请输入料号!");
            }
            else if (String.IsNullOrEmpty(quit_num2.Value))
            {
                PageUtil.showToast(this.Page, "请输入退料数量!");
            }
            else
            {
                try
                {
                    seq_operation_num = int.Parse(seq_operation_num2.Items[seq_operation_num2.SelectedIndex].Value);
                    subinventory      = int.Parse(DropDownList3.Items[DropDownList3.SelectedIndex].Value);
                    quit_num          = int.Parse(quit_num2.Value);
                }
                catch (Exception ex)
                {
                    PageUtil.showToast(this.Page, "数据转换出错,请检查数据格式!");
                    return;
                }
                bool a = DC.updateReturn_line(return_wo_no, return_line_id, seq_operation_num, item_name, quit_num, subinventory, locator);
                if (a == true)
                {
                    try
                    {
                        Repeater1.DataSource = DC.getReturn_lineByReturn_line_id(return_line_id);
                        if (Repeater1.DataSource == null)
                        {
                            PageUtil.showToast(this.Page, "没有该条数据,查询失败!");
                        }
                        else
                        {
                            Repeater1.DataBind();
                            PageUtil.showToast(this.Page, "数据查询成功!");
                        }
                    }
                    catch (Exception ex)
                    {
                        PageUtil.showToast(this.Page, "数据查询错误!");
                    }
                    PageUtil.showToast(this.Page, "更新单身成功!");
                }
                else
                {
                    PageUtil.showToast(this.Page, "更新单身失败!");
                }
            }
        }
Beispiel #2
0
        protected void Opration_SingelQuery(object sender, EventArgs e)
        {
            Return_lineDC DC = new Return_lineDC();
            string        subinventory = singlequery_subinventory.Value;
            string        region = singlequery_region.Value;
            string        item_name = singlequery_item_name.Value;
            string        return_qty = singlequery_return_qty.Value;
            string        return_line_id1 = return_line_id.Value;
            int           a, return_qty1, return_line_id2;

            try
            {
                return_qty1     = int.Parse(return_qty);
                return_line_id2 = int.Parse(return_line_id1);
                a = DC.updateNum(subinventory, region, item_name, return_qty1, return_line_id2);
                if (a > 0)
                {
                    PageUtil.showToast(this.Page, "退料成功!");
                }
                else
                {
                    PageUtil.showToast(this.Page, "数据失败!");
                }
            }
            catch (Exception ex)
            {
                PageUtil.showToast(this.Page, "数据转换出错!");
            }
        }
Beispiel #3
0
        protected void delete_single_query(object sender, EventArgs e)
        {
            Return_lineDC DC = new Return_lineDC();
            //List<ModelReturn_line> Data;
            int  return_line_id = int.Parse(lab3.Value);
            bool a = DC.deleteReturn_line(return_line_id);

            if (a == true)
            {
                PageUtil.showToast(this.Page, "删除单身成功!");
                //Data = DC.getReturn_lineBySome("", "", "", "", "");


                Repeater1.DataSource = DC.getReturn_lineBySome("", "", "", "", "");

                if (Repeater1.DataSource == null)
                {
                    PageUtil.showToast(this.Page, "没有该条数据,查询失败!");
                }
                else
                {
                    Repeater1.DataBind();
                    PageUtil.showToast(this.Page, "数据查询成功!");
                }
                Repeater1.DataBind();
            }
            else
            {
                PageUtil.showToast(this.Page, "删除单身失败!");
            }
        }
Beispiel #4
0
        //删除单头
        protected void delete1(object sender, EventArgs e)
        {
            Return_headerDC DC         = new Return_headerDC();
            string          invoice_no = lab1.Value;
            bool            a          = DC.deleteReturn_header(invoice_no);

            if (a == true)
            {
                string invoice_no1 = invoice_no4.Value;
                try
                {
                    Line_Repeater.DataSource = DC.getReturn_headerByLikeINVOICE_NO(invoice_no1);
                    if (Line_Repeater.DataSource == null)
                    {
                        PageUtil.showToast(this, "数据库中没有对应数据,请添加数据后再查询");
                    }
                    else
                    {
                        Line_Repeater.DataBind();
                    }
                }
                catch (Exception ex)
                {
                    PageUtil.showToast(this.Page, "数据查询失败!");
                }
                Return_lineDC DC1          = new Return_lineDC();
                string        return_wo_no = return_wo_no4.Value;
                try
                {
                    Repeater1.DataSource = DC1.getReturn_lineByLikeRETURN_WO_NO(return_wo_no);
                    if (Repeater1.DataSource == null)
                    {
                        PageUtil.showToast(this, "数据库中没有对应数据,请添加数据后再查询");
                    }
                    else
                    {
                        Repeater1.DataBind();
                    }
                }
                catch (Exception ex)
                {
                    PageUtil.showToast(this.Page, "数据查询错误!");
                }
                PageUtil.showToast(this.Page, "单据号" + invoice_no + "删除成功!");
            }
            else
            {
                PageUtil.showToast(this.Page, "单据号" + invoice_no + "删除失败!");
            }
        }
Beispiel #5
0
        //获取料号
        protected void getItem_nameByReturn_wo_no(object sender, EventArgs e)
        {
            Return_lineDC DC          = new Return_lineDC();
            string        Reurn_wo_no = return_wo_no.Value;

            if (String.IsNullOrEmpty(Reurn_wo_no))
            {
                PageUtil.showToast(this.Page, "请输入工单号");
            }
            try
            {
                item_name_Insert.Value = DC.getItem_nameByReturn_wo_no(Reurn_wo_no);
            }
            catch
            {
                PageUtil.showToast(this.Page, "该工单号下,无料号对应");
            }
        }
Beispiel #6
0
        protected void select_singlequery(object sender, EventArgs e)
        {
            List <ModelReturn_line> Data;
            Return_lineDC           DC = new Return_lineDC();
            string region;
            string return_wo_no      = singlequery_return_wo_id.Value;
            string uom               = singlequery_uom_id.Value;
            string seq_operation_num = seq_operation_num1.SelectedValue;

            if (seq_operation_num.Equals("选择制程"))
            {
                seq_operation_num = "";
            }
            string Subinventory = Subinventory1.SelectedValue;

            if (Subinventory.Equals("选择库别"))
            {
                Subinventory = "";
            }
            region = DropDownList2.SelectedValue;
            if (region.Equals("选择区域"))
            {
                region = "";
            }
            //Data = DC.getReturn_lineBySome(Subinventory, return_wo_no, seq_operation_num, uom, region);
            //if (Data != null)
            //{
            Repeater1.DataSource = DC.getReturn_lineBySome(Subinventory, return_wo_no, seq_operation_num, uom, region);
            if (Repeater1.DataSource == null)
            {
                PageUtil.showToast(this.Page, "没有该条数据,查询失败!");
            }
            else
            {
                Repeater1.DataBind();
                PageUtil.showToast(this.Page, "数据查询成功!");
            }
            //}
            //else
            PageUtil.showToast(this.Page, "没有该条数据,查询失败!");
            seq_operation_num1.SelectedValue = "选择制程";
            Subinventory1.SelectedValue      = "选择库别";
            DropDownList2.SelectedValue      = "选择区域";
        }
Beispiel #7
0
        //查询单身
        protected void select2(object sender, EventArgs e)
        {
            Return_lineDC DC           = new Return_lineDC();
            string        return_wo_no = return_wo_no4.Value;

            try
            {
                Repeater1.DataSource = DC.getReturn_lineByLikeRETURN_WO_NO(return_wo_no);
                if (Repeater1.DataSource == null)
                {
                    PageUtil.showToast(this, "数据库中没有对应数据,请添加数据后再查询");
                }
                Repeater1.DataBind();
            }
            catch (Exception ex)
            {
                PageUtil.showToast(this.Page, "数据查询错误!");
            }
        }
Beispiel #8
0
        //提交单身
        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, "添加单身失败!");
            }
            //}
        }