コード例 #1
0
        private bool ValidateBeforeSave()
        {
            if (txtSubject.Text.Length == 0)
            {
                UI.ShowErrorMessage(this, "Please enter a subject.");
                txtSubject.Focus();
                return(false);
            }
            else if (dateEdit1.EditValue == null)
            {
                UI.ShowErrorMessage(this, "Please enter a date.");
                dateEdit1.Focus();
                return(false);
            }
            else if (lkpEdtBranchCode.EditValue.ToString().Length == 0)
            {
                UI.ShowErrorMessage(this, "Please select a Branch Code.");
                lkpEdtBranchCode.Focus();
                return(false);
            }
            else if (Convert.ToInt32(lkpEdtDeptID.EditValue) == -1)
            {
                UI.ShowErrorMessage(this, "Please select a Department.");
                lkpEdtBranchCode.Focus();
                return(false);
            }
            else if (Convert.ToInt32(lkpEdtCategory.EditValue) == -1)
            {
                UI.ShowErrorMessage(this, "Please select a Case Category.");
                lkpEdtCategory.Focus();
                return(false);
            }
            else if (Convert.ToInt32(lkpEdtCaseType.EditValue) == -1)
            {
                UI.ShowErrorMessage(this, "Please select a Case Type.");
                lkpEdtCaseType.Focus();
                return(false);
            }
            else if (ucMemberID1.EditValue.ToString().Length == 0)
            {
                UI.ShowErrorMessage(this, "Please select a Membership Id.");
                ucMemberID1.Focus();
                return(false);
            }
            else if (mmEdtDetail.Text.Length == 0)
            {
                UI.ShowErrorMessage(this, "Please enter Detail.");
                mmEdtDetail.Focus();
                return(false);
            }

            return(true);
        }
コード例 #2
0
        private void sbtnOK_Click(object sender, System.EventArgs e)
        {
            if (spinedtLastMemberID.Value >= 1 && luedtBranchCode.EditValue.ToString().Length == 0)
            {
                UI.ShowErrorMessage(this, "Please specify a Branch Code.");
                luedtBranchCode.Focus();
                DialogResult = DialogResult.None;
                return;
            }

            int lastMemberID    = ACMS.Convert.ToInt32(spinedtLastMemberID.EditValue);
            int lastNonMemberID = ACMS.Convert.ToInt32(spinedtLastNonMemberID.EditValue);

            if (lastMemberID > 0 || lastNonMemberID > 0)
            {
                string message = "";
                if (lastMemberID > 0)
                {
                    message = "New last member ID will be increase " + (lastMemberID + currentLastMemberID) + ". ";
                }
                if (lastNonMemberID > 0)
                {
                    message += "New last non-member ID will be increase " + (lastNonMemberID + currentLastNonMemberID) + ". ";
                }
                message += "Are you sure you want to commit change?";
                if (ACMS.Utils.UI.ShowYesNoMessage(this, message))
                {
                    DialogResult = DialogResult.OK;
                }
                else
                {
                    DialogResult = DialogResult.Cancel;
                }
            }
        }
コード例 #3
0
ファイル: frmAppointment.cs プロジェクト: kimykunjun/test
		private bool ValidateBeforeSave()
		{ 

            if (rbExisting.Checked )
            {
                if (ucMemberID1.ToString() == "")
                {
                    UI.ShowErrorMessage(this, "Please select a Exising Member.");
                    ucMemberID1.Focus();
                    return false;
                }
            }

            if (rbNew.Checked)
            {
                if (luedtContact.EditValue == null)
                {
                    UI.ShowErrorMessage(this, "Please select a Call List.");
                    luedtContact.Focus();
                    return false;
                }
            }

			return true;
		}
コード例 #4
0
ファイル: FormNewRedemption.cs プロジェクト: kimykunjun/test
 private void simpleButtonOK_Click(object sender, System.EventArgs e)
 {
     if (lookUpEdit1.Text.Length == 0)
     {
         MessageBox.Show(this, "Please select an Item.");
         this.DialogResult = DialogResult.None;
         lookUpEdit1.Focus();
         return;
     }
 }
コード例 #5
0
 private void sbtnOK_Click(object sender, System.EventArgs e)
 {
     if (luedtDestinationBranch.EditValue == null || luedtDestinationBranch.EditValue.ToString().Length == 0)
     {
         UI.ShowErrorMessage(this, "Please select a Destination Branch.");
         luedtDestinationBranch.Focus();
         DialogResult = DialogResult.None;
         return;
     }
 }
