Example #1
0
        private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e)
        {
            gridViewReceipt.FocusedRowHandle = gridViewReceipt.FocusedRowHandle + 1;

            if (dateReceipt.Text.Trim() == "")
            {
                MessageBox.Show("Provide Receipt Date", "CRM", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                dateReceipt.Focus();
                return;
            }

            else if (Convert.ToInt32(cboCostCentre.EditValue) == -1)
            {
                MessageBox.Show("Select CostCentre Name", "CRM", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                cboCostCentre.Focus();
                return;
            }

            textAmt.EditValue = CommFun.IsNullCheck(gridViewReceipt.Columns["CurrentAmount"].SummaryText, CommFun.datatypes.vartypenumeric);

            if (Convert.ToDecimal(textAmt.EditValue) <= 0)
            {
                MessageBox.Show("Receipt Amount Should be greater than 0"); return;
            }

            if (ReceiptId == 0)
            {
                if (oVType.GenType == true)
                {
                    oVType             = new BsfGlobal.VoucherType();
                    oVType             = BsfGlobal.GetVoucherNo(26, Convert.ToDateTime(dateReceipt.EditValue), 0, 0);
                    textReceiptNo.Text = oVType.VoucherNo;
                }
            }

            else
            {
                if (oVType.PeriodWise == true)
                {
                    oVType = new BsfGlobal.VoucherType();
                    if (BsfGlobal.CheckPeriodChange(m_dOldDate, Convert.ToDateTime(dateReceipt.EditValue)) == true)
                    {
                        oVType = BsfGlobal.GetVoucherNo(26, Convert.ToDateTime(dateReceipt.EditValue), 0, 0);
                    }
                }
            }

            UpdateReceipt();
            if (ReceiptId == 0)
            {
                ClearEntries();
            }
            else
            {
                Close();
            }
        }
Example #2
0
        public void UpdateTenant()
        {
            try
            {
                oTtBO = new TenantDetBO();
                TenantDetBO.TenantId     = m_iTenantId;
                TenantDetBO.TenantName   = CommFun.IsNullCheck(txtBrName.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.Address1     = CommFun.IsNullCheck(txtAdd1.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.Address2     = CommFun.IsNullCheck(txtAdd2.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.City         = Convert.ToInt32(CommFun.IsNullCheck(lookUpCity.EditValue, CommFun.datatypes.vartypenumeric));
                TenantDetBO.State        = Convert.ToInt32(CommFun.IsNullCheck(txtState.Tag, CommFun.datatypes.vartypenumeric));
                TenantDetBO.Country      = Convert.ToInt32(CommFun.IsNullCheck(txtCountry.Tag, CommFun.datatypes.vartypenumeric));
                TenantDetBO.Pincode      = CommFun.IsNullCheck(txtPin.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.Mobile       = CommFun.IsNullCheck(txtMobile.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.PhoneRes     = CommFun.IsNullCheck(txtPhoneRes.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.Email        = CommFun.IsNullCheck(txtEmail.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.EmpPlace     = CommFun.IsNullCheck(textEmployment.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.Designation  = CommFun.IsNullCheck(txtjob.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.OffAddress   = CommFun.IsNullCheck(txtOfficeAdd.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.OffPhone     = CommFun.IsNullCheck(txtOfficePh.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.OffEmail     = CommFun.IsNullCheck(txtOfficeEmail.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.Commands     = CommFun.IsNullCheck(txtCmd.Text, CommFun.datatypes.vartypestring).ToString();
                TenantDetBO.CostCentreId = Convert.ToInt32(CommFun.IsNullCheck(lookUpPro.EditValue, CommFun.datatypes.vartypenumeric));
                TenantDetBO.BlockId      = Convert.ToInt32(CommFun.IsNullCheck(lookUpBlock.EditValue, CommFun.datatypes.vartypenumeric));
                TenantDetBO.FlatId       = Convert.ToInt32(CommFun.IsNullCheck(lookUpUnit.EditValue, CommFun.datatypes.vartypenumeric));
                TenantDetBO.TransDate    = String.Format("{0:dd-MMM-yyyy}", CommFun.IsNullCheck(dtCompDate.EditValue, CommFun.datatypes.VarTypeDate));
                TenantDetBO.RefNo        = CommFun.IsNullCheck(txtRefNo.Text, CommFun.datatypes.vartypestring).ToString();

                if (m_iTenantId == 0)
                {
                    bSuccess = TenantDetBL.InsertTenantDetails();
                    BsfGlobal.UpdateMaxNo(26, oVType, 0, 0);
                }
                else
                {
                    if (Convert.ToDateTime(ComplaintDetBO.TransDate) != Convert.ToDateTime(dtCompDate.EditValue))
                    {
                        oVType = new BsfGlobal.VoucherType();
                        if (oVType.PeriodWise == true)
                        {
                            if (BsfGlobal.CheckPeriodChange(Convert.ToDateTime(TenantDetBO.TransDate), Convert.ToDateTime(dtCompDate.EditValue)) == true)
                            {
                                oVType        = BsfGlobal.GetVoucherNo(26, Convert.ToDateTime(dtCompDate.EditValue), 0, 0);
                                txtRefNo.Text = oVType.VoucherNo;
                                BsfGlobal.UpdateMaxNo(26, oVType, 0, 0);
                            }
                        }
                    }
                    bSuccess = TenantDetBL.UpdateTenantDetails();
                }
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }
Example #3
0
        public void UpdateReceipt()
        {
            try
            {
                oRptBO = new PMSReceiptDetailBO();
                PMSReceiptDetailBO.ReceiptId    = ReceiptId;
                PMSReceiptDetailBO.ReceiptDate  = String.Format("{0:dd-MMM-yyyy}", dateReceipt.EditValue);                                                    //dateReceipt
                PMSReceiptDetailBO.ReceiptNo    = CommFun.IsNullCheck(textReceiptNo.Text, CommFun.datatypes.vartypestring).ToString();                        //textReceiptNo
                PMSReceiptDetailBO.ChequeNo     = CommFun.IsNullCheck(textChequeNo.Text, CommFun.datatypes.vartypestring).ToString();                         //textChequeNo
                PMSReceiptDetailBO.ChequeDate   = String.Format("{0:dd-MMM-yyyy}", CommFun.IsNullCheck(dateCheque.EditValue, CommFun.datatypes.VarTypeDate)); // String.Format("{0:dd-MMM-yyyy}", dateCheque.Text);// dateCheque
                PMSReceiptDetailBO.BankName     = CommFun.IsNullCheck(textBankName.Text, CommFun.datatypes.vartypestring).ToString();                         //textBankName
                PMSReceiptDetailBO.CostCentreId = Convert.ToInt32(CommFun.IsNullCheck(cboCostCentre.EditValue, CommFun.datatypes.vartypenumeric));
                PMSReceiptDetailBO.FlatId       = Convert.ToInt32(CommFun.IsNullCheck(cboFlatNo.EditValue, CommFun.datatypes.vartypenumeric));
                PMSReceiptDetailBO.PaymentMode  = CommFun.IsNullCheck(cboMode.EditValue, CommFun.datatypes.vartypestring).ToString();
                PMSReceiptDetailBO.Amount       = Convert.ToDecimal(CommFun.IsNullCheck(gridViewReceipt.Columns["CurrentAmount"].SummaryText, CommFun.datatypes.vartypenumeric));//textAmt
                PMSReceiptDetailBO.Narration    = CommFun.IsNullCheck(txtNarration.Text, CommFun.datatypes.vartypestring).ToString();


                if (ReceiptId == 0)
                {
                    PMSReceiptBL.InsertReceipt(oRptBO, dtReceipt);
                    //ReceiptDetailBL.InsertReceiptDetails(oRptBO, dtReceipt, m_sBussinessType, dtRecp, dtInfo, dtReceiptType, dtQualifier, m_tQualAbs);
                    //CommFun.InsertLog(DateTime.Now, "Receipt Register-Add", "N", "Add ExtraItem Register", BsfGlobal.g_lUserId, 0, m_iCCId, 0, BsfGlobal.g_sCRMDBName);
                    BsfGlobal.UpdateMaxNo(26, oVType, 0, 0);
                }
                else
                {
                    if (Convert.ToDateTime(PMSReceiptDetailBO.ReceiptDate) != Convert.ToDateTime(dateReceipt.EditValue))
                    {
                        oVType = new BsfGlobal.VoucherType();
                        if (oVType.PeriodWise == true)
                        {
                            if (BsfGlobal.CheckPeriodChange(Convert.ToDateTime(PMSReceiptDetailBO.ReceiptDate), Convert.ToDateTime(dateReceipt.EditValue)) == true)
                            {
                                oVType             = BsfGlobal.GetVoucherNo(26, Convert.ToDateTime(dateReceipt.EditValue), 0, 0);
                                textReceiptNo.Text = oVType.VoucherNo;
                                BsfGlobal.UpdateMaxNo(26, oVType, 0, 0);
                            }
                        }
                    }
                    PMSReceiptBL.UpdateReceipt(oRptBO, dtReceipt);
                    //ReceiptDetailBL.UpdateReceiptDetails(oRptBO, dtReceipt, m_sBussinessType, dtInfo, dtReceiptType, dtQualifier, m_tQualAbs);
                    //CommFun.InsertLog(DateTime.Now, "Receipt Register-Edit", "E", "Edit ExtraItem Register", BsfGlobal.g_lUserId, 0, m_iCCId, 0, BsfGlobal.g_sCRMDBName);
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Example #4
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (txtBrName.Text.Trim() == "")
            {
                MessageBox.Show("Provide Tenant Name", "PMS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                txtBrName.Focus();
                return;
            }
            else if (txtAdd1.Text.Trim() == "")
            {
                MessageBox.Show("Please Enter Address", "PMS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                txtAdd1.Focus();
                return;
            }
            else if (txtMobile.Text.Trim() == "")
            {
                MessageBox.Show("Provide MobileNo", "PMS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                txtMobile.Focus();
                return;
            }
            else if (Convert.ToInt32(lookUpCity.EditValue) == -1)
            {
                MessageBox.Show("Select City", "PMS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                lookUpCity.Focus();
                return;
            }
            else if (Convert.ToInt32(lookUpPro.EditValue) == -1)
            {
                MessageBox.Show("Select Project", "PMS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                lookUpPro.Focus();
                return;
            }
            else if (Convert.ToInt32(lookUpBlock.EditValue) == -1 || Convert.ToInt32(lookUpBlock.EditValue) == 0)
            {
                MessageBox.Show("Select Block", "PMS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                lookUpBlock.Focus();
                return;
            }
            else if (Convert.ToInt32(lookUpUnit.EditValue) == -1 || Convert.ToInt32(lookUpUnit.EditValue) == 0)
            {
                MessageBox.Show("Select Flat", "PMS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                lookUpUnit.Focus();
                return;
            }

            if (m_iTenantId == 0)
            {
                if (oVType.GenType == true)
                {
                    oVType        = new BsfGlobal.VoucherType();
                    oVType        = BsfGlobal.GetVoucherNo(26, Convert.ToDateTime(dtCompDate.EditValue), 0, 0);
                    txtRefNo.Text = oVType.VoucherNo;
                }
            }
            else
            {
                if (oVType.PeriodWise == true)
                {
                    oVType = new BsfGlobal.VoucherType();
                    if (BsfGlobal.CheckPeriodChange(m_dOldDate, Convert.ToDateTime(dtCompDate.EditValue)) == true)
                    {
                        oVType = BsfGlobal.GetVoucherNo(26, Convert.ToDateTime(dtCompDate.EditValue), 0, 0);
                    }
                }
            }

            UpdateTenant();
            if (bSuccess == true)
            {
                if (m_iTenantId == 0)
                {
                    ClearEntries();
                }
                else
                {
                    //    if (BsfGlobal.g_bWorkFlow == true)
                    //    {
                    //        Close();
                    //        Cursor.Current = Cursors.WaitCursor;
                    //        frmTenantReg frmProg = new frmTenantReg();
                    //        frmProg.TopLevel = false;
                    //        frmProg.FormBorderStyle = FormBorderStyle.None;
                    //        frmProg.Dock = DockStyle.Fill;
                    //        frmTenantReg.m_oDW.Show();
                    //        frmTenantReg.t_panel.Controls.Clear();
                    //        frmTenantReg.t_panel.Controls.Add(frmProg);
                    //        frmProg.Show();
                    //        Cursor.Current = Cursors.Default;
                    //    }
                    //    else
                    //    {
                    //        Close();
                    //    }
                    Close();
                }
            }
        }
Example #5
0
        private void cmdOK_Click(object sender, EventArgs e)
        {
            int iTypeId = 0;

            if (optStatusType.SelectedIndex == 0)
            {
                iTypeId = 18;
            }
            else if (optStatusType.SelectedIndex == 1)
            {
                iTypeId = 19;
            }
            else if (optStatusType.SelectedIndex == 2)
            {
                iTypeId = 20;
            }

            bool bChange = false;

            if (Validation() == true)
            {
                if (m_lRegTransId == 0)
                {
                    UpdateRegNo();
                }
                else
                {
                    if (m_dOldDate != Convert.ToDateTime(dtpDate.Text))
                    {
                        if (oVType.PeriodWise == true)
                        {
                            if (BsfGlobal.CheckPeriodChange(m_dOldDate, Convert.ToDateTime(dtpDate.Text)))
                            {
                                oVType        = new BsfGlobal.VoucherType();
                                oVType        = BsfGlobal.GetVoucherNo(iTypeId, Convert.ToDateTime(dtpDate.Text), 0, 0);
                                txtRefNo.Text = oVType.VoucherNo;
                                bChange       = true;
                            }
                        }
                    }
                }


                m_oRegister.RegTransId = m_lRegTransId;
                m_oRegister.RegisterId = Convert.ToInt32(cboReg.EditValue);
                m_oRegister.RegDate    = Convert.ToDateTime(dtpDate.EditValue);
                m_oRegister.RegNo      = txtRefNo.Text;
                m_oRegister.VendorId   = Convert.ToInt32(txtVendorName.Tag);
                if (optStatusType.SelectedIndex == 0)
                {
                    m_oRegister.StatusType = "R";
                }
                else if (optStatusType.SelectedIndex == 1)
                {
                    m_oRegister.StatusType = "S";
                }
                else if (optStatusType.SelectedIndex == 2)
                {
                    m_oRegister.StatusType = "B";
                }

                m_oRegister.Supply   = chkSupply.Checked;
                m_oRegister.SFDate   = Convert.ToDateTime(dtpSFDate.EditValue);
                m_oRegister.STDate   = Convert.ToDateTime(dtpSTDate.EditValue);
                m_oRegister.SLife    = chkSLife.Checked;
                m_oRegister.SGradeId = Convert.ToInt32(txtSGradeName.Tag);

                m_oRegister.Contract = chkContract.Checked;
                m_oRegister.CFDate   = Convert.ToDateTime(dtpCFDate.EditValue);
                m_oRegister.CTDate   = Convert.ToDateTime(dtpCTDate.EditValue);
                m_oRegister.CLife    = chkCLife.Checked;
                m_oRegister.CGradeId = Convert.ToInt32(txtCGradeName.Tag);


                m_oRegister.Service  = chkService.Checked;
                m_oRegister.HFDate   = Convert.ToDateTime(dtpHFDate.EditValue);
                m_oRegister.HTDate   = Convert.ToDateTime(dtpHTDate.EditValue);
                m_oRegister.HLife    = chkHLife.Checked;
                m_oRegister.HGradeId = Convert.ToInt32(txtHGradeName.Tag);

                m_oRegister.Remarks = txtRemarks.Text;


                if (m_lRegTransId == 0)
                {
                    m_oRegister.InsertRegTrans(m_oRegister, iTypeId);
                    BsfGlobal.UpdateMaxNo(iTypeId, oVType, 0, 0);
                    if (optStatusType.SelectedIndex == 0)
                    {
                        BsfGlobal.InsertAlert("Vendor-Renewal", "" + cboReg.Text + " - Renewed Successfully", 0, BsfGlobal.g_sVendorDBName);
                    }
                    else if (optStatusType.SelectedIndex == 1)
                    {
                        BsfGlobal.InsertAlert("Vendor-BlackList", "" + cboReg.Text + " - Blocked", 0, BsfGlobal.g_sVendorDBName);
                    }
                    else if (optStatusType.SelectedIndex == 2)
                    {
                        BsfGlobal.InsertAlert("Vendor-Suspend", "" + cboReg.Text + " - Suspended", 0, BsfGlobal.g_sVendorDBName);
                    }
                }
                else
                {
                    m_oRegister.UpdateRegTrans(m_oRegister);
                    if (bChange == true)
                    {
                        BsfGlobal.UpdateMaxNo(iTypeId, oVType, 0, 0);
                    }
                }
                m_oRegUpdate.UpdateRegistration(Convert.ToInt32(txtVendorName.Tag));
                this.Close();
            }
        }
Example #6
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                if (Convert.ToInt32(cboProj.EditValue) == -1)
                {
                    MessageBox.Show("Provide Project Type", "PMS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    cboProj.Focus();
                    return;
                }
                else if (Convert.ToInt32(cboFlatNo.EditValue) == -1)
                {
                    MessageBox.Show("Provide Flat Type", "PMS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    cboFlatNo.Focus();
                    return;
                }
                else if (txtBuyer.Text.Trim() == "")
                {
                    MessageBox.Show("Try another Project Type", "PMS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    cboProj.Focus();
                    return;
                }
                else if (Convert.ToInt32(cboNature.EditValue) == -1)
                {
                    MessageBox.Show("Provide Complaint Nature Type", "PMS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    cboNature.Focus();
                    return;
                }
                else if (Convert.ToInt32(cboExec.EditValue) == -1)
                {
                    MessageBox.Show("Provide Complaint Nature Type", "PMS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    cboExec.Focus();
                    return;
                }

                if (m_iComplaintId == 0)
                {
                    if (oVType.GenType == true)
                    {
                        oVType         = new BsfGlobal.VoucherType();
                        oVType         = BsfGlobal.GetVoucherNo(28, Convert.ToDateTime(dtCompDate.EditValue), 0, 0);
                        textCmpNo.Text = oVType.VoucherNo;
                    }
                }

                else
                {
                    if (oVType.PeriodWise == true)
                    {
                        oVType = new BsfGlobal.VoucherType();
                        if (BsfGlobal.CheckPeriodChange(m_dOldDate, Convert.ToDateTime(dtCompDate.EditValue)) == true)
                        {
                            oVType = BsfGlobal.GetVoucherNo(28, Convert.ToDateTime(dtCompDate.EditValue), 0, 0);
                        }
                    }
                }



                UpdateData();
                if (bSuccess == true)
                {
                    if (m_iComplaintId == 0)
                    {
                        ClearEntries();
                    }
                    else
                    {
                        //if (BsfGlobal.g_bWorkFlow == true)
                        //{
                        //    Close();
                        //    Cursor.Current = Cursors.WaitCursor;
                        //    frmComplaintRegister frmProg = new frmComplaintRegister();
                        //    frmProg.TopLevel = false;
                        //    frmProg.FormBorderStyle = FormBorderStyle.None;
                        //    frmProg.Dock = DockStyle.Fill;
                        //    frmComplaintRegister.m_oDW.Show();
                        //    frmComplaintRegister.t_panel.Controls.Clear();
                        //    frmComplaintRegister.t_panel.Controls.Add(frmProg);
                        //    frmProg.Show();
                        //    Cursor.Current = Cursors.Default;
                        //}
                        //else
                        //{
                        //    Close();
                        //}
                        Close();
                    }
                }
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }
Example #7
0
        public void UpdateData()
        {
            try
            {
                if (radioGroup1.SelectedIndex == 0)
                {
                    m_sExtracharge = "N";
                }
                else
                {
                    m_sExtracharge = "Y";
                }

                if (cboProj.EditValue != null && cboNature.EditValue != null && Convert.ToInt32(cboNature.EditValue) > 0 && textCmpNo.Text != null && textCmpNo.Text != string.Empty)
                {
                    if (m_iComplaintId == 0)
                    {
                        string sAlert = "";
                        sAlert = cboNature.Text + " at " + cboProj.Text + " Flat No : " + cboFlatNo.Text;

                        //// --- Mail Sent to Tenant while Entering the complaint Entry -----
                        //Body = "<table style='background-color: #FFFFCC'><tr><td colspan='2' align='center' style='font-size: 20px; color: Maroon; border-style:groove;'>";
                        //Body += "<b> Complaint Entry Register</b></td></tr><tr><td colspan='2'></td></tr><tr style='width: 600px; height: 25px;'><td style='width: 200px;'>Project Name : ";
                        //Body += "</td><td style='width: 300px;'><b><i>" + cboProj.Text + "</i></b></td> </tr><tr><td style='width: 200px;'>Flat No : </td><td style='width: 300px;'><b><i>" + cboFlatNo.Text + "</i></b></td></tr>";
                        //Body += "<tr style='width: 600px; height: 25px;'><td style='width: 200px;'>Tenant Name : ";
                        //Body += " </td><td style='width: 300px;'><b><i>" + txtTenant.Text + "</i></b></td> </tr><tr><td style='width: 200px;'>Complaint No : </td><td style='width: 300px;'><b><i>" + textCmpNo.Text + "</i></b></td></tr>";
                        //Body += "<tr><td style='width: 200px;'>Nature Of Complaint :</td>";
                        //Body += "<td style='width: 300px;'><b><i>" + cboNature.Text + "</i></b></td></tr><tr><td style='width: 200px;'>Attented By :</td><td style='width: 300px;'><b><i>" + cboExec.Text + "</i></b></td>";
                        //Body += "</tr><tr><td style='width: 200px;'>Date Attented By :</td><td style='width: 300px;'><b><i>" + dtAttendDate.Value + "</i></b></td></tr><tr><td colspan='2'></td></tr>";
                        //Body += "<tr><td colspan='2' align='right' style='font-size: 14px; color: Maroon;'><b>[email protected]</b></td></tr> <tr><td colspan='2' align='right' style='font-size: 14px; color: Maroon; border-style: solid;'><i>Micromen.com</i></td></tr></table>";

                        //string sqlEmail;
                        //DataTable CheckEmail;
                        //sqlEmail = String.Format("select TenantName,Email from TenantDet where TenantId={0}", txtTenant.Tag);
                        //CheckEmail = new DataTable();
                        //CheckEmail = CommFun.FillRecord(sqlEmail);
                        //if (CheckEmail.Rows.Count >= 1)
                        //{
                        //    To = CheckEmail.Rows[0]["Email"].ToString();
                        //}
                        //// ---Mail End

                        if (m_sExtracharge == "Y" && cboFlatNo.EditValue != null)
                        {
                            // string sqlchk;
                            DataTable Check = new DataTable();
                            //sqlchk = String.Format("SELECT C.ComplaintId,C.CostCentreId,C.FlatId,C.LeadId,C.TenantId,C.NatureId, C.ExecutiveId,C.TransDate,C.AttDate DateAttented,E.EmployeeName AttendedBy,F.FlatNo,C1.CostCentreName, C.Remarks FROM Complaint_Entry C INNER JOIN FlatDetails F ON C.FlatId=F.FlatId INNER JOIN BuyerDetail B ON C.LeadId=B.LeadId INNER JOIN [{0}].dbo.OperationalCostCentre C1  ON C.CostCentreId=C1.CostCentreId INNER JOIN [{0}].dbo.Users E ON C.ExecutiveId=E.UserId where  F.FlatId={1} and C.chargetype='Y' ORDER BY DateAttented", BsfGlobal.g_sWorkFlowDBName, cboFlatNo.EditValue);
                            Check = ComplaintDetBL.CompliantCheck(Convert.ToInt32(cboFlatNo.EditValue));
                            if (Check.Rows.Count >= 1)
                            {
                                MessageBox.Show("Already submit the complaint", "Information", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                                return;
                            }
                            else
                            {
                                oComtBO = new ComplaintDetBO();
                                ComplaintDetBO.CostCentreId = Convert.ToInt32(CommFun.IsNullCheck(cboProj.EditValue, CommFun.datatypes.vartypenumeric));
                                ComplaintDetBO.FlatId       = Convert.ToInt32(CommFun.IsNullCheck(cboFlatNo.EditValue, CommFun.datatypes.vartypenumeric));
                                ComplaintDetBO.BuyerId      = Convert.ToInt32(CommFun.IsNullCheck(txtBuyer.Tag, CommFun.datatypes.vartypenumeric));
                                ComplaintDetBO.TransDate    = String.Format("{0:dd-MMM-yyyy}", CommFun.IsNullCheck(dtCompDate.EditValue, CommFun.datatypes.VarTypeDate));
                                ComplaintDetBO.NatureId     = Convert.ToInt32(CommFun.IsNullCheck(cboNature.EditValue, CommFun.datatypes.vartypenumeric));
                                ComplaintDetBO.ExecutiveId  = Convert.ToInt32(CommFun.IsNullCheck(cboExec.EditValue, CommFun.datatypes.vartypenumeric));
                                ComplaintDetBO.AttDate      = String.Format("{0:dd-MMM-yyyy}", CommFun.IsNullCheck(dtAttendDate.EditValue, CommFun.datatypes.VarTypeDate));
                                ComplaintDetBO.Remarks      = CommFun.IsNullCheck(txtRemarks.Text, CommFun.datatypes.vartypestring).ToString();
                                ComplaintDetBO.complaintNo  = CommFun.IsNullCheck(textCmpNo.Text, CommFun.datatypes.vartypestring).ToString();
                                ComplaintDetBO.ChargeTYpe   = m_sExtracharge;
                                ComplaintDetBO.AttnRemarks  = CommFun.IsNullCheck(txtAttnRemark.Text, CommFun.datatypes.vartypestring).ToString();
                                ComplaintDetBO.ExeAttnId    = Convert.ToInt32(CommFun.IsNullCheck(cboAttnExec.EditValue, CommFun.datatypes.vartypenumeric));
                                bSuccess = ComplaintDetBL.InsertCompDetails(sAlert);
                                BsfGlobal.UpdateMaxNo(28, oVType, 0, 0);

                                // Body = "<table><tr><td colspan='2' align='center' style='font-size: 20px; color: Maroon; border-style:groove;'>";
                                // Body += "<b> Complaint Entry Register</b></td></tr><tr><td colspan='2'></td></tr><tr style='width: 600px; height: 25px;'><td style='width: 200px;'>Project Name : ";
                                // Body += "</td><td style='width: 300px;'><b><i>" + cboProj.Text + "</i></b></td> </tr><tr><td style='width: 200px;'>Flat No : </td><td style='width: 300px;'><b><i>" + cboFlatNo.Text + "</i></b></td></tr><tr><td style='width: 200px;'>Nature Of Complaint :</td>";
                                // Body += "<td style='width: 300px;'><b><i>" + cboNature.Text + "</i></b></td></tr><tr><td style='width: 200px;'>Attented By :</td><td style='width: 300px;'><b><i>" + cboExec.Text + "</i></b></td>";
                                // Body += "</tr><tr><td style='width: 200px;'>Date Attented By :</td><td style='width: 300px;'><b><i>" + dtAttendDate.Value + "</i></b></td></tr><tr><td colspan='2'></td></tr>";
                                //Body += "<tr><td colspan='2' align='right' style='font-size: 14px; color: Maroon;'><b>[email protected]</b></td></tr> <tr><td colspan='2' align='right' style='font-size: 14px; color: Maroon;'><i>Micromen.com</i></td></tr></table>";

                                //----- Mail Deliver---
                                // SendMail("Retrieve Complaint Entry", Body, true, "*****@*****.**", To, CC, BCC, "smtp.gmail.com", 587, "*****@*****.**", "micromen");
                            }
                        }
                        else
                        {
                            oComtBO = new ComplaintDetBO();
                            ComplaintDetBO.CostCentreId = Convert.ToInt32(CommFun.IsNullCheck(cboProj.EditValue, CommFun.datatypes.vartypenumeric));
                            ComplaintDetBO.FlatId       = Convert.ToInt32(CommFun.IsNullCheck(cboFlatNo.EditValue, CommFun.datatypes.vartypenumeric));
                            ComplaintDetBO.BuyerId      = Convert.ToInt32(CommFun.IsNullCheck(txtBuyer.Tag, CommFun.datatypes.vartypenumeric));
                            ComplaintDetBO.TransDate    = String.Format("{0:dd-MMM-yyyy}", CommFun.IsNullCheck(dtCompDate.EditValue, CommFun.datatypes.VarTypeDate));
                            ComplaintDetBO.NatureId     = Convert.ToInt32(CommFun.IsNullCheck(cboNature.EditValue, CommFun.datatypes.vartypenumeric));
                            ComplaintDetBO.ExecutiveId  = Convert.ToInt32(CommFun.IsNullCheck(cboExec.EditValue, CommFun.datatypes.vartypenumeric));
                            ComplaintDetBO.AttDate      = String.Format("{0:dd-MMM-yyyy}", CommFun.IsNullCheck(dtAttendDate.EditValue, CommFun.datatypes.VarTypeDate));
                            ComplaintDetBO.Remarks      = CommFun.IsNullCheck(txtRemarks.Text, CommFun.datatypes.vartypestring).ToString();
                            ComplaintDetBO.complaintNo  = CommFun.IsNullCheck(textCmpNo.Text, CommFun.datatypes.vartypestring).ToString();
                            ComplaintDetBO.ChargeTYpe   = m_sExtracharge;
                            ComplaintDetBO.AttnRemarks  = CommFun.IsNullCheck(txtAttnRemark.Text, CommFun.datatypes.vartypestring).ToString();
                            ComplaintDetBO.ExeAttnId    = Convert.ToInt32(CommFun.IsNullCheck(cboAttnExec.EditValue, CommFun.datatypes.vartypenumeric));
                            bSuccess = ComplaintDetBL.InsertCompDetails(sAlert);
                            BsfGlobal.UpdateMaxNo(28, oVType, 0, 0);
                            //----- Mail Deliver---
                            //SendMail("Retrieve Complaint Entry", Body, true, "*****@*****.**", To, CC, BCC, "smtp.gmail.com", 587, "*****@*****.**", "micromen");
                        }
                    }
                    else
                    {
                        oComtBO = new ComplaintDetBO();
                        ComplaintDetBO.ComplaintId  = m_iComplaintId;
                        ComplaintDetBO.CostCentreId = Convert.ToInt32(CommFun.IsNullCheck(cboProj.EditValue, CommFun.datatypes.vartypenumeric));
                        ComplaintDetBO.FlatId       = Convert.ToInt32(CommFun.IsNullCheck(cboFlatNo.EditValue, CommFun.datatypes.vartypenumeric));
                        ComplaintDetBO.BuyerId      = Convert.ToInt32(CommFun.IsNullCheck(txtBuyer.Tag, CommFun.datatypes.vartypenumeric));
                        ComplaintDetBO.TransDate    = String.Format("{0:dd-MMM-yyyy}", CommFun.IsNullCheck(dtCompDate.EditValue, CommFun.datatypes.VarTypeDate));
                        ComplaintDetBO.NatureId     = Convert.ToInt32(CommFun.IsNullCheck(cboNature.EditValue, CommFun.datatypes.vartypenumeric));
                        ComplaintDetBO.ExecutiveId  = Convert.ToInt32(CommFun.IsNullCheck(cboExec.EditValue, CommFun.datatypes.vartypenumeric));
                        ComplaintDetBO.AttDate      = String.Format("{0:dd-MMM-yyyy}", CommFun.IsNullCheck(dtAttendDate.EditValue, CommFun.datatypes.VarTypeDate));
                        ComplaintDetBO.Remarks      = CommFun.IsNullCheck(txtRemarks.Text, CommFun.datatypes.vartypestring).ToString();
                        ComplaintDetBO.complaintNo  = CommFun.IsNullCheck(textCmpNo.Text, CommFun.datatypes.vartypestring).ToString();
                        ComplaintDetBO.ChargeTYpe   = m_sExtracharge;
                        ComplaintDetBO.AttnRemarks  = CommFun.IsNullCheck(txtAttnRemark.Text, CommFun.datatypes.vartypestring).ToString();
                        ComplaintDetBO.ExeAttnId    = Convert.ToInt32(CommFun.IsNullCheck(cboAttnExec.EditValue, CommFun.datatypes.vartypenumeric));

                        if (Convert.ToDateTime(ComplaintDetBO.TransDate) != Convert.ToDateTime(dtCompDate.EditValue))
                        {
                            oVType = new BsfGlobal.VoucherType();
                            if (oVType.PeriodWise == true)
                            {
                                if (BsfGlobal.CheckPeriodChange(Convert.ToDateTime(ComplaintDetBO.TransDate), Convert.ToDateTime(dtCompDate.EditValue)) == true)
                                {
                                    oVType         = BsfGlobal.GetVoucherNo(28, Convert.ToDateTime(dtCompDate.EditValue), 0, 0);
                                    textCmpNo.Text = oVType.VoucherNo;
                                    BsfGlobal.UpdateMaxNo(28, oVType, 0, 0);
                                }
                            }
                        }
                        bSuccess = ComplaintDetBL.UpdateCompDetails();
                    }
                }
            }
            catch (Exception ex)
            {
                BsfGlobal.CustomException(ex.Message, ex.StackTrace);
            }
        }
Example #8
0
        private void btnOK_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (BsfGlobal.FindPermission("Stage Details-Add") == false)
            {
                MessageBox.Show("You don't have Rights to Stage Details-Add");
                return;
            }
            if (iStgId == 0)
            {
                if (oVType.GenType == true)
                {
                    oVType        = new BsfGlobal.VoucherType();
                    oVType        = BsfGlobal.GetVoucherNo(33, Convert.ToDateTime(Sdate.EditValue), 0, 0);
                    txtRefNo.Text = oVType.VoucherNo;
                }
            }

            else
            {
                if (oVType.PeriodWise == true)
                {
                    oVType = new BsfGlobal.VoucherType();
                    if (BsfGlobal.CheckPeriodChange(m_dOldDate, Convert.ToDateTime(Sdate.EditValue)) == true)
                    {
                        oVType = BsfGlobal.GetVoucherNo(33, Convert.ToDateTime(Sdate.EditValue), 0, 0);
                    }
                }
            }
            bool bAns = false;

            AssignStage();

            bAns = CostCentreBL.StageListFound(oU, iStgId);

            if (cboSBlock.EditValue == null || cboStage.EditValue == null)
            {
                return;
            }
            if (bAns == true)
            {
                MessageBox.Show("Stage Already Completed"); return;
            }


            if (Convert.ToInt32(cboSLevel.EditValue) == 0)
            {
                oU.LevelId = 0;
            }
            if (m_smode == "E")
            {
                if (cboSBlock.EditValue == null || cboStage.EditValue == null || cboStage.Text == "None")
                {
                    return;
                }

                if (Convert.ToDateTime(oU.StageDate) != Convert.ToDateTime(Sdate.EditValue))
                {
                    oVType = new BsfGlobal.VoucherType();
                    if (oVType.PeriodWise == true)
                    {
                        if (BsfGlobal.CheckPeriodChange(Convert.ToDateTime(oU.StageDate), Convert.ToDateTime(Sdate.EditValue)) == true)
                        {
                            oVType        = BsfGlobal.GetVoucherNo(33, Convert.ToDateTime(Sdate.EditValue), 0, 0);
                            txtRefNo.Text = oVType.VoucherNo;
                            BsfGlobal.UpdateMaxNo(33, oVType, 0, 0);
                        }
                    }
                }

                UnitDirBL.UpdateStage(oU, iStgId);

                //CommFun.InsertLog(DateTime.Now, "Stage Completion-Edit", "E", "Edit Stage Completion", BsfGlobal.g_lUserId, 0, m_iCCId, 0, BsfGlobal.g_sCRMDBName);
                BsfGlobal.InsertLog(DateTime.Now, "Stage Completion-Edit", "E", "Edit Stage Completion", iStgId, m_iCCId, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId);
                this.Close();
            }
            else
            {
                UnitDirBL.InsertStage(oU);

                BsfGlobal.UpdateMaxNo(33, oVType, 0, 0);
                clearstage();
                //CommFun.InsertLog(DateTime.Now, "Stage Completion-Add", "N", "Add Stage Completion", BsfGlobal.g_lUserId, 0, m_iCCId, 0, BsfGlobal.g_sCRMDBName);
                BsfGlobal.InsertLog(DateTime.Now, "Stage Completion-Add", "N", "Add Stage Completion", iStgId, m_iCCId, 0, BsfGlobal.g_sCRMDBName, "", BsfGlobal.g_lUserId);
            }
        }
Example #9
0
        private void barButtonItemOk_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (txtRefNo.Text.Trim() == "")
            {
                MessageBox.Show("Provide ReferenceNo", "PMS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                txtRefNo.Focus();
                return;
            }
            else if (Convert.ToInt32(cboProject.EditValue) == -1 || Convert.ToInt32(cboProject.EditValue) == 0)
            {
                MessageBox.Show("Select Project Type", "PMS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                cboProject.Focus();
                return;
            }
            else if (Convert.ToInt32(cboQuote.EditValue) == -1 || Convert.ToInt32(cboQuote.EditValue) == 0)
            {
                MessageBox.Show("Select Ref Quote Type", "PMS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                cboQuote.Focus();
                return;
            }
            else if (txtFlat.Text.Trim() == "")
            {
                MessageBox.Show("Provide Flat", "PMS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                txtFlat.Focus();
                return;
            }
            else if (txtBuyer.Text.Trim() == "")
            {
                MessageBox.Show("Provide Buyer", "PMS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                txtBuyer.Focus();
                return;
            }

            grdViewService.FocusedRowHandle = grdViewService.FocusedRowHandle + 1;
            if (grdViewService.RowCount <= 0)
            {
                MessageBox.Show("Blank Posting Zero", "ASSET", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return;
            }
            else
            {
                if (grdViewService.RowCount > 0)
                {
                    for (int t = 0; t < grdViewService.RowCount; t++)
                    {
                        decimal dQA = Convert.ToDecimal(CommFun.IsNullCheck(grdViewService.GetRowCellValue(t, "Amount").ToString(), CommFun.datatypes.vartypenumeric));
                        if (dQA == 0)
                        {
                            MessageBox.Show("Amount Check", "ASSET", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return;
                        }
                    }
                }
            }

            if (m_iRegBillId == 0)
            {
                if (oVType.GenType == true)
                {
                    oVType        = new BsfGlobal.VoucherType();
                    oVType        = BsfGlobal.GetVoucherNo(29, Convert.ToDateTime(dtpRefDate.EditValue), 0, 0);
                    txtRefNo.Text = oVType.VoucherNo;
                }
            }
            else
            {
                if (oVType.PeriodWise == true)
                {
                    oVType = new BsfGlobal.VoucherType();
                    if (BsfGlobal.CheckPeriodChange(m_dOldDate, Convert.ToDateTime(dtpRefDate.EditValue)) == true)
                    {
                        oVType = BsfGlobal.GetVoucherNo(29, Convert.ToDateTime(dtpRefDate.EditValue), 0, 0);
                    }
                }
            }

            if (m_iRegBillId == 0)
            {
                oSoBO = new ServiceOrderBillBO();
                ServiceOrderBillBO.RegBillId    = m_iRegBillId;
                ServiceOrderBillBO.Billdate     = String.Format("{0:dd-MMM-yyyy}", CommFun.IsNullCheck(dtpRefDate.EditValue, CommFun.datatypes.VarTypeDate));
                ServiceOrderBillBO.BillRefNo    = CommFun.IsNullCheck(txtRefNo.Text, CommFun.datatypes.vartypestring).ToString();
                ServiceOrderBillBO.CostcentreID = Convert.ToInt32(CommFun.IsNullCheck(cboProject.EditValue, CommFun.datatypes.vartypenumeric));
                ServiceOrderBillBO.FlatID       = Convert.ToInt32(CommFun.IsNullCheck(txtFlat.Tag, CommFun.datatypes.vartypenumeric));
                ServiceOrderBillBO.GrossAmt     = Convert.ToDecimal(CommFun.IsNullCheck(txtTotal.Text, CommFun.datatypes.vartypenumeric));
                ServiceOrderBillBO.QualifierAmt = Convert.ToDecimal(CommFun.IsNullCheck(txtQTotal.Text, CommFun.datatypes.vartypenumeric));
                ServiceOrderBillBO.NetAmt       = Convert.ToDecimal(CommFun.IsNullCheck(txtNAmt.Text, CommFun.datatypes.vartypenumeric));
                ServiceOrderBillBO.Narration    = CommFun.IsNullCheck(txtNarration.Text, CommFun.datatypes.vartypestring).ToString();
                ServiceOrderBillBO.QuoteRegId   = Convert.ToInt32(CommFun.IsNullCheck(cboQuote.EditValue, CommFun.datatypes.vartypenumeric));
                bSuccess = ServiceOrderBillBL.InsertSerOrderBill(m_dtComPList, QualTrans);
                //CommFun.InsertLog(DateTime.Now, "Service Order Details-Add", "N", "Service Order Details", BsfGlobal.g_lUserId, 0, m_iCCId, 0, BsfGlobal.g_sCRMDBName);
                BsfGlobal.UpdateMaxNo(29, oVType, 0, 0);
            }
            else
            {
                oSoBO = new ServiceOrderBillBO();
                ServiceOrderBillBO.RegBillId    = m_iRegBillId;
                ServiceOrderBillBO.Billdate     = String.Format("{0:dd-MMM-yyyy}", CommFun.IsNullCheck(dtpRefDate.EditValue, CommFun.datatypes.VarTypeDate));
                ServiceOrderBillBO.BillRefNo    = CommFun.IsNullCheck(txtRefNo.Text, CommFun.datatypes.vartypestring).ToString();
                ServiceOrderBillBO.CostcentreID = Convert.ToInt32(CommFun.IsNullCheck(cboProject.EditValue, CommFun.datatypes.vartypenumeric));
                ServiceOrderBillBO.FlatID       = Convert.ToInt32(CommFun.IsNullCheck(txtFlat.Tag, CommFun.datatypes.vartypenumeric));
                ServiceOrderBillBO.GrossAmt     = Convert.ToDecimal(CommFun.IsNullCheck(txtTotal.Text, CommFun.datatypes.vartypenumeric));
                ServiceOrderBillBO.QualifierAmt = Convert.ToDecimal(CommFun.IsNullCheck(txtQTotal.Text, CommFun.datatypes.vartypenumeric));
                ServiceOrderBillBO.NetAmt       = Convert.ToDecimal(CommFun.IsNullCheck(txtNAmt.Text, CommFun.datatypes.vartypenumeric));
                ServiceOrderBillBO.Narration    = CommFun.IsNullCheck(txtNarration.Text, CommFun.datatypes.vartypestring).ToString();
                ServiceOrderBillBO.QuoteRegId   = Convert.ToInt32(CommFun.IsNullCheck(cboQuote.EditValue, CommFun.datatypes.vartypenumeric));

                if (Convert.ToDateTime(ServiceOrderBillBO.Billdate) != Convert.ToDateTime(dtpRefDate.EditValue))
                {
                    oVType = new BsfGlobal.VoucherType();
                    if (oVType.PeriodWise == true)
                    {
                        if (BsfGlobal.CheckPeriodChange(Convert.ToDateTime(ServiceOrderBillBO.Billdate), Convert.ToDateTime(dtpRefDate.EditValue)) == true)
                        {
                            oVType        = BsfGlobal.GetVoucherNo(29, Convert.ToDateTime(dtpRefDate.EditValue), 0, 0);
                            txtRefNo.Text = oVType.VoucherNo;
                            BsfGlobal.UpdateMaxNo(29, oVType, 0, 0);
                        }
                    }
                }
                bSuccess = ServiceOrderBillBL.UpdateSerOrderBill(m_dtComPList, QualTrans);
                //CommFun.InsertLog(DateTime.Now, "Service Order Bill Details-Add", "N", "Add Service Order Bill Details", BsfGlobal.g_lUserId, 0, m_iCCId, 0, BsfGlobal.g_sCRMDBName);
            }
            if (bSuccess == true)
            {
                if (m_iRegBillId == 0)
                {
                    ClearEntries();
                }
                else
                {
                    //if (BsfGlobal.g_bWorkFlow == true)
                    //{
                    //    Close();
                    //    Cursor.Current = Cursors.WaitCursor;
                    //    frmServiceOrderBillReg frmProg = new frmServiceOrderBillReg();
                    //    frmProg.TopLevel = false;
                    //    frmProg.FormBorderStyle = FormBorderStyle.None;
                    //    frmProg.Dock = DockStyle.Fill;
                    //    frmServiceOrderBillReg.m_oDW.Show();
                    //    frmServiceOrderBillReg.t_panel.Controls.Clear();
                    //    frmServiceOrderBillReg.t_panel.Controls.Add(frmProg);
                    //    frmProg.Show();
                    //    Cursor.Current = Cursors.Default;
                    //}
                    //else
                    //{
                    //    Close();
                    //}
                    Close();
                }
            }
        }
Example #10
0
        private void cmdOK_Click(object sender, EventArgs e)
        {
            bool bChange = false;

            if (Validation() == true)
            {
                if (m_lRegisterId == 0)
                {
                    UpdateRegNo();
                }
                else
                {
                    if (m_dOldDate != Convert.ToDateTime(dtpDate.Value))
                    {
                        if (oVType.PeriodWise == true)
                        {
                            if (BsfGlobal.CheckPeriodChange(m_dOldDate, Convert.ToDateTime(dtpDate.Value)))
                            {
                                oVType        = new BsfGlobal.VoucherType();
                                oVType        = BsfGlobal.GetVoucherNo(17, Convert.ToDateTime(dtpDate.Value), 0, 0);
                                txtRegNo.Text = oVType.VoucherNo;
                                bChange       = true;
                            }
                        }
                    }
                }

                if (CheckRegNo() == true)
                {
                    m_oRegister.RegisterId = m_lRegisterId;
                    m_oRegister.RegDate    = dtpDate.Value;
                    m_oRegister.RegNo      = txtRegNo.Text;
                    m_oRegister.VendorId   = m_lVendorId;

                    m_oRegister.Supply   = chkSupply.Checked;
                    m_oRegister.SFDate   = dtpSFDate.Value;
                    m_oRegister.STDate   = dtpSTDate.Value;
                    m_oRegister.SLife    = chkSLife.Checked;
                    m_oRegister.SGradeId = Convert.ToInt32(txtSGradeName.Tag);

                    m_oRegister.Contract = chkContract.Checked;
                    m_oRegister.CFDate   = dtpCFDate.Value;
                    m_oRegister.CTDate   = dtpCTDate.Value;
                    m_oRegister.CLife    = chkCLife.Checked;
                    m_oRegister.CGradeId = Convert.ToInt32(txtCGradeName.Tag);


                    m_oRegister.Service  = chkService.Checked;
                    m_oRegister.HFDate   = dtpHFDate.Value;
                    m_oRegister.HTDate   = dtpHTDate.Value;
                    m_oRegister.HLife    = chkHLife.Checked;
                    m_oRegister.HGradeId = Convert.ToInt32(txtHGradeName.Tag);

                    m_oRegister.Remarks = txtRemarks.Text;

                    if (m_lRegisterId == 0)
                    {
                        m_oRegister.InsertRegistration(m_oRegister);
                        BsfGlobal.UpdateMaxNo(17, oVType, 0, 0);
                        BsfGlobal.InsertAlert("Vendor-Register", "" + txtVendorName.Text + " - Registered Successfully", 0, BsfGlobal.g_sVendorDBName);
                        PopulateData();
                        MessageBox.Show("Registered Successfully!", "Vendor", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        m_oRegister.UpdateRegistration(m_oRegister);
                        if (bChange == true)
                        {
                            BsfGlobal.UpdateMaxNo(17, oVType, 0, 0);
                        }
                        MessageBox.Show("Registration Updated Successfully!", "Vendor", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    m_oRegUpdate.UpdateRegistration(m_lVendorId);
                    //this.Close();
                }
            }
        }