/// <summary>
        ///  替换按钮触发事件,暂时作废
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void btn_Replace(Object sender, EventArgs e)
        {
            string Pur_status = ddlStatus.SelectedValue;

            FineUI.Button B_BtnEditCon = Window3.FindControl("PanelGrid4").FindControl("tool_btn").FindControl("BtnEditCon") as FineUI.Button;
            B_BtnEditCon.Hidden = false;
            Window3.Hidden      = false;
        }
 public void ButtonPRODSearch2_Click(Object sender, EventArgs e)
 {
     conditionList = null;
     //conditionList = new List<ConditionFun.SqlqueryCondition>();
     //绑定Grid表格
     FineUI.Grid Grid4 = Window3.FindControl("PanelGrid4").FindControl("Grid4") as FineUI.Grid;
     PRODUCT00Bll.GetInstence().BindGrid(Grid4, 0, 0, InquiryCondition(), sortList);
 }
 /// <summary>
 /// 商品查询
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ButtonPRODSearch_Click(object sender, EventArgs e)
 {
     conditionList = null;
     //conditionList = new List<ConditionFun.SqlqueryCondition>();
     //绑定Grid表格
     FineUI.Grid Grid4 = Window3.FindControl("PanelGrid4").FindControl("Grid4") as FineUI.Grid;
     V_Product01_PRCAREABll.GetInstence().BindGrid(Grid4, 0, 0, InquiryConditionProduct(), sortList);
 }
 /// <summary>
 /// 加载下拉列表
 /// </summary>
 public void LoadList()
 {
     FineUI.DropDownList ccPROD_KIND = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_KIND") as FineUI.DropDownList;
     PROD_KINDBll.GetInstence().BandDropDownListShowKind(this, ccPROD_KIND);
     FineUI.DropDownList ccPROD_DEP = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_DEP") as FineUI.DropDownList;
     PROD_DEPBll.GetInstence().BandDropDownListShowDep(this, ccPROD_DEP);
     FineUI.DropDownList ccPROD_CATE = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_CATE") as FineUI.DropDownList;
     PROD_CateBll.GetInstence().BandDropDownListShowCate(this, ccPROD_CATE);
 }
Exemplo n.º 5
0
        /// <summary>
        /// 添加商品,采购单位未完成,价格取值未完成,税额未完成
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ButtonPRODAdd_Click(object sender, EventArgs e)
        {
            FineUI.Grid Grid4 = Window3.FindControl("PanelGrid4").FindControl("Grid4") as FineUI.Grid;

            int[]  selections    = Grid4.SelectedRowIndexArray;
            string _TAKEIN_ID    = tbxTAKEIN_ID.Text;
            string _Shop_ID      = ddlSHOP_NAME.SelectedValue;
            string _Shop_Name    = ddlSHOP_NAME.SelectedText;
            string result        = "";
            var    m_Shop        = new SHOP00(x => x.SHOP_ID == _Shop_ID);
            string _priceArea_id = m_Shop.SHOP_Price_Area;

            if (!String.IsNullOrEmpty(_TAKEIN_ID))
            {
                foreach (int i in selections)
                {
                    string  _Prod_ID = Grid4.DataKeys[i][0].ToString();
                    string  _shop_id = ddlSHOP_NAME.SelectedValue;
                    var     model    = new V_Product01_PRCAREA(x => x.PROD_ID == _Prod_ID && x.PRCAREA_ID == _priceArea_id);
                    int     rowCount = Grid2.Rows.Count;
                    JObject deObject = new JObject();
                    deObject.Add("Id01", "0");
                    deObject.Add("SHOP_ID01", _Shop_ID);
                    deObject.Add("SHOP_NAME01", _Shop_Name);
                    deObject.Add("TAKEIN_ID01", _TAKEIN_ID);
                    deObject.Add("SNo01", rowCount + 1);
                    deObject.Add("PROD_ID01", _Prod_ID);
                    deObject.Add("PROD_NAME01", model.PROD_NAME1);
                    deObject.Add("QUANTITY01", model.ORDER_QUAN);
                    deObject.Add("STD_UNIT01", model.Purchase_UNIT);
                    deObject.Add("STD_CONVERT01", model.PROD_CONVERT1);
                    deObject.Add("STD_QUAN01", model.Purchase_QUAN);
                    deObject.Add("STD_PRICE01", model.COST);
                    deObject.Add("Tax01", 0);
                    deObject.Add("QUAN101", 0);
                    deObject.Add("QUAN201", 0);
                    deObject.Add("Item_DISC_Amt01", 0);
                    deObject.Add("MEMO", "");
                    deObject.Add("BAT_NO", "");
                    //var OlUser = OnlineUsersBll.GetInstence().GetModelForCache(x => x.UserHashKey == Session[OnlineUsersTable.UserHashKey].ToString());
                    //string lgname = OlUser.Manager_LoginName;
                    //deObject.Add("CRT_USER_ID1", lgname);
                    //deObject.Add("CRT_DATETIME1", DateTime.Now.ToString());
                    //deObject.Add("MOD_USER_ID1", OlUser.Manager_LoginName);
                    //deObject.Add("MOD_DATETIME1", DateTime.Now.ToString());
                    Grid2.AddNewRecord(deObject, true);
                }
            }
            else
            {
                FineUI.Alert.ShowInParent("未选中订单无法添加", FineUI.MessageBoxIcon.Information);
            }
            if (!String.IsNullOrEmpty(result.Trim()))
            {
                FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Information);
            }
        }
 /// <summary>
 /// 添加商品,采购单位未完成,价格取值未完成,税额未完成
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ButtonPRODAdd_Click(object sender, EventArgs e)
 {
     FineUI.DropDownList ddlstock     = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("window_ddl_Stock") as FineUI.DropDownList;
     FineUI.DropDownList ddl_INV_TYPE = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("window_ddl_INV_TYPE") as FineUI.DropDownList;
     string _ddlstock     = ddlstock.SelectedValue;
     string _ddl_INV_TYPE = ddl_INV_TYPE.SelectedValue;
     string _SHOP_ID      = ddlSHOP_NAME.SelectedValue;
     string _Inv_ID       = tbxINV_ID.Text;
 }
 /// <summary>
 /// 新增按钮触发事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void btn_DetailAdd()
 {
     //string Pur_status = ddlStatus.SelectedValue;
     FineUI.Panel P_search = Window3.FindControl("PanelGrid4").FindControl("Panel_Search") as FineUI.Panel;
     P_search.Hidden = false;
     FineUI.DropDownList ddlstock = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("window_ddl_Stock") as FineUI.DropDownList;
     STOCKBll.GetInstence().BandDropDownListStock(this, ddlstock);
     Window3.Hidden = false;
 }
