Example #1
0
        /// <summary>
        /// 编辑或者复制报损单
        /// </summary>
        /// <param name="HandleType"></param>
        /// <param name="state"></param>
        private void EditOrCopyMethod(string HandleType, WindowStatus state)
        {
            try
            {
                string        LossBillID     = string.Empty;
                List <string> LossBillIDList = GetSelectedRecord();//获取要编辑或复制的报损单记录行

                if (LossBillIDList.Count == 0 && gvLossBillList.SelectedRows.Count == 0)
                {
                    MessageBoxEx.Show("请选择要" + HandleType + "的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                else if (LossBillIDList.Count > 1 && gvLossBillList.SelectedRows.Count > 1)
                {
                    MessageBoxEx.Show("一次只能" + HandleType + "一条数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                else
                {
                    if (LossBillIDList.Count == 1)
                    {
                        LossBillID = LossBillIDList[0].ToString();
                    }
                    else if (gvLossBillList.SelectedRows.Count == 1)
                    {
                        LossBillID = gvLossBillList.CurrentRow.Cells["RepLossId"].ToString();
                    }
                    UCReportedLossBillAddOrEdit UCLossBillHandle = new UCReportedLossBillAddOrEdit(state, LossBillID, this);
                    base.addUserControl(UCLossBillHandle, "报损单-" + HandleType, "UCLossBillHandle" + LossBillID, this.Tag.ToString(), this.Name);
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }
        /// <summary>
        /// 编辑或者复制报损单
        /// </summary>
        /// <param name="HandleType"></param>
        /// <param name="state"></param>
        private void EditOrCopyMethod(string HandleType, WindowStatus state)
        {
            try
            {
                string LossBillID = string.Empty;
                List<string> LossBillIDList = GetSelectedRecord();//获取要编辑或复制的报损单记录行

                if (LossBillIDList.Count == 0 && gvLossBillList.SelectedRows.Count == 0)
                {
                    MessageBoxEx.Show("请选择要" + HandleType + "的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                else if (LossBillIDList.Count > 1 && gvLossBillList.SelectedRows.Count > 1)
                {
                    MessageBoxEx.Show("一次只能" + HandleType + "一条数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                else 
                {
                    if (LossBillIDList.Count == 1)
                    {
                        LossBillID = LossBillIDList[0].ToString();
                    }
                    else if (gvLossBillList.SelectedRows.Count == 1)
                    {
                        LossBillID = gvLossBillList.CurrentRow.Cells["RepLossId"].ToString();
                    }
                    UCReportedLossBillAddOrEdit UCLossBillHandle = new UCReportedLossBillAddOrEdit(state, LossBillID, this);
                    base.addUserControl(UCLossBillHandle, "报损单-" + HandleType, "UCLossBillHandle" + LossBillID, this.Tag.ToString(), this.Name);
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message, "异常提示", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
        }
Example #3
0
        /// <summary>
        /// 添加报损单
        /// </summary>
        /// <param name="send"></param>
        /// <param name="e"></param>
        private void UCReportedLossBillManager_AddEvent(object send, EventArgs e)
        {
            UCReportedLossBillAddOrEdit UCLossBillAdd = new UCReportedLossBillAddOrEdit(WindowStatus.Add, null, this);

            base.addUserControl(UCLossBillAdd, "报损单-添加", "UCLossBillAdd", this.Tag.ToString(), this.Name);
        }
 /// <summary>
 /// 添加报损单
 /// </summary>
 /// <param name="send"></param>
 /// <param name="e"></param>
 private void UCReportedLossBillManager_AddEvent(object send, EventArgs e)
 {
     UCReportedLossBillAddOrEdit UCLossBillAdd = new UCReportedLossBillAddOrEdit(WindowStatus.Add, null, this);
     base.addUserControl(UCLossBillAdd, "报损单-添加", "UCLossBillAdd", this.Tag.ToString(), this.Name);
 }