コード例 #6
0
ファイル: frmIntroduceFriend.cs プロジェクト: kimykunjun/test
        private void sbtnIntroduce_Click(object sender, System.EventArgs e)
        {
            if ((lkpEdtLoyalPoint.EditValue != null || lkFreebie.EditValue != null) && ucMemberID1.EditValue.ToString().Length != 0)
            {
                if (string.Compare(strMembershipID.Trim(), ucMemberID1.EditValue.ToString().Trim(), true) == 0)
                {
                    UI.ShowErrorMessage(this, "Member introduce him/herself is not allow.");
                    ucMemberID1.Focus();
                    DialogResult = DialogResult.None;
                    return;
                }

                string PointType = lkpEdtLoyalPoint.Text;

                double point          = 0.0;
                string promoteFreebie = "";
                if (lkpEdtLoyalPoint.EditValue != null)
                {
                    point = System.Convert.ToDouble(lkpEdtLoyalPoint.EditValue);
                }

                else if (lkFreebie.EditValue != null)
                {
                    promoteFreebie = lkFreebie.EditValue.ToString();
                }

                string introducerID = ucMemberID1.EditValue.ToString();

                if (point > 0)
                {
                    if (myMemberRecord.SaveIntroduceFriend(strMembershipID, introducerID, point, employeeID))
                    {
                        this.DialogResult = DialogResult.OK;
                        PrintIntroReceipt(strMembershipID, introducerID, point, PointType);
                    }
                }
                else if (promoteFreebie != "")
                {
                    DataTable IntroFriendFreebie = myMemberRecord.SaveIntroduceFriend(strMembershipID, introducerID, promoteFreebie, User.BranchCode, employeeID);
                    if (IntroFriendFreebie.Rows.Count > 0)
                    {
                        this.DialogResult = DialogResult.OK;
                        PrintIntroReceipt(strMembershipID, introducerID, IntroFriendFreebie);
                    }
                }
            }
            else
            {
                ACMS.Utils.UI.ShowErrorMessage(this, "Please fill in all field.", "Error");
                lkpEdtLoyalPoint.Focus();
                DialogResult = DialogResult.None;
            }
        }
コード例 #7
0
ファイル: frmAssignCV.cs プロジェクト: kimykunjun/test
 private void sbtnAssign_Click(object sender, System.EventArgs e)
 {
     if (lkpEdtDeptID.EditValue == null || lkpEdtDeptID.EditValue.ToString().Length == 0)
     {
         ACMS.Utils.UI.ShowErrorMessage(this, "Please select an Department ID.", "Error");
         lkpEdtDeptID.Focus();
         DialogResult = DialogResult.None;
         return;
     }
     else
     {
         DialogResult = DialogResult.OK;
     }
 }
コード例 #8
0
        private void sbtnSave_Click(object sender, System.EventArgs e)
        {
            if (lkpEdtStaffID.EditValue == null)
            {
                UI.ShowErrorMessage("Please select an Employee ID.");
                lkpEdtStaffID.Focus();
                DialogResult = DialogResult.None;
                return;
            }

            ACMSLogic.Staff.ReceipientGroup myReceipientGroup = new ACMSLogic.Staff.ReceipientGroup();
            if (!myReceipientGroup.NewReceipientGroupEntries(nMemoGroupID, Convert.ToInt32(lkpEdtStaffID.EditValue)))
            {
                DialogResult = DialogResult.None;
            }
            else
            {
                DialogResult = DialogResult.OK;
            }
        }
