示例#1
0
        /// <summary>
        /// 调价单编辑或者复制
        /// </summary>
        /// <param name="HandlerType">处理方法</param>
        /// <param name="state">操作状态</param>
        private void EditOrCopyMethod(string HandlerType, WindowStatus state)
        {
            try
            {
                string        ModPricBillID     = string.Empty;
                List <string> ModPricBillIDList = GetSelectedRecord();//获取要编辑的调价单记录行

                if (ModPricBillIDList.Count == 0 && gvModifyPriceBillList.SelectedRows.Count == 0)
                {
                    MessageBoxEx.Show("请选择要" + HandlerType + "的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                else if (ModPricBillIDList.Count > 1 && gvModifyPriceBillList.SelectedRows.Count > 1)
                {
                    MessageBoxEx.Show("一次只能" + HandlerType + "一条数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                else
                {
                    if (ModPricBillIDList.Count == 1)
                    {
                        ModPricBillID = ModPricBillIDList[0].ToString();
                    }
                    else if (gvModifyPriceBillList.SelectedRows.Count == 1)
                    {
                        ModPricBillID = gvModifyPriceBillList.CurrentRow.Cells["ModPricId"].ToString();
                    }
                    UCModifyPriceAddOrEdit UCModPricBillHandle = new UCModifyPriceAddOrEdit(state, ModPricBillID, this);
                    base.addUserControl(UCModPricBillHandle, "调价单-" + HandlerType, "UCModPricBillHandle", this.Tag.ToString(), this.Name);
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }
        /// <summary>
        /// 调价单编辑或者复制
        /// </summary>
        /// <param name="HandlerType">处理方法</param>
        /// <param name="state">操作状态</param>
        private void EditOrCopyMethod(string HandlerType, WindowStatus state)
        {
            try
            {
                string ModPricBillID = string.Empty;
                List<string> ModPricBillIDList = GetSelectedRecord();//获取要编辑的调价单记录行

                if (ModPricBillIDList.Count == 0 && gvModifyPriceBillList.SelectedRows.Count == 0)
                {
                    MessageBoxEx.Show("请选择要" + HandlerType + "的数据!" ,"提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
                    return;
                }
                else if (ModPricBillIDList.Count > 1 && gvModifyPriceBillList.SelectedRows.Count > 1)
                {
                    MessageBoxEx.Show("一次只能" + HandlerType + "一条数据!","提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
                    return;
                }
                else
                {
                    if (ModPricBillIDList.Count == 1)
                    {
                        ModPricBillID = ModPricBillIDList[0].ToString();
                    }
                    else if (gvModifyPriceBillList.SelectedRows.Count==1)
                    {
                        ModPricBillID = gvModifyPriceBillList.CurrentRow.Cells["ModPricId"].ToString();
                    }
                    UCModifyPriceAddOrEdit UCModPricBillHandle = new UCModifyPriceAddOrEdit(state, ModPricBillID, this);
                    base.addUserControl(UCModPricBillHandle, "调价单-" + HandlerType, "UCModPricBillHandle", this.Tag.ToString(), this.Name);
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }
 /// <summary>
 /// 添加调价单
 /// </summary>
 /// <param name="send"></param>
 /// <param name="e"></param>
 private void UCModifyPriceManager_AddEvent(object send, EventArgs e)
 {
     UCModifyPriceAddOrEdit UCModPriceBillAdd = new UCModifyPriceAddOrEdit(WindowStatus.Add, null, this);
     base.addUserControl(UCModPriceBillAdd, "调价单-添加", "UCModPriceBillAdd", this.Tag.ToString(), this.Name);
 }
示例#4
0
        /// <summary>
        /// 添加调价单
        /// </summary>
        /// <param name="send"></param>
        /// <param name="e"></param>
        private void UCModifyPriceManager_AddEvent(object send, EventArgs e)
        {
            UCModifyPriceAddOrEdit UCModPriceBillAdd = new UCModifyPriceAddOrEdit(WindowStatus.Add, null, this);

            base.addUserControl(UCModPriceBillAdd, "调价单-添加", "UCModPriceBillAdd", this.Tag.ToString(), this.Name);
        }