Пример #1
0
 private void BtnMsDelete_Click(object sender, EventArgs e)
 {
     if (DgvMembership.SelectedRows.Count == 1)
     {
         int index = DgvMembership.SelectedRows[0].Index;
         Ms = mses[index];
         if (EValid.效 == Ms.IsValid)
         {
             StringBuilder sb = new StringBuilder();
             sb.Append("确定删除当前会员?\n");
             sb.Append("会员编号" + Ms.MsID.ToString() + "\n");
             sb.Append("会员姓名" + Ms.MsName + "\n");
             sb.Append("联系方式" + Ms.MsPhone + "\n");
             sb.Append("会员积分" + Ms.MsPoint);
             if (DialogResult.OK == MsgBoxUtil.QuestionMsgBox(sb.ToString()))
             {
                 MembershipDao.DeleteByMsID(Ms.MsID);
                 mses[index].IsValid = EValid.已删除;
                 DgvMembership.Rows[index].Cells["ClnMsIsValid"].Value = EValid.已删除;
                 Ms = null;
             }
         }
     }
     else
     {
         MsgBoxUtil.ErrMsgBox("请选择要删除的会员!");
     }
 }
Пример #2
0
 private void BtnStaffDelete_Click(object sender, EventArgs e)
 {
     if (DgvStaffData.SelectedRows.Count == 1)
     {
         int index = DgvStaffData.SelectedRows[0].Index;
         Staff = staffs[index];
         StringBuilder sb = new StringBuilder();
         sb.Append("确定删除当前员工?\n");
         sb.Append("员工编号:" + Staff.StaffID.ToString() + "\n");
         sb.Append("员工姓名:" + Staff.StaffName + "\n");
         sb.Append("联系方式:" + Staff.StaffPhone + "\n");
         sb.Append("员工职称:" + Staff.Role);
         if (DialogResult.OK == MsgBoxUtil.QuestionMsgBox(sb.ToString()))
         {
             StaffDao.DeleteByStaffID(Staff.StaffID);
             staffs.RemoveAt(index);
             DgvStaffData.Rows.RemoveAt(index);
             Staff = null;
         }
     }
     else
     {
         MsgBoxUtil.ErrMsgBox("请选择要删除的员工!");
     }
 }
Пример #3
0
 private void BtnBack_Click(object sender, EventArgs e)
 {
     if (-1 == CmbCategoryID.SelectedIndex && "" == TxtCost.Text && "" == TxtPrice.Text && "" == TxtCount.Text)
     {
         Close();
     }
     else if (DialogResult.OK == MsgBoxUtil.QuestionMsgBox("当前窗体有未提交的数据,是否确定要退出?"))
     {
         Close();
     }
 }
Пример #4
0
 private void BtnMsCancel_Click(object sender, EventArgs e)
 {
     if ("" == TxtMsName.Text && "" == TxtMsPhone.Text && "" == TxtMsPoint.Text)
     {
         Close();
     }
     else if (DialogResult.OK == MsgBoxUtil.QuestionMsgBox("当前窗口有修改未保存,是否要退出?"))
     {
         Close();
     }
 }
 private void BtnCancel_Click(object sender, EventArgs e)
 {
     if (0 == DgvGoodIncome.Rows.Count)
     {
         Close();
     }
     else if (DialogResult.OK == MsgBoxUtil.QuestionMsgBox("当前窗体有未提交的数据,是否确定退出?"))
     {
         Close();
     }
 }
Пример #6
0
 private void BtnBack_Click(object sender, EventArgs e)
 {
     if (-1 == CmbGoodID.SelectedIndex && "" == TxtPrice.Text)
     {
         Close();
     }
     else if (DialogResult.OK == MsgBoxUtil.QuestionMsgBox("当前窗体还有未保存的数据,是否要退出?"))
     {
         Close();
     }
 }
Пример #7
0
 private void BtnBack_Click(object sender, EventArgs e)
 {
     if ("" == TxtStaffName.Text && "" == TxtStaffPhone.Text)
     {
         Close();
     }
     else
     if (DialogResult.OK == MsgBoxUtil.QuestionMsgBox("当前窗体有未提交的数据,是否确定退出?"))
     {
         Close();
     }
 }