コード例 #9
0
ファイル: frmNewCVAction.cs プロジェクト: kimykunjun/test
        private void sbtnSave_Click(object sender, System.EventArgs e)
        {
            if (lkpEdtMode.EditValue == null || ACMS.Convert.ToInt32(lkpEdtMode.EditValue) == -1)
            {
                UI.ShowErrorMessage(this, "Please fill in Mode first.", "Error");
                lkpEdtMode.Focus();
                DialogResult = DialogResult.None;
                return;
            }
            this.BindingContext[myCVActionDataSet.Tables[0]].EndCurrentEdit();
            this.BindingContext[myCVCaseDataSet.Tables[0]].EndCurrentEdit();
            myCVActionDataSet.Tables[0].Rows[0]["nActionByID"]  = nEmployeeID;
            myCVActionDataSet.Tables[0].Rows[0]["dtDate"]       = DateTime.Now;
            myCVActionDataSet.Tables[0].Rows[0]["nCaseID"]      = nCaseID;
            myCVCaseDataSet.Tables[0].Rows[0]["nEmployeeID"]    = nEmployeeID;
            myCVCaseDataSet.Tables[0].Rows[0]["dtLastEditDate"] = DateTime.Now;
            myCV.SaveNewCVAction(myCVActionDataSet, nCaseID, myCVCaseDataSet);

            DialogResult = DialogResult.OK;
        }
コード例 #10
0
 private bool ValidateBeforeSave()
 {
     if (txtOrganization.Text.Length == 0)
     {
         UI.ShowErrorMessage("Please enter an Organization.");
         txtOrganization.Focus();
         return(false);
     }
     else if (luedtAppointmetType.EditValue == null)
     {
         UI.ShowErrorMessage("Please select an Appointment Type.");
         luedtAppointmetType.Focus();
         return(false);
     }
     else if (luedtContact.EditValue == null)
     {
         UI.ShowErrorMessage(this, "Please select a contact.");
         luedtContact.Focus();
         return(false);
     }
     return(true);
 }
コード例 #11
0
        private void btnSave_Click(object sender, System.EventArgs e)
        {
            if (lkpEdtBankCode.Text.Length == 0)
            {
                MessageBox.Show(this, "Please Select a Bank Code.");
                this.DialogResult = DialogResult.None;
                lkpEdtBankCode.Focus();
                return;
            }
            else if (lkpEdtMerchantNo.EditValue == null ||
                     lkpEdtMerchantNo.EditValue.ToString().Length == 0)
            {
                MessageBox.Show(this, "No Have Merchant No");
                this.DialogResult = DialogResult.None;
                //lkpEdtMerchantNo.Focus();
                return;
            }
            else if (lkpEdtMonthOfInstallment.Text.Length == 0)
            {
                MessageBox.Show(this, "Please Select a Months of installment.");
                this.DialogResult = DialogResult.None;
                lkpEdtMonthOfInstallment.Focus();
                return;
            }
            else if (txtCreditCard.EditValue.ToString().Length == 0)
            {
                MessageBox.Show(this, "Invalid credit card no.");
                this.DialogResult = DialogResult.None;
                txtCreditCard.Focus();
                return;
            }

            string strBankCode     = lkpEdtBankCode.Text;
            string strMerchantNo   = lkpEdtMerchantNo.EditValue.ToString();
            int    nMonths         = ACMS.Convert.ToInt32(lkpEdtMonthOfInstallment.EditValue);
            string strCreditCardNo = txtCreditCard.EditValue.ToString();

            myPOS.AddNewIPP(strBankCode, nMonths, strCreditCardNo, strMerchantNo);
        }
