private void BindData()
    {
        int id = (int)ViewState["ID"];

        ORD_OrderApply apply = new ORD_OrderApplyBLL(id).Model;

        if (apply == null)
        {
            Response.Redirect("FeeApplyList.aspx");
        }



        pn_OrderApply.BindData(apply);
        ViewState["Type"] = apply.Type;

        int month = new AC_AccountMonthBLL(apply.AccountMonth).Model.Month;

        ORD_OrderLimitFactorBLL limitbll = new ORD_OrderLimitFactorBLL();

        ViewState["Limit"] = limitbll.GetLimitInfo(apply.AccountMonth, apply.Client);

        #region 绑定当前申请单的管理片区
        Label lb_OrganizeCity = (Label)pn_OrderApply.FindControl("ORD_OrderApply_OrganizeCity");
        lb_OrganizeCity.Text = TreeTableBLL.GetFullPathName("MCS_Sys.dbo.Addr_OrganizeCity", apply.OrganizeCity);
        #endregion

        BindGrid();
    }
示例#2
0
 private void Approve(int approveFlag)
 {
     foreach (GridViewRow row in gv_List.Rows)
     {
         CheckBox chk = (CheckBox)row.FindControl("cbx");
         if (chk.Checked)
         {
             int id = (int)gv_List.DataKeys[row.RowIndex]["ORD_OrderLimitFactor_ID"];
             ORD_OrderLimitFactorBLL _bll = new ORD_OrderLimitFactorBLL(id);
             _bll.Model.ApproveFlag = approveFlag;
             _bll.Update();
         }
     }
     BindGrid();
 }
 protected void BtnAdd_Click(object sender, EventArgs e)
 {
     if (ORD_OrderLimitFactorBLL.GetModelList("AccountMonth=" + ddl_AccountMonth.SelectedValue + " AND  Client=" + select_client.SelectValue + " AND Product=" + select_Product.SelectValue).Count > 0)
     {
         MessageBox.Show(this, "对不起,所选择的会计月,经销商限制已包含了相应产品");
     }
     ORD_OrderLimitFactorBLL _bll = new ORD_OrderLimitFactorBLL();
     _bll.Model.AccountMonth = int.Parse(ddl_AccountMonth.SelectedValue);
     _bll.Model.Product = int.Parse(select_Product.SelectValue);
     _bll.Model.ApproveFlag=2;
     _bll.Model.Client=int.Parse(select_client.SelectValue);
     _bll.Model.Factor=1.1m;
     _bll.Model.InsertStaff=(int)Session["UserID"];
     _bll.Model.InsertTime=DateTime.Now;
     _bll.Add();
     BindGrid();
 }
示例#4
0
    protected void BtnAdd_Click(object sender, EventArgs e)
    {
        if (ORD_OrderLimitFactorBLL.GetModelList("AccountMonth=" + ddl_AccountMonth.SelectedValue + " AND  Client=" + select_client.SelectValue + " AND Product=" + select_Product.SelectValue).Count > 0)
        {
            MessageBox.Show(this, "对不起,所选择的会计月,经销商限制已包含了相应产品");
        }
        ORD_OrderLimitFactorBLL _bll = new ORD_OrderLimitFactorBLL();

        _bll.Model.AccountMonth = int.Parse(ddl_AccountMonth.SelectedValue);
        _bll.Model.Product      = int.Parse(select_Product.SelectValue);
        _bll.Model.ApproveFlag  = 2;
        _bll.Model.Client       = int.Parse(select_client.SelectValue);
        _bll.Model.Factor       = 1.1m;
        _bll.Model.InsertStaff  = (int)Session["UserID"];
        _bll.Model.InsertTime   = DateTime.Now;
        _bll.Add();
        BindGrid();
    }
