コード例 #1
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 + "删除失败!");
            }
        }
コード例 #2
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, "数据查询错误!");
            }
        }
コード例 #3
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, "添加单身失败!");
            }
            //}
        }