コード例 #12
0
        private void sbtnSave_Click(object sender, System.EventArgs e)
        {
            if (txtMemberName.Text.Length == 0)
            {
                UI.ShowErrorMessage(this, "Please fill in Member Name.");
                txtMemberName.Focus();
                DialogResult = DialogResult.None;
                return;
            }
            if (txtNRICFIN.Text.Length == 0)
            {
                UI.ShowErrorMessage(this, "Please fill in NIRC/FIN.");
                txtNRICFIN.Focus();
                DialogResult = DialogResult.None;
                return;
            }

            if (chkedtIsSg.Checked && !MemberRecord.ValidateNRICFormat(txtNRICFIN.Text))
            {
                if (UI.ShowYesNoMessage(this, "NIRC is not in valid format. Do you want enter again?", "Reminder"))
                {
                    txtNRICFIN.Focus();
                    DialogResult = DialogResult.None;
                    return;
                }
            }

            /*
             *          if (chkedtIsSg.Checked)
             *          {
             *                  if (myMemberRecord.CheckDuplicateNRIC(txtNRICFIN.Text, "") > 0)
             *                  {
             *                          ACMS.Utils.UI.ShowErrorMessage(this, "This NRIC already registed by other person.", "Duplicate NRIC");
             *                          txtNRICFIN.Focus();
             *                          DialogResult = DialogResult.None;
             *                          return;
             *                  }
             *          }*/

            //Perform NRIC check no matter is Singaporean or non
            if (myMemberRecord.CheckDuplicateNRIC(txtNRICFIN.Text, "") > 0)
            {
                ACMS.Utils.UI.ShowErrorMessage(this, "This NRIC already registed by other person.", "Duplicate NRIC");
                txtNRICFIN.Focus();
                DialogResult = DialogResult.None;
                return;
            }

            if (dateedtDOB.EditValue == null || dateedtDOB.EditValue.ToString().Length == 0)
            {
                ACMS.Utils.UI.ShowErrorMessage(this, "Please enter Date of Birth.");
                dateedtDOB.Focus();
                DialogResult = DialogResult.None;
                return;
            }

            //if (chkedtMember.Checked)
            //{
            if (luedtMediaSource.Text.Length == 0)
            {
                ACMS.Utils.UI.ShowErrorMessage(this, "Please Key in Media Source.");
                luedtMediaSource.Focus();
                DialogResult = DialogResult.None;
                return;
            }
            //}

            try
            {
                //if (chkedtMember.Checked)
                //{
                strMembershipID = myMemberRecord.AddNewMember(chkedtMember.Checked, strTerminalBranchCode, txtMemberName.Text, chkedtIsSg.Checked,
                                                              txtNRICFIN.Text, myUser.NEmployeeID(), dateedtDOB.DateTime, myUser, rbFemale.Checked, Convert.ToInt32(luedtMediaSource.EditValue));

                //}
                //else
                //{
                //strMembershipID = myMemberRecord.AddNewMember(chkedtMember.Checked, myUser.StrBranchCode(), txtMemberName.Text, chkedtIsSg.Checked,
                //txtNRICFIN.Text, myUser.NEmployeeID(), dateedtDOB.DateTime, myUser, rbFemale.Checked, 0);
                //}
            }
            catch (Exception ex)
            {
                if (ex.InnerException.Message.IndexOf(
                        "Violation of PRIMARY KEY constraint 'PK_tblMember'. Cannot insert duplicate key in object 'tblMember") != -1)
                {
                    UI.ShowErrorMessage("Duplicate ID found. Please reset membership ID.");
                    DialogResult = DialogResult.Cancel;
                }
                else
                {
                    throw;
                }
            }

            DialogResult = DialogResult.OK;
        }
コード例 #13
0
ファイル: frmIntroduceFriend.cs プロジェクト: kimykunjun/test
        private void sbtnIntroduce_Click(object sender, System.EventArgs e)
        {
            //0506
            if ((lkpEdtLoyalPoint.EditValue != null || lkFreebie.EditValue != null || lkTreatment.EditValue != null) && ucMemberID1.EditValue.ToString().Length != 0)
            {
                if (string.Compare(strMembershipID.Trim(), ucMemberID1.EditValue.ToString().Trim(), true) == 0)
                {
                    UI.ShowErrorMessage(this, "Member introduce him/herself is not allow.");
                    ucMemberID1.Focus();
                    DialogResult = DialogResult.None;
                    return;
                }

                TblMember sqlMember = new TblMember();
                sqlMember.StrMembershipID = ucMemberID1.EditValue.ToString();
                DataTable memberTable = sqlMember.SelectOne();

                if (memberTable.Rows.Count > 0)
                {
                    if (string.Compare(memberTable.Rows[0]["strIntroducerMembershipID"].ToString().Trim(), strMembershipID.Trim(), true) == 0)
                    {
                        UI.ShowErrorMessage(this, "Introducer selected was introduced by this member.");
                        ucMemberID1.Focus();
                        DialogResult = DialogResult.None;
                        return;
                    }
                }

                string PointType = lkpEdtLoyalPoint.Text;

                double point          = 0.0;
                string promoteFreebie = "";
                if (lkpEdtLoyalPoint.EditValue != null)
                {
                    point = System.Convert.ToDouble(lkpEdtLoyalPoint.EditValue);
                }

                else if (lkFreebie.EditValue != null)
                {
                    promoteFreebie = lkFreebie.EditValue.ToString();
                }
                else if (lkTreatment.EditValue != null)
                {
                    promoteFreebie = lkTreatment.EditValue.ToString();
                }

                string introducerID = ucMemberID1.EditValue.ToString();

                if (point > 0)
                {
                    if (myMemberRecord.SaveIntroduceFriend(strMembershipID, introducerID, point, employeeID))
                    {
                        this.DialogResult = DialogResult.OK;
                        PrintIntroReceipt(strMembershipID, introducerID, point, PointType);
                    }
                }                //0506
                else if (lkTreatment.EditValue != null)
                {
                    bool success = false;
                    //success = myMemberRecord.SaveIntroduceFriendNew(strMembershipID, introducerID, "BM004(58)", "INTRO " + introducerID, employeeID, 0);
                    //Amended by TBBC on 22 September 2015 for Intro friend package.
                    //success = myMemberRecord.SaveIntroduceFriendNew( introducerID,strMembershipID, "BM004(58)", "INTRO " + strMembershipID, employeeID, 0);
                    success = myMemberRecord.SaveIntroduceFriend(strMembershipID, introducerID, 0, employeeID);
                    success = myMemberRecord.SaveIntroduceFriendforPackage(strMembershipID, introducerID, lkTreatment.EditValue.ToString(), employeeID);

                    if (success)
                    {
                        this.DialogResult = DialogResult.OK;
                        //PrintIntroReceipt(strMembershipID, introducerID, PrintIntroReceiptServices);
                        PrintIntroReceiptServices(strMembershipID, introducerID, lkTreatment.Text);
                    }
                }
                else if (promoteFreebie != "")
                {
                    DataTable IntroFriendFreebie = myMemberRecord.SaveIntroduceFriend(strMembershipID, introducerID, promoteFreebie, User.BranchCode, employeeID);
                    if (IntroFriendFreebie.Rows.Count > 0)
                    {
                        this.DialogResult = DialogResult.OK;
                        PrintIntroReceipt(strMembershipID, introducerID, IntroFriendFreebie);
                    }
                }
            }
            else
            {
                ACMS.Utils.UI.ShowErrorMessage(this, "Please fill in all field.", "Error");
                lkpEdtLoyalPoint.Focus();
                DialogResult = DialogResult.None;
            }
        }