Пример #8
0
 private void BtnBack_Click(object sender, EventArgs e)
 {
     if ("" == TxtCategoryName.Text && -1 == CmbParentCategoryName.SelectedIndex && "" == TxtFirm.Text &&
         "" == TxtUnit.Text && "" == TxtColor.Text && "" == TxtExpirationDate.Text &&
         "" == TxtMinStock.Text && "" == TxtMaxStock.Text)
     {
         Close();
     }
     else if (DialogResult.OK == MsgBoxUtil.QuestionMsgBox("当前窗体有未提交的数据,是否确定退出?"))
     {
         Close();
     }
 }
Пример #9
0
        private void BtnInsert_Click(object sender, EventArgs e)
        {
            ClsGood good = GetGoodFromInput();

            if (good != null)
            {
                if (DialogResult.OK == MsgBoxUtil.QuestionMsgBox("确认提交?"))
                {
                    FrmGoodIncome.Goods.Add(good);
                    Close();
                }
            }
        }
Пример #10
0
        private void BtnSubmit_Click(object sender, EventArgs e)
        {
            DialogResult result = MsgBoxUtil.QuestionMsgBox("确定提交修改?");

            if (hasUpdated && result == DialogResult.OK)
            {
                foreach (EtCategory category in categories)
                {
                    CategoryDao.UpdateOrInsert(category);
                }
                hasUpdated = false;
            }
        }
 private void BtnCancel_Click(object sender, EventArgs e)
 {
     if (hasUpdated)
     {
         if (DialogResult.OK == MsgBoxUtil.QuestionMsgBox("当前窗体有未提交的数据,是否确定退出?"))
         {
             Close();
         }
     }
     else
     {
         Close();
     }
 }
Пример #12
0
 private void BtnBack_Click(object sender, EventArgs e)
 {
     if (hasUpdated)
     {
         if (DialogResult.OK == MsgBoxUtil.QuestionMsgBox("当前窗口有修改未保存,是否要退出?"))
         {
             Close();
         }
     }
     else
     {
         Close();
     }
 }
 private void BtnComfirm_Click(object sender, EventArgs e)
 {
     if (0 == Goods.Count)
     {
         MsgBoxUtil.ErrMsgBox("没有待插入的表单!");
     }
     else if (DialogResult.OK == MsgBoxUtil.QuestionMsgBox("确认提交?"))
     {
         if (Save())
         {
             Close();
         }
     }
 }
 private void BtnSubmit_Click(object sender, EventArgs e)
 {
     if (DialogResult.OK == MsgBoxUtil.QuestionMsgBox("确定提交?"))
     {
         if (!hasErr)
         {
             FrmGoodIncome.Goods.AddRange(excelGoods);
             Close();
         }
         else
         {
             MsgBoxUtil.ErrMsgBox("导入失败!");
         }
     }
 }
Пример #15
0
 private void BtnSaleSubmit_Click(object sender, EventArgs e)
 {
     if (hasUpdated)
     {
         if (DialogResult.OK == MsgBoxUtil.QuestionMsgBox("确认提交?"))
         {
             if (Save())
             {
                 Close();
                 hasUpdated = false;
             }
         }
     }
     else
     {
         MsgBoxUtil.ErrMsgBox("没有待插入的表单!");
     }
 }
Пример #16
0
 private void BtnStaffSubmit_Click(object sender, EventArgs e)
 {
     if (hasUpdated)
     {
         if (DialogResult.OK == MsgBoxUtil.QuestionMsgBox("确认提交?"))
         {
             foreach (EtStaff staff in staffs)
             {
                 StaffDao.InsertStaff(staff);
             }
             hasUpdated = false;
         }
     }
     else
     {
         MsgBoxUtil.ErrMsgBox("没有待添加的员工!");
     }
 }
Пример #17
0
 private void BtnDelete_Click(object sender, EventArgs e)
 {
     if (DgvCategory.SelectedRows.Count == 1)
     {
         int index = DgvCategory.SelectedRows[0].Index;
         category = categories[index];
         if (EValid.效 == category.IsValid)
         {
             if (DialogResult.OK == MsgBoxUtil.QuestionMsgBox("是否删除当前商品?"))
             {
                 CategoryDao.DeleteByCategoryID(category.CategoryID);
                 categories[index].IsValid = EValid.已删除;
                 DgvCategory.Rows[index].Cells["Column11"].Value = EValid.已删除;
                 category = null;
             }
         }
     }
     else
     {
         MsgBoxUtil.ErrMsgBox("请选择要删除的商品!");
     }
 }