示例#5
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        #region 修改明细
        foreach (GridViewRow row in gv_List.Rows)
        {
            ORD_OrderLimitFactorBLL _bll = new ORD_OrderLimitFactorBLL(int.Parse(gv_List.DataKeys[row.RowIndex]["ORD_OrderLimitFactor_ID"].ToString()));
            _bll.Model.UpdateStaff = int.Parse(Session["UserID"].ToString());
            //_bll.Model.Factor = decimal.Parse(((TextBox)row.FindControl("tbx_Factor")).Text);
            _bll.Model.TheoryQuantity = int.Parse(((TextBox)row.FindControl("tbx_Quantity")).Text);
            _bll.Model.UpperLimit     = int.Parse(((TextBox)row.FindControl("tbx_UpperLimit")).Text);
            _bll.Model.LowerLimit     = int.Parse(((TextBox)row.FindControl("tbx_LowerLimit")).Text);
            _bll.Update();
        }

        #endregion
        BindGrid();
        MessageBox.Show(this, "保存成功!");
    }
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        #region 修改明细
        foreach (GridViewRow row in gv_List.Rows)
        {
            ORD_OrderLimitFactorBLL _bll = new ORD_OrderLimitFactorBLL(int.Parse(gv_List.DataKeys[row.RowIndex]["ORD_OrderLimitFactor_ID"].ToString()));
            _bll.Model.UpdateStaff = int.Parse(Session["UserID"].ToString());
            //_bll.Model.Factor = decimal.Parse(((TextBox)row.FindControl("tbx_Factor")).Text);
            _bll.Model.TheoryQuantity = int.Parse(((TextBox)row.FindControl("tbx_Quantity")).Text);
            _bll.Model.UpperLimit = int.Parse(((TextBox)row.FindControl("tbx_UpperLimit")).Text);
            _bll.Model.LowerLimit = int.Parse(((TextBox)row.FindControl("tbx_LowerLimit")).Text);
            _bll.Update();
        }

        #endregion
        BindGrid();
        MessageBox.Show(this, "保存成功!");
    }
    private void BindData()
    {
        int id = (int)ViewState["ID"];

        ORD_OrderApply apply = new ORD_OrderApplyBLL(id).Model;

        if (apply == null) Response.Redirect("OrderApplyList.aspx");

        if (apply["ProductType"] != "1") priceEnable = true;

        pn_OrderApply.BindData(apply);
        ViewState["Type"] = apply.Type;

        int month = new AC_AccountMonthBLL(apply.AccountMonth).Model.Month;

        ORD_OrderLimitFactorBLL limitbll = new ORD_OrderLimitFactorBLL();
        ViewState["Limit"] = limitbll.GetLimitInfo(apply.AccountMonth, apply.Client);

        #region 绑定当前申请单的管理片区
        Label lb_OrganizeCity = (Label)pn_OrderApply.FindControl("ORD_OrderApply_OrganizeCity");
        lb_OrganizeCity.Text = TreeTableBLL.GetFullPathName("MCS_Sys.dbo.Addr_OrganizeCity", apply.OrganizeCity);
        #endregion

        #region 根据审批状态控制页面

        if (apply.State != 1 && apply.State != 8)
        {
            //提交 状态

            pn_OrderApply.SetControlsEnable(false);
            gv_ProductList.Columns[0].Visible = false;                             //选择 列
            gv_ProductList.Columns[gv_ProductList.Columns.Count - 1].Visible = false;     //删除 列
            bt_Save.Visible = false;
            bt_Submit.Visible = false;
            bt_Delete.Visible = false;
            //可见调整数量及原因
            gv_ProductList.Columns[gv_ProductList.Columns.Count - 4].Visible = true;      //调整原因
            gv_ProductList.Columns[gv_ProductList.Columns.Count - 5].Visible = true;      //调整金额
            bt_SaveAdjust.Visible = false;
        }

        if (apply.State == 2)
        {

            bt_SaveAdjust.Visible = false;

            ///已提交状态,审批过程中,可以作申请数量调整
            if (Request.QueryString["Decision"] != "" && Request.QueryString["Decision"] == "Y")
            {
                bt_SaveAdjust.Visible = true;
            }

        }

        if (apply.State >= 3)
        {
            bt_SaveAdjust.Visible = false;

            //审批通过
            gv_ProductList.Columns[gv_ProductList.Columns.Count - 3].Visible = true;      //已发放数量
        }
        #endregion

        BindGrid();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region 判断传入参数是否为SheetCode
            if (Request.QueryString["SheetCode"] != null)
            {
                string code = Request.QueryString["SheetCode"];

                IList<ORD_OrderApply> list = ORD_OrderApplyBLL.GetModelList("SheetCode='" + code + "'");
                if (list.Count > 0)
                {
                    Response.Redirect("OrderProductApplyDetail.aspx?ID=" + list[0].ID.ToString());
                }
                else
                    Response.Redirect("OrderApplyList.aspx");
            }
            #endregion
            ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);

            BindDropDown();
            ViewState["Product"] = 0;

            #region 创建空的列表
            ListTable<ORD_OrderApplyDetail> _details = new ListTable<ORD_OrderApplyDetail>(new ORD_OrderApplyBLL((int)ViewState["ID"]).Items, "Product");
            ViewState["Details"] = _details;
            #endregion

            if (Session["LogisticsOrderApplyDetail"] != null && (int)ViewState["ID"] == 0)
            {
                #region 新费用申请时,初始化申请信
                ORD_OrderCartBLL cart = (ORD_OrderCartBLL)Session["LogisticsOrderApplyDetail"];
                ORD_OrderApply model = new ORD_OrderApply();
                if (cart.Client != 0)
                {
                    model.OrganizeCity = new CM_ClientBLL(cart.Client).Model.OrganizeCity;
                    model.Client = cart.Client;
                }
                model.InsertStaff = (int)Session["UserID"];
                model.InsertTime = DateTime.Now;
                model["IsSpecial"] = cart.IsSpecial.ToString();
                model.Type = cart.Type;
                ViewState["Type"] = cart.Type;
                model["ProductBrand"] = cart.Brand.ToString();
                model["ProductType"] = cart.OrderType.ToString();
                if (cart.OrderType != 1) priceEnable = true;
                model.AccountMonth = AC_AccountMonthBLL.GetCurrentMonth();

                ORD_OrderLimitFactorBLL limitbll = new ORD_OrderLimitFactorBLL();
                ViewState["Limit"] = limitbll.GetLimitInfo(Convert.ToInt32(model.AccountMonth), cart.Client);
                bt_Submit.Visible = false;

                foreach (ORD_OrderCart item in cart.Items)
                {
                    ORD_OrderApplyDetail _detailmodel = new ORD_OrderApplyDetail();
                    _detailmodel.Price = item.Price;
                    _detailmodel.Product = item.Product;
                    _detailmodel.BookQuantity = item.BookQuantity;
                    _details.Add(_detailmodel);
                }
                ViewState["Details"] = _details;
                pn_OrderApply.BindData(model);
                BindGrid();
                #endregion
            }
            else
            {
                BindData();
            }

            Header.Attributes["WebPageSubCode"] = "Type=" + ViewState["Type"].ToString();

        }
    }
    private void BindData()
    {
        int id = (int)ViewState["ID"];

        ORD_OrderApply apply = new ORD_OrderApplyBLL(id).Model;

        if (apply == null) Response.Redirect("FeeApplyList.aspx");

        pn_OrderApply.BindData(apply);
        ViewState["Type"] = apply.Type;

        int month = new AC_AccountMonthBLL(apply.AccountMonth).Model.Month;

        ORD_OrderLimitFactorBLL limitbll = new ORD_OrderLimitFactorBLL();
        ViewState["Limit"] = limitbll.GetLimitInfo(apply.AccountMonth, apply.Client);

        #region 绑定当前申请单的管理片区
        Label lb_OrganizeCity = (Label)pn_OrderApply.FindControl("ORD_OrderApply_OrganizeCity");
        lb_OrganizeCity.Text = TreeTableBLL.GetFullPathName("MCS_Sys.dbo.Addr_OrganizeCity", apply.OrganizeCity);
        #endregion

        BindGrid();
    }
 private void Approve(int approveFlag)
 {
     foreach (GridViewRow row in gv_List.Rows)
     {
         CheckBox chk = (CheckBox)row.FindControl("cbx");
         if (chk.Checked)
         {
             int id = (int)gv_List.DataKeys[row.RowIndex]["ORD_OrderLimitFactor_ID"];
             ORD_OrderLimitFactorBLL _bll = new ORD_OrderLimitFactorBLL(id);
             _bll.Model.ApproveFlag = approveFlag;
             _bll.Update();
         }
     }
     BindGrid();
 }