Exemplo n.º 8
0
        /// <summary>
        /// GRID3(商品)检索的判断条件
        /// </summary>
        /// <returns></returns>
        private List <ConditionFun.SqlqueryCondition> InquiryConditionProduct()
        {
            string _SHOP_ID  = ddlSHOP_NAME.SelectedValue;
            var    modelShop = new SHOP00(x => x.SHOP_ID == _SHOP_ID);
            List <ConditionFun.SqlqueryCondition> conditionProdduct00List = new List <ConditionFun.SqlqueryCondition>();

            //取价格区域
            conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.Where, V_Product01_PRCAREATable.PRCAREA_ID, Comparison.Equals, modelShop.SHOP_Price_Area, false, false));

            FineUI.TextBox cPROD_ID = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_ID") as FineUI.TextBox;
            var            _PROD_ID = cPROD_ID.Text;

            if (!String.IsNullOrEmpty(cPROD_ID.Text))
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.And, V_Product01_PRCAREATable.PROD_ID, Comparison.Like, "%" + _PROD_ID + "%", false, false));
            }

            FineUI.TextBox cPROD_NAME = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_NAME") as FineUI.TextBox;
            var            _PROD_NAME = cPROD_NAME.Text;

            if (!String.IsNullOrEmpty(_PROD_NAME))
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.And, V_Product01_PRCAREATable.PROD_NAME1, Comparison.Like, "%" + _PROD_NAME + "%", false, false));
            }
            FineUI.TextBox cPROD_NAME_SPELLING = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_NAME_SPELLING") as FineUI.TextBox;
            var            _PROD_NAME_SPELLING = cPROD_NAME_SPELLING.Text;

            if (!String.IsNullOrEmpty(_PROD_NAME_SPELLING))
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.And, V_Product01_PRCAREATable.PROD_NAME1_SPELLING, Comparison.Like, "%" + _PROD_NAME_SPELLING + "%", false, false));
            }
            FineUI.DropDownList cPROD_KIND = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_KIND") as FineUI.DropDownList;
            var _cPROD_KIND = cPROD_KIND.SelectedValue;

            if (!String.IsNullOrEmpty(_cPROD_KIND) && _cPROD_KIND != "0")
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.And, V_Product01_PRCAREATable.PROD_KIND, Comparison.Equals, _cPROD_KIND, false, false));
            }

            FineUI.DropDownList cPROD_DEP = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_DEP") as FineUI.DropDownList;
            var _PROD_DEP = cPROD_DEP.SelectedValue;

            if (!String.IsNullOrEmpty(_PROD_NAME) && _PROD_DEP != "0")
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.And, V_Product01_PRCAREATable.PROD_DEP, Comparison.Equals, _PROD_DEP, false, false));
            }
            FineUI.DropDownList cPROD_CATE = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_CATE") as FineUI.DropDownList;
            var _PROD_CATE = cPROD_CATE.SelectedValue;

            if (!String.IsNullOrEmpty(_PROD_CATE) && _PROD_CATE != "0")
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.And, V_Product01_PRCAREATable.PROD_CATE, Comparison.Equals, _PROD_CATE, false, false));
            }

            return(conditionProdduct00List);
        }
        /// <summary>
        /// 添加商品,采购单位未完成,价格取值未完成,税额未完成
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ButtonPRODAdd_Click(object sender, EventArgs e)
        {
            FineUI.Grid Grid4 = Window3.FindControl("PanelGrid4").FindControl("Grid4") as FineUI.Grid;

            int[]  selections    = Grid4.SelectedRowIndexArray;
            string _tbxPREPAR_ID = tbxPREPAR_ID.Text;
            string _Shop_ID      = ddlSHOP_NAME.SelectedValue;
            string _Shop_Name    = ddlSHOP_NAME.SelectedText;
            string result        = "";
            var    m_Shop        = new SHOP00(x => x.SHOP_ID == _Shop_ID);
            string _priceArea_id = m_Shop.SHOP_Price_Area;

            if (!String.IsNullOrEmpty(_tbxPREPAR_ID))
            {
                foreach (int i in selections)
                {
                    string  _Prod_ID = Grid4.DataKeys[i][0].ToString();
                    string  _shop_id = ddlSHOP_NAME.SelectedValue;
                    var     model    = new V_Product01_PRCAREA(x => x.PROD_ID == _Prod_ID && x.PRCAREA_ID == _priceArea_id);
                    int     rowCount = Grid2.Rows.Count;
                    JObject deObject = new JObject();
                    deObject.Add("Id01", "0");
                    deObject.Add("SHOP_ID01", _Shop_ID);
                    deObject.Add("SHOP_NAME01", _Shop_Name);
                    deObject.Add("PREPARE_ID01", _tbxPREPAR_ID);
                    deObject.Add("SNo01", rowCount + 1);
                    deObject.Add("PROD_ID01", _Prod_ID);
                    deObject.Add("PROD_NAME01", model.PROD_NAME1);
                    deObject.Add("QUANTITY01", model.ORDER_QUAN);
                    deObject.Add("STD_UNIT01", 0);
                    deObject.Add("STD_CONVERT01", 0);
                    deObject.Add("STD_QUAN01", 0);
                    deObject.Add("STD_PRICE01", 0);
                    deObject.Add("COST01", "");

                    deObject.Add("sProd_ID01", "");
                    deObject.Add("BAT_NO01", "");
                    deObject.Add("IsScales01", 0);
                    deObject.Add("IsFlag01", 0);
                    deObject.Add("Scales_User01", "");
                    deObject.Add("Scale_Date01", DateTime.Now.ToString());


                    deObject.Add("MEMO01", "");
                    Grid2.AddNewRecord(deObject, true);
                }
            }
            else
            {
                FineUI.Alert.ShowInParent("未选中订单无法添加", FineUI.MessageBoxIcon.Information);
            }
            if (!String.IsNullOrEmpty(result.Trim()))
            {
                FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Information);
            }
        }
        /// <summary>
        /// GRID4检索的判断条件
        /// </summary>
        /// <returns></returns>
        private List <ConditionFun.SqlqueryCondition> InquiryCondition()
        {
            List <ConditionFun.SqlqueryCondition> conditionProdduct00List = new List <ConditionFun.SqlqueryCondition>();
            //conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.Where, "1", Comparison.Equals, "1", false, false));
            bool sFlag = true;

            FineUI.TextBox cPROD_ID = Window3.FindControl("PanelGrid4").FindControl("cPROD_ID") as FineUI.TextBox;
            var            _PROD_ID = cPROD_ID.Text;

            if (!String.IsNullOrEmpty(cPROD_ID.Text))
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), PRODUCT00Table.PROD_ID, Comparison.Like, "%" + _PROD_ID + "%", false, false));
                sFlag = false;
            }

            FineUI.TextBox cPROD_NAME = Window3.FindControl("PanelGrid4").FindControl("cPROD_NAME") as FineUI.TextBox;
            var            _PROD_NAME = cPROD_NAME.Text;

            if (!String.IsNullOrEmpty(_PROD_NAME))
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), PRODUCT00Table.PROD_NAME1, Comparison.Like, "%" + _PROD_NAME + "%", false, false));
                sFlag = false;
            }
            FineUI.TextBox cPROD_NAME_SPELLING = Window3.FindControl("PanelGrid4").FindControl("cPROD_NAME_SPELLING") as FineUI.TextBox;
            var            _PROD_NAME_SPELLING = cPROD_NAME_SPELLING.Text;

            if (!String.IsNullOrEmpty(_PROD_NAME_SPELLING))
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), PRODUCT00Table.PROD_NAME1_SPELLING, Comparison.Like, "%" + _PROD_NAME_SPELLING + "%", false, false));
                sFlag = false;
            }
            FineUI.DropDownList cPROD_DEP = Window3.FindControl("PanelGrid4").FindControl("cPROD_DEP") as FineUI.DropDownList;
            var _PROD_DEP = cPROD_DEP.SelectedValue;

            if (!String.IsNullOrEmpty(_PROD_NAME) && _PROD_DEP != "0")
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), PRODUCT00Table.PROD_DEP, Comparison.Equals, _PROD_DEP, false, false));
                sFlag = false;
            }
            FineUI.DropDownList cPROD_CATE = Window3.FindControl("PanelGrid4").FindControl("cPROD_CATE") as FineUI.DropDownList;
            var _PROD_CATE = cPROD_CATE.SelectedValue;

            if (!String.IsNullOrEmpty(_PROD_CATE) && _PROD_CATE != "0")
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), PRODUCT00Table.PROD_CATE, Comparison.Equals, _PROD_CATE, false, false));
                sFlag = false;
            }

            if (sFlag)
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), "1", Comparison.Equals, "1", false, false));
            }

            return(conditionProdduct00List);
        }
 /// <summary>
 /// 子表添加商品
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void btn_DetailAdd(Object sender, EventArgs e)
 {
     //string Pur_status = ddlStatus.SelectedValue;
     FineUI.Panel P_search = Window3.FindControl("PanelGrid4").FindControl("Panel_Search") as FineUI.Panel;
     P_search.Hidden = false;
     FineUI.DropDownList ddlstock = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("window_ddl_Stock") as FineUI.DropDownList;
     STOCKBll.GetInstence().BandDropDownListStock(this, ddlstock);
     Window3.Hidden = false;
     FineUI.Grid Grid4 = Window3.FindControl("PanelGrid4").FindControl("Grid4") as FineUI.Grid;
     Grid4.DataSource = null;
     Grid4.DataBind();
 }
 /// <summary>
 /// WINDOW3 关闭事件
 /// </summary>
 public void Window3_Close()
 {
     FineUI.Panel P_search = Window3.FindControl("PanelGrid4").FindControl("Panel_Search") as FineUI.Panel;
     P_search.Hidden = true;
     FineUI.Button B_BtnSearchCon = Window3.FindControl("PanelGrid4").FindControl("tool_btn").FindControl("BtnSearchCon") as FineUI.Button;
     FineUI.Button B_BtnAddCon    = Window3.FindControl("PanelGrid4").FindControl("tool_btn").FindControl("BtnAddCon") as FineUI.Button;
     B_BtnSearchCon.Hidden = true;
     B_BtnAddCon.Hidden    = true;
     FineUI.Button B_BtnEditCon = Window3.FindControl("PanelGrid4").FindControl("tool_btn").FindControl("BtnEditCon") as FineUI.Button;
     B_BtnEditCon.Hidden = true;
     Window3.Hidden      = true;
 }