コード例 #14
0
ファイル: frmIPP_Add.cs プロジェクト: kimykunjun/test
        private void btnSave_Click(object sender, System.EventArgs e)
        {
            int output;

            output = 0;
            int nMonths;

            if (ucMemberID1.EditValue.ToString().Length == 0)
            {
                MessageBox.Show("Membership Id is required.");
                ucMemberID1.Focus();
                return;
            }

            if (this.IPPNMonths.EditValue.ToString() == "")
            {
                nMonths = Convert.ToInt32(null);
            }
            else
            {
                nMonths = Convert.ToInt32(this.IPPNMonths.EditValue);
            }

            if (luedtBank.EditValue == null)
            {
                MessageBox.Show("Please select a Bank.");
                luedtBank.Focus();
                return;
            }

            if (luedtBranch.EditValue == null)
            {
                MessageBox.Show("Please select a Branch.");
                luedtBranch.Focus();
                return;
            }

            try
            {
                SqlHelper.ExecuteNonQuery(connection, "up_tblIPP",
                                          new SqlParameter("@RET_VAL", output),
                                          new SqlParameter("@cmd", "I"),
                                          new SqlParameter("@nIPPID", null),
                                          new SqlParameter("@strMembershipID", ucMemberID1.EditValue.ToString()),
                                          new SqlParameter("@dtDate", Convert.ToDateTime(dateEdit1.EditValue)),
                                          new SqlParameter("@strBranchCode", luedtBranch.EditValue.ToString()),
                                          new SqlParameter("@strBankCode", luedtBank.EditValue.ToString()),
                                          new SqlParameter("@nMonths", nMonths),
                                          new SqlParameter("@strCreditCardNo", this.txtCreditCard.Text.Replace("-", "")),
                                          new SqlParameter("@strMerchantNo", this.txtMerchantNo.Text),
                                          new SqlParameter("@dtSentDate", null),
                                          new SqlParameter("@dtReceivedDate", null),
                                          new SqlParameter("@nIPPStatus", Convert.ToInt32("0"))


                                          );
            }
            catch (SqlException ex)
            {
                if (ex.Message.IndexOf("FK_tblIPP_tblMember") >= 0)
                {
                    MessageBox.Show("Please enter a correct Member ID.");
                    ucMemberID1.Focus();
                    return;
                }
            }

            this.Close();
        }