示例#11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            #region 判断传入参数是否为SheetCode
            if (Request.QueryString["SheetCode"] != null)
            {
                string code = Request.QueryString["SheetCode"];

                IList <ORD_OrderApply> list = ORD_OrderApplyBLL.GetModelList("SheetCode='" + code + "'");
                if (list.Count > 0)
                {
                    Response.Redirect("OrderProductApplyDetail.aspx?ID=" + list[0].ID.ToString());
                }
                else
                {
                    Response.Redirect("OrderApplyList.aspx");
                }
            }
            #endregion
            ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);

            BindDropDown();
            ViewState["Product"] = 0;

            #region 创建空的列表
            ListTable <ORD_OrderApplyDetail> _details = new ListTable <ORD_OrderApplyDetail>(new ORD_OrderApplyBLL((int)ViewState["ID"]).Items, "Product");
            ViewState["Details"] = _details;
            #endregion

            if (Session["LogisticsOrderApplyDetail"] != null && (int)ViewState["ID"] == 0)
            {
                #region 新费用申请时,初始化申请信
                ORD_OrderCartBLL cart  = (ORD_OrderCartBLL)Session["LogisticsOrderApplyDetail"];
                ORD_OrderApply   model = new ORD_OrderApply();
                if (cart.Client != 0)
                {
                    model.OrganizeCity = new CM_ClientBLL(cart.Client).Model.OrganizeCity;
                    model.Client       = cart.Client;
                }
                model.InsertStaff     = (int)Session["UserID"];
                model.InsertTime      = DateTime.Now;
                model["IsSpecial"]    = cart.IsSpecial.ToString();
                model.Type            = cart.Type;
                ViewState["Type"]     = cart.Type;
                model["ProductBrand"] = cart.Brand.ToString();
                model["ProductType"]  = cart.OrderType.ToString();
                if (cart.OrderType != 1)
                {
                    priceEnable = true;
                }
                model.AccountMonth = AC_AccountMonthBLL.GetCurrentMonth();

                ORD_OrderLimitFactorBLL limitbll = new ORD_OrderLimitFactorBLL();
                ViewState["Limit"] = limitbll.GetLimitInfo(Convert.ToInt32(model.AccountMonth), cart.Client);
                bt_Submit.Visible  = false;


                foreach (ORD_OrderCart item in cart.Items)
                {
                    ORD_OrderApplyDetail _detailmodel = new ORD_OrderApplyDetail();
                    _detailmodel.Price        = item.Price;
                    _detailmodel.Product      = item.Product;
                    _detailmodel.BookQuantity = item.BookQuantity;
                    _details.Add(_detailmodel);
                }
                ViewState["Details"] = _details;
                pn_OrderApply.BindData(model);
                BindGrid();
                #endregion
            }
            else
            {
                BindData();
            }

            Header.Attributes["WebPageSubCode"] = "Type=" + ViewState["Type"].ToString();
        }
    }