Exemplo n.º 13
0
        /// <summary>
        /// 新增按钮触发事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void btn_DetailAdd(Object sender, EventArgs e)
        {
            string Pur_status = ddlStatus.SelectedValue;

            FineUI.Panel P_search = Window3.FindControl("PanelGrid4").FindControl("Panel_Search") as FineUI.Panel;
            P_search.Hidden = false;
            FineUI.Button B_BtnSearchCon = Window3.FindControl("PanelGrid4").FindControl("tool_btn").FindControl("BtnSearchCon") as FineUI.Button;
            FineUI.Button B_BtnAddCon    = Window3.FindControl("PanelGrid4").FindControl("tool_btn").FindControl("BtnAddCon") as FineUI.Button;
            B_BtnSearchCon.Hidden = false;
            B_BtnAddCon.Hidden    = false;
            Window3.Hidden        = false;
        }
        /// <summary>
        /// 添加商品
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ButtonPRODAdd_Click(object sender, EventArgs e)
        {
            FineUI.Grid Grid4 = Window3.FindControl("PanelGrid4").FindControl("Grid4") as FineUI.Grid;

            int[]  selections    = Grid4.SelectedRowIndexArray;
            string _INV_ID       = tbxINV_ID.Text;
            string _Shop_ID      = ddlSHOP_NAME.SelectedValue;
            string _Shop_Name    = ddlSHOP_NAME.SelectedText;
            string result        = "";
            var    m_Shop        = new SHOP00(x => x.SHOP_ID == _Shop_ID);
            string _priceArea_id = m_Shop.SHOP_Price_Area;

            if (!String.IsNullOrEmpty(_INV_ID))
            {
                foreach (int i in selections)
                {
                    string _Prod_ID    = Grid4.DataKeys[i][0].ToString();
                    string _prod_name  = Grid4.DataKeys[i][1].ToString();
                    string checkresult = ProdAddCheck(_Prod_ID, _prod_name);
                    if (!String.IsNullOrEmpty(checkresult))
                    {
                        result = result + "\r\n" + checkresult;
                        continue;
                    }
                    string  _shop_id = ddlSHOP_NAME.SelectedValue;
                    var     model    = new V_Product01_PRCAREA(x => x.PROD_ID == _Prod_ID && x.PRCAREA_ID == _priceArea_id);
                    int     rowCount = Grid2.Rows.Count;
                    JObject deObject = new JObject();
                    deObject.Add("Id01", "0");
                    deObject.Add("SHOP_ID01", _Shop_ID);
                    deObject.Add("SHOP_NAME101", _Shop_Name);
                    deObject.Add("INV_ID01", _INV_ID);
                    deObject.Add("SNo01", rowCount + 1);
                    deObject.Add("PROD_ID01", _Prod_ID);
                    deObject.Add("PROD_NAME01", model.PROD_NAME1);
                    deObject.Add("QUANTITY01", model.SAFE_QUAN);
                    deObject.Add("QUAN01", 0);
                    deObject.Add("QUAN101", 0);
                    deObject.Add("QUAN201", 0);
                    deObject.Add("QUAN_B01", 0);
                    deObject.Add("MEMO01", 0);
                    Grid2.AddNewRecord(deObject, true);
                }
            }
            else
            {
                FineUI.Alert.ShowInParent("未选中订单无法添加", FineUI.MessageBoxIcon.Information);
            }
            if (!String.IsNullOrEmpty(result.Trim()))
            {
                FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Information);
            }
        }
        /// <summary>
        /// 加载下拉列表
        /// </summary>
        public void LoadList()
        {
            var model = GetOnlineUserShop();

            SHOP00Bll.GetInstence().BindOnlineUser(this, model.SHOP_ID, ddlSHOP_NAME);
            STOCKBll.GetInstence().BandOnlineUserStock(this, model.SHOP_ID, ddlSTOCK_ID);
            STOCKBll.GetInstence().BandOnlineUserStock(this, model.SHOP_ID, ddlSTOCK_NAME1);
            FineUI.DropDownList ccPROD_KIND = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_KIND") as FineUI.DropDownList;
            PROD_KINDBll.GetInstence().BandDropDownListShowKind(this, ccPROD_KIND);
            FineUI.DropDownList ccPROD_DEP = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_DEP") as FineUI.DropDownList;
            PROD_DEPBll.GetInstence().BandDropDownListShowDep(this, ccPROD_DEP);
            FineUI.DropDownList ccPROD_CATE = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_CATE") as FineUI.DropDownList;
            PROD_CateBll.GetInstence().BandDropDownListShowCate(this, ccPROD_CATE);
        }
        /// <summary>
        /// 新增按钮触发事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void btn_Pur02Add(Object sender, EventArgs e)
        {
            string Pur_status = ddlStatus.SelectedValue;

            FineUI.Panel P_search = Window3.FindControl("PanelGrid4").FindControl("Panel_Search") as FineUI.Panel;
            P_search.Hidden = false;
            FineUI.Button B_BtnSearchCon = Window3.FindControl("PanelGrid4").FindControl("tool_btn").FindControl("BtnSearchCon") as FineUI.Button;
            FineUI.Button B_BtnAddCon    = Window3.FindControl("PanelGrid4").FindControl("tool_btn").FindControl("BtnAddCon") as FineUI.Button;
            B_BtnSearchCon.Hidden = false;
            B_BtnAddCon.Hidden    = false;
            Window3.Hidden        = false;
            FineUI.Grid Grid4 = Window3.FindControl("PanelGrid4").FindControl("Grid4") as FineUI.Grid;
            Grid4.DataSource = null;
            Grid4.DataBind();
        }
        /// <summary>
        /// 商品查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ButtonPRODSearch_Click(object sender, EventArgs e)
        {
            string _shop_id  = ddlSHOP_NAME.SelectedValue;
            string _stock_id = ddlSTOCK_ID.SelectedValue;

            if (String.IsNullOrEmpty(_shop_id))
            {
                FineUI.Alert.ShowInParent("到货商店未选择", FineUI.MessageBoxIcon.Information);
                return;
            }

            if (String.IsNullOrEmpty(_stock_id))
            {
                FineUI.Alert.ShowInParent("仓库未选择", FineUI.MessageBoxIcon.Information);
                return;
            }

            conditionList = null;
            //conditionList = new List<ConditionFun.SqlqueryCondition>();
            //绑定Grid表格
            FineUI.Grid Grid4 = Window3.FindControl("PanelGrid4").FindControl("Grid4") as FineUI.Grid;
            V_STOCK01_PRODUCT01Bll.GetInstence().BindGrid(Grid4, 0, 0, InquiryConditionProduct(), sortList);
        }
        /// <summary>
        /// 添加商品
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ButtonPRODAdd_Click(object sender, EventArgs e)
        {
            FineUI.Grid Grid4 = Window3.FindControl("PanelGrid4").FindControl("Grid4") as FineUI.Grid;

            int[]  selections    = Grid4.SelectedRowIndexArray;
            string _OUT_ID       = tbxOUT_ID.Text;
            string _Shop_ID      = ddlIN_SHOP.SelectedValue;
            string _Shop_Name    = ddlIN_SHOP.SelectedText;
            string result        = "";
            var    m_Shop        = new SHOP00(x => x.SHOP_ID == _Shop_ID);
            string _priceArea_id = m_Shop.SHOP_Price_Area;
            int    rowCount      = Grid2.Rows.Count;

            if (!String.IsNullOrEmpty(_OUT_ID))
            {
                foreach (int i in selections)
                {
                    string _Prod_ID    = Grid4.DataKeys[i][0].ToString();
                    string _shop_id    = ddlSHOP_NAME.SelectedValue;
                    string _prod_name  = Grid4.DataKeys[i][1].ToString();
                    string checkresult = ProdAddCheck(_Prod_ID, _prod_name);
                    if (!String.IsNullOrEmpty(checkresult))
                    {
                        result = result + "\r\n" + checkresult;
                        continue;
                    }
                    var     model    = new V_Product01_PRCAREA(x => x.PROD_ID == _Prod_ID && x.PRCAREA_ID == _priceArea_id);
                    JObject deObject = new JObject();
                    deObject.Add("Id01", "0");
                    deObject.Add("SHOP_ID01", _Shop_ID);
                    deObject.Add("SHOP_NAME101", _Shop_Name);
                    deObject.Add("OUT_ID01", _OUT_ID);
                    deObject.Add("SNo01", rowCount + 1);
                    deObject.Add("PROD_ID01", _Prod_ID);
                    deObject.Add("PROD_NAME01", model.PROD_NAME1);
                    deObject.Add("QUANTITY01", model.ORDER_QUAN);
                    deObject.Add("STD_UNIT01", model.ORDER_UNIT);

                    string STD_PRICE01  = "";
                    string PROD_CONVERT = "";
                    //根据门店类型取进价
                    if (m_Shop.SHOP_KIND == 2)
                    {
                        switch (model.ORDER_UNIT)
                        {
                        case 1: STD_PRICE01 = model.T_COST.ToString();
                            PROD_CONVERT    = "1"; break;

                        case 2: STD_PRICE01 = model.T_COST1.ToString();
                            PROD_CONVERT    = model.PROD_CONVERT1.ToString(); break;

                        case 3: STD_PRICE01 = model.T_COST2.ToString();
                            PROD_CONVERT    = model.PROD_CONVERT2.ToString(); break;

                        default: STD_PRICE01 = model.T_COST.ToString();
                            PROD_CONVERT     = "1";; break;
                        }
                        deObject.Add("STD_PRICE101", model.T_COST);
                        deObject.Add("STD_PRICE201", model.T_COST1);
                        deObject.Add("STD_PRICE301", model.T_COST2);
                    }
                    else
                    {
                        switch (model.ORDER_UNIT)
                        {
                        case 1: STD_PRICE01 = model.U_Cost.ToString();
                            PROD_CONVERT    = "1"; break;

                        case 2: STD_PRICE01 = model.U_Cost1.ToString();
                            PROD_CONVERT    = model.PROD_CONVERT1.ToString(); break;

                        case 3: STD_PRICE01 = model.U_Cost2.ToString();
                            PROD_CONVERT    = model.PROD_CONVERT1.ToString(); break;

                        default: STD_PRICE01 = model.U_Cost.ToString();
                            PROD_CONVERT     = "1"; break;
                        }
                        deObject.Add("STD_PRICE101", model.U_Cost);
                        deObject.Add("STD_PRICE201", model.U_Cost1);
                        deObject.Add("STD_PRICE301", model.U_Cost2);
                    }
                    deObject.Add("STD_CONVERT01", PROD_CONVERT);
                    deObject.Add("STD_UNIT_NAME01", model.ORDER_NAME);
                    deObject.Add("STD_QUAN01", model.ORDER_UNIT);
                    deObject.Add("STD_PRICE01", STD_PRICE01);
                    deObject.Add("MIN_STD_QUAN01", model.ORDER_UNIT);
                    deObject.Add("COST01", model.COST);
                    deObject.Add("QUAN101", 0);
                    deObject.Add("QUAN201", 0);
                    deObject.Add("MEMO01", "");
                    deObject.Add("BAT_NO", "");

                    deObject.Add("UNIT_NAME01", model.UNIT_NAME);
                    deObject.Add("UNIT_NAME101", model.UNIT_NAME1);
                    deObject.Add("UNIT_NAME201", model.UNIT_NAME2);
                    deObject.Add("PROD_CONVERT101", model.PROD_CONVERT1);
                    deObject.Add("PROD_CONVERT201", model.PROD_CONVERT2);
                    deObject.Add("COST101", model.COST);
                    deObject.Add("COST201", model.COST1);
                    deObject.Add("COST301", model.COST2);
                    rowCount = rowCount + 1;
                    Grid2.AddNewRecord(deObject, true);
                }
            }
            else
            {
                FineUI.Alert.ShowInParent("未选中订单无法添加", FineUI.MessageBoxIcon.Information);
            }
            if (!String.IsNullOrEmpty(result.Trim()))
            {
                FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Information);
            }
        }
        /// <summary>
        /// 添加商品
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ButtonPRODAdd_Click(object sender, EventArgs e)
        {
            FineUI.Grid Grid4 = Window3.FindControl("PanelGrid4").FindControl("Grid4") as FineUI.Grid;

            int[]  selections = Grid4.SelectedRowIndexArray;
            string _BK_ID     = tbxBK_ID.Text;
            string _Shop_ID   = ddlSHOP_NAME.SelectedValue;
            //string _Shop_Name = ddlSHOP_NAME.SelectedText;
            string result = "";

            if (!String.IsNullOrEmpty(_BK_ID))
            {
                int rowCount = Grid2.Rows.Count;
                foreach (int i in selections)
                {
                    string  _Prod_ID = Grid4.DataKeys[i][0].ToString();
                    string  _shop_id = ddlSHOP_NAME.SelectedValue;
                    var     model    = new V_STOCK01_PRODUCT01(x => x.PROD_ID == _Prod_ID && x.SHOP_ID == _Shop_ID);
                    JObject deObject = new JObject();
                    deObject.Add("Id01", "0");
                    deObject.Add("SHOP_ID01", _Shop_ID);
                    deObject.Add("SHOP_NAME101", model.SHOP_NAME1);
                    deObject.Add("BK_ID01", _BK_ID);
                    deObject.Add("SNo01", rowCount + 1);
                    deObject.Add("PROD_ID01", _Prod_ID);
                    deObject.Add("PROD_NAME101", model.PROD_NAME1);
                    deObject.Add("QUANTITY01", model.ORDER_QUAN);
                    deObject.Add("STD_UNIT01", model.ORDER_UNIT);
                    deObject.Add("STD_CONVERT01", model.PROD_CONVERT1);
                    deObject.Add("STD_QUAN01", model.ORDER_QUAN);
                    switch (model.ORDER_UNIT)
                    {
                    case 1: deObject.Add("STD_PRICE01", model.S_Cost);
                        deObject.Add("COST01", model.COST);
                        break;

                    case 2: deObject.Add("STD_PRICE01", model.S_Cost1);
                        deObject.Add("COST01", model.COST1);
                        break;

                    case 3: deObject.Add("STD_PRICE01", model.S_Cost2);
                        deObject.Add("COST01", model.COST2);
                        break;

                    default: deObject.Add("STD_PRICE01", 0);
                        deObject.Add("COST01", 0);
                        break;
                    }
                    deObject.Add("QUAN101", 0);
                    deObject.Add("QUAN201", 0);
                    deObject.Add("REASON_ID01", 0);
                    deObject.Add("MEMO01", "");
                    deObject.Add("BAT_NO", "");


                    deObject.Add("STD_UNIT_NAME01", model.ORDER_NAME);
                    deObject.Add("UNIT_NAME01", model.UNIT_NAME);
                    deObject.Add("UNIT_NAME101", model.UNIT_NAME1);
                    deObject.Add("UNIT_NAME201", model.UNIT_NAME2);

                    deObject.Add("PROD_CONVERT101", model.PROD_CONVERT1);
                    deObject.Add("PROD_CONVERT201", model.PROD_CONVERT2);


                    deObject.Add("S_RET_COST01", model.S_Ret_Cost);
                    deObject.Add("S_RET_COST101", model.S_Ret_Cost1);
                    deObject.Add("S_RET_COST201", model.S_Ret_Cost2);

                    deObject.Add("R_COST01", model.COST);
                    deObject.Add("R_COST101", model.COST1);
                    deObject.Add("R_COST201", model.COST2);
                    rowCount++;
                    Grid2.AddNewRecord(deObject, true);
                }
            }
            else
            {
                FineUI.Alert.ShowInParent("未选中订单无法添加", FineUI.MessageBoxIcon.Information);
            }
            if (!String.IsNullOrEmpty(result.Trim()))
            {
                FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Information);
            }
        }
        /// <summary>
        /// GRID3检索的判断条件
        /// </summary>
        /// <returns></returns>
        private List <ConditionFun.SqlqueryCondition> InquiryConditionProduct()
        {
            string _shop_id = ddlSHOP_NAME.SelectedValue;
            var    model    = new SHOP00(x => x.SHOP_ID == _shop_id);
            List <ConditionFun.SqlqueryCondition> conditionProdduct00List = new List <ConditionFun.SqlqueryCondition>();
            bool   sFlag   = true;
            string _SUP_ID = ddlSUP_NAME.SelectedValue;

            conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.Or, V_Product01_PRCAREATable.PROD_TYPE, Comparison.In, new string[2] {
                "1", "2"
            }, true, true));
            if (!String.IsNullOrEmpty(_SUP_ID))
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), V_Product01_PRCAREATable.SUP_ID, Comparison.Like, _SUP_ID, true, false));
                sFlag = false;
            }

            if (!String.IsNullOrEmpty(model.SHOP_Price_Area))
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), V_Product01_PRCAREATable.PRCAREA_ID, Comparison.Equals, model.SHOP_Price_Area, true, true));
                sFlag = false;
            }
            //conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(ConstraintType.Where, "1", Comparison.Equals, "1", false, false));

            FineUI.TextBox cPROD_ID = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_ID") as FineUI.TextBox;
            var            _PROD_ID = cPROD_ID.Text;

            if (!String.IsNullOrEmpty(cPROD_ID.Text))
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), V_Product01_PRCAREATable.PROD_ID, Comparison.Like, "%" + _PROD_ID + "%", true, true));
                sFlag = false;
            }

            FineUI.TextBox cPROD_NAME = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_NAME") as FineUI.TextBox;
            var            _PROD_NAME = cPROD_NAME.Text;

            if (!String.IsNullOrEmpty(_PROD_NAME))
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), V_Product01_PRCAREATable.PROD_NAME1, Comparison.Like, "%" + _PROD_NAME + "%", true, true));
                sFlag = false;
            }
            FineUI.TextBox cPROD_NAME_SPELLING = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_NAME_SPELLING") as FineUI.TextBox;
            var            _PROD_NAME_SPELLING = cPROD_NAME_SPELLING.Text;

            if (!String.IsNullOrEmpty(_PROD_NAME_SPELLING))
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), V_Product01_PRCAREATable.PROD_NAME1_SPELLING, Comparison.Like, "%" + _PROD_NAME_SPELLING + "%", true, true));
                sFlag = false;
            }
            FineUI.DropDownList cPROD_KIND = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_KIND") as FineUI.DropDownList;
            var _cPROD_KIND = cPROD_KIND.SelectedValue;

            if (!String.IsNullOrEmpty(_cPROD_KIND) && _cPROD_KIND != "0")
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), V_Product01_PRCAREATable.PROD_KIND, Comparison.Equals, _cPROD_KIND, true, true));
                sFlag = false;
            }

            FineUI.DropDownList cPROD_DEP = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_DEP") as FineUI.DropDownList;
            var _PROD_DEP = cPROD_DEP.SelectedValue;

            if (!String.IsNullOrEmpty(_PROD_NAME) && _PROD_DEP != "0")
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), V_Product01_PRCAREATable.PROD_DEP, Comparison.Equals, _PROD_DEP, true, true));
                sFlag = false;
            }
            FineUI.DropDownList cPROD_CATE = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_CATE") as FineUI.DropDownList;
            var _PROD_CATE = cPROD_CATE.SelectedValue;

            if (!String.IsNullOrEmpty(_PROD_CATE) && _PROD_CATE != "0")
            {
                conditionProdduct00List.Add(new ConditionFun.SqlqueryCondition(WhereOrAnd(sFlag), V_Product01_PRCAREATable.PROD_CATE, Comparison.Equals, _PROD_CATE, true, true));
                sFlag = false;
            }
            return(conditionProdduct00List);
        }
 public void btnEditCon_Click(Object sender, EventArgs e)
 {
     try
     {
         //int Grid3RowIndex = ConvertHelper.Cint(Grid3Rowindex.Text);
         string _CONTRACT_ID = tbxCONTRACT_ID.Text.ToString();
         if (String.IsNullOrEmpty(_CONTRACT_ID))
         {
             FineUI.Alert.ShowInParent("未选择商品", FineUI.MessageBoxIcon.Information);
             return;
         }
         FineUI.Grid Grid4      = Window3.FindControl("PanelGrid4").FindControl("Grid4") as FineUI.Grid;
         int[]       selections = Grid4.SelectedRowIndexArray;
         if (selections.Length == 0)
         {
             FineUI.Alert.ShowInParent("请选择一行", FineUI.MessageBoxIcon.Information);
             return;
         }
         foreach (int i in selections)
         {
             int _Id = ConvertHelper.Cint(Grid4.DataKeys[i][0].ToString());
             if (_Id > 0)
             {
                 JObject defaultObj = new JObject();
                 var     model      = new PRODUCT00(x => x.Id == _Id);
                 //暂时保留后期可能优化
                 string  _UserHashKey = Session[OnlineUsersTable.UserHashKey].ToString();
                 var     OlUser       = OnlineUsersBll.GetInstence().GetModelForCache(x => x.UserHashKey == Session[OnlineUsersTable.UserHashKey].ToString());
                 DataSet dsCom        = (DataSet)SPs.Get_CONTRACT01_PRODUCT01(_UserHashKey, model.PROD_ID).ExecuteDataSet();
                 if (dsCom.Tables.Count > 0)
                 {
                     if (dsCom.Tables[0].Rows.Count > 0)
                     {
                         defaultObj.Add("Id01", 0);
                         defaultObj.Add("CONTRACT_ID01", _CONTRACT_ID);
                         defaultObj.Add("PROD_ID01", model.PROD_ID);
                         defaultObj.Add("PROD_NAME01", model.PROD_NAME1);
                         defaultObj.Add("CONTRACT_PRICE01", dsCom.Tables[0].Rows[0]["COST"].ToString());
                         defaultObj.Add("CONTRACT_PRICE101", dsCom.Tables[0].Rows[0]["COST1"].ToString());
                         defaultObj.Add("CONTRACT_PRICE201", dsCom.Tables[0].Rows[0]["COST2"].ToString());
                         defaultObj.Add("USABLE01", true);
                         defaultObj.Add("Meno01", "");
                         defaultObj.Add("CRT_USER_ID01", OlUser.Manager_LoginName);
                         defaultObj.Add("CRT_DATETIME01", DateTime.Now.ToString());
                         defaultObj.Add("MOD_USER_ID01", OlUser.Manager_LoginName);
                         defaultObj.Add("MOD_DATETIME01", DateTime.Now.ToString());
                         Grid2.AddNewRecord(defaultObj, true);
                     }
                     else
                     {
                         FineUI.Alert.ShowInParent("添加失败", FineUI.MessageBoxIcon.Information);
                     }
                 }
                 else
                 {
                     FineUI.Alert.ShowInParent("添加失败", FineUI.MessageBoxIcon.Information);
                 }
             }
         }
     }
     catch (Exception err)
     {
         FineUI.Alert.ShowInParent("添加失败:" + err.Message, FineUI.MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// 查询按钮触发事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void BtnSearchCon(Object sender, EventArgs e)
 {
     FineUI.Button B_BtnEditCon = Window3.FindControl("PanelGrid4").FindControl("tool_btn").FindControl("BtnEditCon") as FineUI.Button;
     B_BtnEditCon.Hidden = false;
     Window3.Hidden      = false;
 }
Exemplo n.º 23
0
        /// <summary>
        /// 添加商品
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ButtonPRODAdd_Click(object sender, EventArgs e)
        {
            FineUI.Grid Grid4 = Window3.FindControl("PanelGrid4").FindControl("Grid4") as FineUI.Grid;

            int[] selections = Grid4.SelectedRowIndexArray;
            //这里要改
            string _TAKENIN_ID = tbxTAKEIN_ID.Text;
            string result      = "";

            if (!String.IsNullOrEmpty(_TAKENIN_ID))
            {
                int rowCount = Grid2.Rows.Count;
                foreach (int i in selections)
                {
                    string _Prod_ID    = Grid4.DataKeys[i][0].ToString();
                    string _prod_name  = Grid4.DataKeys[i][1].ToString();
                    string _PRCAREA_ID = Grid4.DataKeys[i][2].ToString();
                    string checkresult = ProdAddCheck(_Prod_ID, _prod_name);
                    if (!String.IsNullOrEmpty(checkresult))
                    {
                        result = result + "\r\n" + checkresult;
                        continue;
                    }

                    var     model    = new V_Product01_PRCAREA(x => x.PROD_ID == _Prod_ID && x.PRCAREA_ID == _PRCAREA_ID);
                    JObject deObject = new JObject();
                    deObject.Add("Id01", "0");
                    deObject.Add("SHOP_ID01", ddlSHOP_NAME.SelectedValue);
                    deObject.Add("SHOP_NAME101", ddlSHOP_NAME.SelectedText);
                    deObject.Add("TAKEIN_ID01", _TAKENIN_ID);
                    deObject.Add("SNo01", rowCount + 1);
                    deObject.Add("PROD_ID01", _Prod_ID);
                    deObject.Add("PROD_NAME101", model.PROD_NAME1);
                    deObject.Add("QUANTITY01", model.Purchase_QUAN);
                    deObject.Add("STD_UNIT01", model.Purchase_UNIT);
                    deObject.Add("STD_QUAN01", model.Purchase_QUAN);
                    switch (model.Purchase_UNIT)
                    {
                    case 1:
                        deObject.Add("STD_PRICE01", model.SUP_COST);
                        deObject.Add("STD_CONVERT01", 1);
                        break;

                    case 2:
                        deObject.Add("STD_PRICE01", model.SUP_COST1);
                        deObject.Add("STD_CONVERT01", model.PROD_CONVERT1);
                        break;

                    case 3:
                        deObject.Add("STD_PRICE01", model.SUP_COST2);
                        deObject.Add("STD_CONVERT01", model.PROD_CONVERT2);
                        break;

                    default:
                        deObject.Add("STD_PRICE01", 0);
                        deObject.Add("STD_CONVERT01", 1);
                        break;
                    }
                    if (model.TAX_TYPE == '0')
                    {
                        deObject.Add("Tax01", 0);
                    }
                    else
                    {
                        deObject.Add("Tax01", model.Tax * model.TAX_TYPE * 0.01);
                    }


                    deObject.Add("QUAN101", 0);
                    deObject.Add("QUAN201", 0);
                    deObject.Add("MEMO01", "");
                    deObject.Add("BAT_NO", "");

                    deObject.Add("STD_UNIT_NAME01", model.Purchase_UNIT_NAME);
                    deObject.Add("UNIT_NAME01", model.UNIT_NAME);
                    deObject.Add("UNIT_NAME101", model.UNIT_NAME1);
                    deObject.Add("UNIT_NAME201", model.UNIT_NAME2);

                    deObject.Add("PROD_CONVERT101", model.PROD_CONVERT1);
                    deObject.Add("PROD_CONVERT201", model.PROD_CONVERT2);

                    deObject.Add("SUP_COST01", model.SUP_COST);
                    deObject.Add("SUP_COST101", model.SUP_COST1);
                    deObject.Add("SUP_COST201", model.SUP_COST2);
                    deObject.Add("Tax_Num01", model.Tax);
                    deObject.Add("Tax_Type01", model.TAX_TYPE);
                    rowCount++;
                    Grid2.AddNewRecord(deObject, true);
                }
            }
            else
            {
                FineUI.Alert.ShowInParent("未选中订单无法添加", FineUI.MessageBoxIcon.Information);
            }
            if (!String.IsNullOrEmpty(result.Trim()))
            {
                FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Information);
            }
        }
        /// <summary>
        /// 添加商品
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ButtonPRODAdd_Click(object sender, EventArgs e)
        {
            FineUI.Grid Grid4 = Window3.FindControl("PanelGrid4").FindControl("Grid4") as FineUI.Grid;

            int[]  selections    = Grid4.SelectedRowIndexArray;
            string _Pur00_ID     = hidPurchase_ID.Text;
            string _Shop_ID      = ddlSHOP_NAME.SelectedValue;
            string _Shop_Name    = ddlSHOP_NAME.SelectedText;
            string result        = "";
            var    m_Shop        = new SHOP00(x => x.SHOP_ID == _Shop_ID);
            string _priceArea_id = m_Shop.SHOP_Price_Area;
            int    rowCount      = Grid2.Rows.Count;

            if (!String.IsNullOrEmpty(_Pur00_ID))
            {
                foreach (int i in selections)
                {
                    string _Prod_ID    = Grid4.DataKeys[i][0].ToString();
                    string _prod_name  = Grid4.DataKeys[i][1].ToString();
                    string checkresult = ProdAddCheck(_Prod_ID, _prod_name);
                    if (!String.IsNullOrEmpty(checkresult))
                    {
                        result = result + "\r\n" + checkresult;
                        continue;
                    }
                    string  _shop_id = ddlSHOP_NAME.SelectedValue;
                    var     model    = new V_Product01_PRCAREA(x => x.PROD_ID == _Prod_ID && x.PRCAREA_ID == _priceArea_id);
                    JObject deObject = new JObject();
                    deObject.Add("Id01", "0");
                    deObject.Add("SHOP_ID01", _Shop_ID);
                    deObject.Add("SHOP_NAME01", _Shop_Name);
                    deObject.Add("Purchase_ID01", _Pur00_ID);
                    rowCount = rowCount + 1;
                    deObject.Add("SNo01", rowCount);
                    deObject.Add("PROD_ID01", _Prod_ID);
                    deObject.Add("PROD_NAME01", model.PROD_NAME1);
                    deObject.Add("PROD_NAME02", model.PROD_NAME1);
                    deObject.Add("QUANTITY01", model.ORDER_QUAN);
                    deObject.Add("STD_UNIT01", model.Purchase_UNIT);
                    deObject.Add("STD_UNIT_NAME01", model.Purchase_UNIT_NAME);
                    deObject.Add("STD_CONVERT01", model.Purchase_CONVERT);

                    deObject.Add("STD_QUAN01", model.Purchase_QUAN);
                    deObject.Add("STD_PRICE01", model.Purchase_PRICE);
                    if (model.TAX_TYPE == '0')
                    {
                        deObject.Add("Tax01", 0);
                    }
                    else
                    {
                        deObject.Add("Tax01", ConvertHelper.Cdbl((model.Purchase_PRICE.ToString())) * ConvertHelper.Cdbl((model.Purchase_QUAN.ToString())) * ConvertHelper.Cdbl((model.Tax.ToString())) * 0.01);
                    }
                    deObject.Add("QUAN101", 0);
                    deObject.Add("QUAN201", 0);
                    deObject.Add("Item_DISC_Amt01", 0);
                    deObject.Add("MEMO", "");

                    deObject.Add("UNIT_NAME01", model.UNIT_NAME);
                    deObject.Add("UNIT_NAME101", model.UNIT_NAME1);
                    deObject.Add("UNIT_NAME201", model.UNIT_NAME2);
                    deObject.Add("PROD_CONVERT101", model.PROD_CONVERT1);
                    deObject.Add("PROD_CONVERT201", model.PROD_CONVERT2);
                    deObject.Add("SUP_COST01", model.SUP_COST);
                    deObject.Add("SUP_COST101", model.SUP_COST1);
                    deObject.Add("SUP_COST201", model.SUP_COST2);
                    deObject.Add("Tax_Num01", model.Tax);
                    deObject.Add("Tax_Type01", model.TAX_TYPE);
                    Grid2.AddNewRecord(deObject, true);
                }
            }
            else
            {
                FineUI.Alert.ShowInParent("未选中订单无法添加", FineUI.MessageBoxIcon.Information);
            }
            if (!String.IsNullOrEmpty(result.Trim()))
            {
                FineUI.Alert.ShowInParent(result, FineUI.MessageBoxIcon.Information);
            }
        }