示例#12
0
    private void BindData()
    {
        int id = (int)ViewState["ID"];

        ORD_OrderApply apply = new ORD_OrderApplyBLL(id).Model;

        if (apply == null)
        {
            Response.Redirect("OrderApplyList.aspx");
        }

        if (apply["ProductType"] != "1")
        {
            priceEnable = true;
        }

        pn_OrderApply.BindData(apply);
        ViewState["Type"] = apply.Type;

        int month = new AC_AccountMonthBLL(apply.AccountMonth).Model.Month;

        ORD_OrderLimitFactorBLL limitbll = new ORD_OrderLimitFactorBLL();

        ViewState["Limit"] = limitbll.GetLimitInfo(apply.AccountMonth, apply.Client);

        #region 绑定当前申请单的管理片区
        Label lb_OrganizeCity = (Label)pn_OrderApply.FindControl("ORD_OrderApply_OrganizeCity");
        lb_OrganizeCity.Text = TreeTableBLL.GetFullPathName("MCS_Sys.dbo.Addr_OrganizeCity", apply.OrganizeCity);
        #endregion

        #region 根据审批状态控制页面

        if (apply.State != 1 && apply.State != 8)
        {
            //提交 状态

            pn_OrderApply.SetControlsEnable(false);
            gv_ProductList.Columns[0].Visible = false;                                //选择 列
            gv_ProductList.Columns[gv_ProductList.Columns.Count - 1].Visible = false; //删除 列
            bt_Save.Visible   = false;
            bt_Submit.Visible = false;
            bt_Delete.Visible = false;
            //可见调整数量及原因
            gv_ProductList.Columns[gv_ProductList.Columns.Count - 4].Visible = true;      //调整原因
            gv_ProductList.Columns[gv_ProductList.Columns.Count - 5].Visible = true;      //调整金额
            bt_SaveAdjust.Visible = false;
        }

        if (apply.State == 2)
        {
            bt_SaveAdjust.Visible = false;

            ///已提交状态,审批过程中,可以作申请数量调整
            if (Request.QueryString["Decision"] != "" && Request.QueryString["Decision"] == "Y")
            {
                bt_SaveAdjust.Visible = true;
            }
        }

        if (apply.State >= 3)
        {
            bt_SaveAdjust.Visible = false;

            //审批通过
            gv_ProductList.Columns[gv_ProductList.Columns.Count - 3].Visible = true;      //已发放数量
        }
        #endregion

        BindGrid();
    }