private bool Validateform()
 {
     if (ObjUtil.IsControlTextEmpty(cmbSelectPC))   //(cmbSelectPC.SelectedIndex == -1)
     {
         clsUtility.ShowInfoMessage("Please Select PC.", clsUtility.strProjectTitle);
         cmbSelectPC.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(cmbStoreCategory))   //(cmbStoreCategory.SelectedIndex == -1)
     {
         clsUtility.ShowInfoMessage("Please Select Store Category.", clsUtility.strProjectTitle);
         cmbStoreCategory.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(cmbStoreName))    //(cmbStoreName.SelectedIndex == -1)
     {
         clsUtility.ShowInfoMessage("Please Select Store Name.", clsUtility.strProjectTitle);
         cmbStoreName.Focus();
         return(false);
     }
     else if (IsDataExist())
     {
         clsUtility.ShowInfoMessage("Machine name is already mapped to this Store.", clsUtility.strProjectTitle);
         cmbSelectPC.Focus();
         return(false);
     }
     return(true);
 }
Esempio n. 2
0
 private bool ValidateForm()
 {
     if (ObjUtil.IsControlTextEmpty(txtCustomerName))
     {
         clsUtility.ShowInfoMessage("Enter Customer Name       ", clsUtility.strProjectTitle);
         txtCustomerName.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtCustomerMobileNo))
     {
         clsUtility.ShowInfoMessage("Enter Customer Mobile No.      ", clsUtility.strProjectTitle);
         txtCustomerMobileNo.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtCustomerAddress))
     {
         clsUtility.ShowInfoMessage("Enter Customer Address.      ", clsUtility.strProjectTitle);
         txtCustomerAddress.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(cmbCustomerActiveStatus))
     {
         clsUtility.ShowInfoMessage("Select Active Status.", clsUtility.strProjectTitle);
         cmbCustomerActiveStatus.Focus();
         return(false);
     }
     return(true);
 }
Esempio n. 3
0
        private bool ValidateServerConenct()
        {
            if (ObjUtil.IsControlTextEmpty(txtServerName))
            {
                clsUtility.ShowErrorMessage("Please Enter Server Name.", clsUtility.strProjectTitle);
                txtServerName.Focus();
                return(false);
            }

            // if server auth is selected then check username and password.
            else if (ObjUtil.IsControlTextEmpty(txtUserID))
            {
                clsUtility.ShowErrorMessage("Please Enter User ID.", clsUtility.strProjectTitle);
                txtUserID.Focus();
                return(false);
            }

            else if (ObjUtil.IsControlTextEmpty(txtPassword))
            {
                clsUtility.ShowErrorMessage("Please Enter Password.", clsUtility.strProjectTitle);
                txtPassword.Focus();
                return(false);
            }
            return(true);
        }
Esempio n. 4
0
 private bool Validateform()
 {
     if (ObjUtil.IsControlTextEmpty(txtStoreName))
     {
         clsUtility.ShowInfoMessage("Enter Store Name           ", clsUtility.strProjectTitle);
         txtStoreName.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtPlace))
     {
         clsUtility.ShowInfoMessage("Enter Place for " + txtStoreName.Text + " Store", clsUtility.strProjectTitle);
         txtPlace.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(cmbStoreCat))
     {
         clsUtility.ShowInfoMessage("Select store category.", clsUtility.strProjectTitle);
         cmbStoreCat.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(cmbActiveStatus))
     {
         clsUtility.ShowInfoMessage("Select Active Status.", clsUtility.strProjectTitle);
         cmbActiveStatus.Focus();
         return(false);
     }
     return(true);
 }
 private bool Validateform()
 {
     if (ObjUtil.IsControlTextEmpty(txtSupplierName))
     {
         clsUtility.ShowInfoMessage("Enter Supplier Name           ", clsUtility.strProjectTitle);
         txtSupplierName.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(cmbCountry))
     {
         clsUtility.ShowInfoMessage("Select Country for " + txtSupplierName.Text, clsUtility.strProjectTitle);
         cmbCountry.Focus();
         return(false);
     }
     //else if (ObjUtil.IsControlTextEmpty(txtPhone))
     //{
     //    clsUtility.ShowInfoMessage("Enter Phone Number          ", clsUtility.strProjectTitle);
     //    txtPhone.Focus();
     //    return false;
     //}
     //else if (ObjUtil.IsControlTextEmpty(txtEmail))
     //{
     //    clsUtility.ShowInfoMessage("Enter E-Mail ID          ", clsUtility.strProjectTitle);
     //    txtEmail.Focus();
     //    return false;
     //}
     else if (ObjUtil.IsControlTextEmpty(cmbActiveStatus))
     {
         clsUtility.ShowInfoMessage("Select Active Status.", clsUtility.strProjectTitle);
         cmbActiveStatus.Focus();
         return(false);
     }
     return(true);
 }
Esempio n. 6
0
 private bool Validateform()
 {
     if (ObjUtil.IsControlTextEmpty(cmbAddRatio))
     {
         clsUtility.ShowInfoMessage("Please select Add Ratio to Suggested price.", clsUtility.strProjectTitle);
         cmbAddRatio.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtProductName))
     {
         clsUtility.ShowInfoMessage("Please Enter Product Name ", clsUtility.strProjectTitle);
         txtProductName.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtModelNo))
     {
         clsUtility.ShowInfoMessage("Please Model Number ", clsUtility.strProjectTitle);
         txtModelNo.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtQTY))
     {
         clsUtility.ShowInfoMessage("Please Enter Quantity ", clsUtility.strProjectTitle);
         txtQTY.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtRate))
     {
         clsUtility.ShowInfoMessage("Please Enter Rate ", clsUtility.strProjectTitle);
         txtRate.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(cmbBrand))
     {
         clsUtility.ShowInfoMessage("Please Select Brand Name ", clsUtility.strProjectTitle);
         cmbBrand.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtSalesPrice))
     {
         clsUtility.ShowInfoMessage("Please Enter Sales Price ", clsUtility.strProjectTitle);
         txtSalesPrice.Focus();
         return(false);
     }
     else if (Convert.ToInt32(txtQTY.Text) <= 0)
     {
         clsUtility.ShowInfoMessage("Please Enter Valid Quantity ", clsUtility.strProjectTitle);
         txtQTY.Focus();
         return(false);
     }
     else if (Convert.ToDouble(txtRate.Text) <= 0)
     {
         clsUtility.ShowInfoMessage("Please Enter Valid Rate ", clsUtility.strProjectTitle);
         txtRate.Focus();
         return(false);
     }
     return(true);
 }
Esempio n. 7
0
        private void AddMoreSize()
        {
            if (ObjUtil.IsControlTextEmpty(cmbSizeType))
            {
                clsUtility.ShowInfoMessage("Please Select Size Type   ", clsUtility.strProjectTitle);
                cmbSizeType.Focus();
                return;
            }
            else if (ObjUtil.IsControlTextEmpty(cmbActiveStatus))
            {
                clsUtility.ShowInfoMessage("Please Select Active Status for " + cmbSizeType.Text, clsUtility.strProjectTitle);
                cmbActiveStatus.Focus();
                return;
            }
            else if (ObjUtil.IsControlTextEmpty(txtSize))
            {
                clsUtility.ShowInfoMessage("Please enter Size for " + cmbSizeType.Text, clsUtility.strProjectTitle);
                txtSize.Focus();
                return;
            }
            else if (ObjUtil.IsNumeric(txtSize.Text))
            {
                if (Convert.ToInt32(txtSize.Text) == 0)
                {
                    clsUtility.ShowInfoMessage("Please enter Valid Size for " + cmbSizeType.Text, clsUtility.strProjectTitle);
                    txtSize.Focus();
                    return;
                }
                else if (listBox1.Items.Count > 0)
                {
                    for (int i = 0; i < listBox1.Items.Count; i++)
                    {
                        if (txtSize.Text == listBox1.Items[i].ToString())
                        {
                            clsUtility.ShowInfoMessage("Size is already entered for " + cmbSizeType.Text, clsUtility.strProjectTitle);
                            return;
                        }
                    }
                }
            }

            if (DuplicateColor(0))
            {
                listBox1.Items.Add(txtSize.Text);
                DataRow dRow = dtSize.NewRow();
                dRow["SizeTypeID"]   = cmbSizeType.SelectedValue;
                dRow["ActiveStatus"] = cmbActiveStatus.SelectedItem.ToString() == "Active" ? 1 : 0;
                dRow["Size"]         = txtSize.Text;
                dtSize.Rows.Add(dRow);
            }
        }
Esempio n. 8
0
 private void btnSearch_Click(object sender, EventArgs e)
 {
     if (ObjUtil.IsControlTextEmpty(cmbBranch))
     {
         clsUtility.ShowInfoMessage("Select Your Branch.", clsUtility.strProjectTitle);
         return;
     }
     if (ObjUtil.IsControlTextEmpty(cmbToStore))
     {
         clsUtility.ShowInfoMessage("Select Store.", clsUtility.strProjectTitle);
         return;
     }
     SearchBranchSalesShorting();
 }
Esempio n. 9
0
 private bool Validateform()
 {
     if (ObjUtil.IsControlTextEmpty(txtCashBand))
     {
         clsUtility.ShowInfoMessage("Enter Cash Band           ", clsUtility.strProjectTitle);
         txtCashBand.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(cmbActiveStatus))
     {
         clsUtility.ShowInfoMessage("Select Active Status.", clsUtility.strProjectTitle);
         cmbActiveStatus.Focus();
         return(false);
     }
     return(true);
 }
Esempio n. 10
0
        private void btnViewDetails_Click(object sender, EventArgs e)
        {
            if (ObjUtil.IsControlTextEmpty(txtSupplierBillNo))
            {
                clsUtility.ShowInfoMessage("Please Enter Bill Number.", clsUtility.strProjectTitle);
                txtSupplierBillNo.Focus();
                return;
            }
            dgvPurchaseItem.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.EnableResizing;
            //Most time consumption enum is DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders
            dgvPurchaseItem.RowHeadersVisible = false; // set it to false if not needed

            ObjDAL.SetStoreProcedureData("BillNo", SqlDbType.NVarChar, txtPurchaseInvoiceID.Text, clsConnection_DAL.ParamType.Input);
            DataSet ds = ObjDAL.ExecuteStoreProcedure_Get("sp_DetailPurchaseInvoiceReport");

            if (ObjUtil.ValidateDataSet(ds))
            {
                dgvPurchaseInvoice.DataSource = ds.Tables[0];
                if (ds.Tables.Count > 1)
                {
                    dgvPurchaseInvoiceDetail.DataSource = ds.Tables[1];
                }
                if (ds.Tables.Count > 2)
                {
                    dgvPurchaseItem.DataSource = ds.Tables[2];
                }
                dgvPurchaseInvoice.ClearSelection();
                dgvPurchaseInvoiceDetail.ClearSelection();
                dgvPurchaseItem.ClearSelection();
            }
        }
Esempio n. 11
0
 private bool ValidateClientSide()
 {
     if (objUtil.IsControlTextEmpty(txtUserName))
     {
         clsUtility.ShowErrorMessage("Enter User Name.          ", clsUtility.strProjectTitle);
         txtUserName.Focus();
         return(false);
     }
     else if (objUtil.IsControlTextEmpty(txtPassword))
     {
         clsUtility.ShowErrorMessage("Enter Password.          ", clsUtility.strProjectTitle);
         txtPassword.Focus();
         return(false);
     }
     return(true);
 }
Esempio n. 12
0
        private void txtCategoryName_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (isEdit)
                {
                    return;
                }
                if (ObjUtil.IsControlTextEmpty(txtName))
                {
                    txtUserID.Clear();
                    ObjUtil.CloseAutoExtender();
                    return;
                }
                DataTable dt = ObjCon.ExecuteSelectStatement("SELECT USERNAME,USERID FROM " + clsUtility.DBName + ".dbo.UserManagement WITH(NOLOCK) WHERE IsAdmin=0 AND UserName LIKE '" + txtName.Text + "%'");
                if (ObjUtil.ValidateTable(dt))
                {
                    ObjUtil.SetControlData(txtName, "USERNAME");
                    ObjUtil.SetControlData(txtUserID, "USERID");

                    ObjUtil.ShowDataPopup(dt, txtName, this, grpUserName);
                    if (ObjUtil.GetDataPopup() != null && ObjUtil.GetDataPopup().DataSource != null)
                    {
                        // if there is only one column
                        ObjUtil.GetDataPopup().AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
                        if (ObjUtil.GetDataPopup().ColumnCount > 0)
                        {
                            ObjUtil.GetDataPopup().Columns["UserID"].Visible = false;
                            ObjUtil.SetDataPopupSize(200, 0);
                        }
                    }
                    //ObjUtil.GetDataPopup().CellClick += Sales_Bill_Details_CellClick;
                    //ObjUtil.GetDataPopup().KeyDown += Sales_Bill_Details_KeyDown;
                }
                else
                {
                    txtUserID.Clear();
                    ObjUtil.CloseAutoExtender();
                }
            }
            catch (Exception)
            {
            }
        }
Esempio n. 13
0
 private bool Validateform()
 {
     if (ObjUtil.IsControlTextEmpty(txtPettyCash))
     {
         clsUtility.ShowInfoMessage("Enter Petty Cash       ", clsUtility.strProjectTitle);
         txtPettyCash.Focus();
         return(false);
     }
     return(true);
 }
Esempio n. 14
0
 private bool Validateform()
 {
     if (ObjUtil.IsControlTextEmpty(txtSupplierBillNo))
     {
         clsUtility.ShowInfoMessage("Enter Supplier Bill No           ", clsUtility.strProjectTitle);
         txtSupplierBillNo.Focus();
         return(false);
     }
     return(true);
 }
Esempio n. 15
0
 private void txtSearchByBarcode_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyData == Keys.Enter)
     {
         if (!ObjUtil.IsControlTextEmpty(txtSearchByBarcode))
         {
             SearchByBarcode();
         }
     }
 }
Esempio n. 16
0
        private string GenerateCondition()
        {
            string strCondition = "";

            if (ObjUtil.IsControlTextEmpty(txtInvoiceNumber))
            {
                strCondition = "InvoiceNumber='" + txtInvoiceNumber.Text + "' AND ";
            }

            if (ObjUtil.IsControlTextEmpty(txtEmpID))
            {
                strCondition += "SalesMan=" + txtEmpID.Text + " AND ";
            }

            if (ObjUtil.IsControlTextEmpty(cmbShop))
            {
                strCondition += "ShopeID=" + cmbShop.SelectedValue.ToString() + " AND ";
            }
            strCondition += "InvoiceDate between '" + dtpFromDate.Value.ToString("yyyy-MM-dd") + "' AND '" + dtpToDate.Value.ToString("yyyy-MM-dd") + "'";
            return(strCondition);
        }
Esempio n. 17
0
 private bool Validateform()
 {
     if (ObjUtil.IsControlTextEmpty(txtBrandName))
     {
         clsUtility.ShowInfoMessage("Enter Brand Name           ", clsUtility.strProjectTitle);
         txtBrandName.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(cmbSupplier))
     {
         clsUtility.ShowInfoMessage("Select Supplier for " + txtBrandName.Text, clsUtility.strProjectTitle);
         cmbSupplier.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(cmbActiveStatus))
     {
         clsUtility.ShowInfoMessage("Select Active Status.", clsUtility.strProjectTitle);
         cmbActiveStatus.Focus();
         return(false);
     }
     return(true);
 }
Esempio n. 18
0
 private bool Validateform()
 {
     if (ObjUtil.IsControlTextEmpty(txtCategoryName))
     {
         clsUtility.ShowInfoMessage("Enter Department Name           ", clsUtility.strProjectTitle);
         txtCategoryName.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtCategoryDescription))
     {
         clsUtility.ShowInfoMessage("Enter Department Description            ", clsUtility.strProjectTitle);
         txtCategoryDescription.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(cmbActiveStatus))
     {
         clsUtility.ShowInfoMessage("Select Active Status.", clsUtility.strProjectTitle);
         cmbActiveStatus.Focus();
         return(false);
     }
     return(true);
 }
Esempio n. 19
0
 private bool Validateform()
 {
     if (ObjUtil.IsControlTextEmpty(txtProductName))
     {
         clsUtility.ShowInfoMessage("Enter Product Name           ", clsUtility.strProjectTitle);
         txtProductName.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(cmbCategory))
     {
         clsUtility.ShowInfoMessage("Select Department for " + txtProductName.Text, clsUtility.strProjectTitle);
         cmbCategory.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(cmbActiveStatus))
     {
         clsUtility.ShowInfoMessage("Select Active Status.", clsUtility.strProjectTitle);
         cmbActiveStatus.Focus();
         return(false);
     }
     return(true);
 }
 private bool Validateform()
 {
     if (ObjUtil.IsControlTextEmpty(cmbCountry))
     {
         clsUtility.ShowInfoMessage("Select Country", clsUtility.strProjectTitle);
         cmbCountry.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtCurrencyRate))
     {
         clsUtility.ShowInfoMessage("Enter Currency Rate for " + cmbCountry.Text, clsUtility.strProjectTitle);
         txtCurrencyRate.Focus();
         return(false);
     }
     else if (Convert.ToDecimal(txtCurrencyRate.Text) <= 0)
     {
         clsUtility.ShowInfoMessage("Enter Valid Currency Rate for " + cmbCountry.Text, clsUtility.strProjectTitle);
         txtCurrencyRate.Focus();
         return(false);
     }
     return(true);
 }
Esempio n. 21
0
 private bool validateform()
 {
     if (ObjUtil.IsControlTextEmpty(cmbEntryType))
     {
         clsUtility.ShowInfoMessage("Please Select Entry Type for Post..", clsUtility.strProjectTitle);
         cmbEntryType.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtSupplierBillNo))
     {
         clsUtility.ShowInfoMessage("Please Enter Supplier Bill Number for Post..", clsUtility.strProjectTitle);
         txtSupplierBillNo.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtTotalQTY))
     {
         clsUtility.ShowInfoMessage("QTY is not available for Post..", clsUtility.strProjectTitle);
         txtTotalQTY.Focus();
         return(false);
     }
     return(true);
 }
Esempio n. 22
0
 private bool Validateform()
 {
     if (ObjUtil.IsControlTextEmpty(txtUserName))
     {
         clsUtility.ShowInfoMessage("Enter User Name            ", clsUtility.strProjectTitle);
         txtUserName.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtPassword))
     {
         clsUtility.ShowInfoMessage("Enter Password             ", clsUtility.strProjectTitle);
         txtPassword.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtVerifyPassword))
     {
         clsUtility.ShowInfoMessage("Enter Verify Password             ", clsUtility.strProjectTitle);
         txtVerifyPassword.Focus();
         return(false);
     }
     else if (txtPassword.Text.Trim() != txtVerifyPassword.Text.Trim())
     {
         clsUtility.ShowInfoMessage("Password and Verify Password must be Same       ", clsUtility.strProjectTitle);
         txtVerifyPassword.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtEmail))
     {
         clsUtility.ShowInfoMessage("Enter E-Mail Address            ", clsUtility.strProjectTitle);
         txtEmail.Focus();
         return(false);
     }
     else if (!ObjUtil.ValidateEmail(txtEmail.Text))
     {
         clsUtility.ShowInfoMessage("Enter Valid E-Mail Address.", clsUtility.strProjectTitle);
         txtEmail.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(cmbSecurity))
     {
         clsUtility.ShowInfoMessage("Select Security question for password retrival.", clsUtility.strProjectTitle);
         cmbSecurity.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtAsnwer))
     {
         clsUtility.ShowInfoMessage("Enter Security's question.", clsUtility.strProjectTitle);
         txtAsnwer.Focus();
         return(false);
     }
     else if (rdAdmin.Checked == false && rdLimitedUser.Checked == false)
     {
         clsUtility.ShowInfoMessage("Select Account Type      ", clsUtility.strProjectTitle);
         grpAccount.Focus();
         return(false);
     }
     return(true);
 }
 private void btnSearch_Click(object sender, EventArgs e)
 {
     if (ObjUtil.IsControlTextEmpty(txtSupplierBillNo))
     {
         clsUtility.ShowInfoMessage("Enter Supplier Bill No           ", clsUtility.strProjectTitle);
         txtSupplierBillNo.Focus();
         return;
     }
     dgvQtycolor.Enabled = false;
     cmbStore.Enabled    = true;
     LoadData();
 }
Esempio n. 24
0
 private bool Validateform()
 {
     if (ObjUtil.IsControlTextEmpty(txtSupplierBillNo))
     {
         clsUtility.ShowInfoMessage("Enter Supplier Bill No           ", clsUtility.strProjectTitle);
         txtSupplierBillNo.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtShipmentNo))
     {
         clsUtility.ShowInfoMessage("Enter Shipment No           ", clsUtility.strProjectTitle);
         txtShipmentNo.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(cmbSupplier))
     {
         clsUtility.ShowInfoMessage("Select Supplier for " + txtShipmentNo.Text, clsUtility.strProjectTitle);
         cmbSupplier.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtBillValue))
     {
         clsUtility.ShowInfoMessage("Enter Bill Value           ", clsUtility.strProjectTitle);
         txtBillValue.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtTotalQTY))
     {
         clsUtility.ShowInfoMessage("Enter Total Qty           ", clsUtility.strProjectTitle);
         txtTotalQTY.Focus();
         return(false);
     }
     else if (ObjUtil.IsControlTextEmpty(txtLocalValue))
     {
         clsUtility.ShowInfoMessage("Local Value can't be empty           ", clsUtility.strProjectTitle);
         return(false);
     }
     else if (ObjUtil.IsNumeric(txtLocalValue.Text) && Convert.ToDecimal(txtLocalValue.Text) == 0.0M)
     {
         clsUtility.ShowInfoMessage("Local Value can't be 0           ", clsUtility.strProjectTitle);
         return(false);
     }
     return(true);
 }
Esempio n. 25
0
 private bool Validation()
 {
     txtEncKey.Clear();
     if (Obj.IsControlTextEmpty(txtCustomerName))
     {
         clsUtility.ShowInfoMessage("Enter Customer Name   ", clsUtility.strProjectTitle);
         txtCustomerName.Focus();
         return(false);
     }
     else if (Obj.IsControlTextEmpty(txtProductName))
     {
         clsUtility.ShowInfoMessage("Enter Product Name   ", clsUtility.strProjectTitle);
         txtProductName.Focus();
         return(false);
     }
     else if (Obj.IsControlTextEmpty(txtOrganisation))
     {
         clsUtility.ShowInfoMessage("Enter Organisation Name   ", clsUtility.strProjectTitle);
         txtOrganisation.Focus();
         return(false);
     }
     else if (Obj.IsControlTextEmpty(txtMobileNo))
     {
         clsUtility.ShowInfoMessage("Enter Mobile Number   ", clsUtility.strProjectTitle);
         txtMobileNo.Focus();
         return(false);
     }
     else if (Obj.IsControlTextEmpty(txtEmail))
     {
         clsUtility.ShowInfoMessage("Enter Email Address             ", clsUtility.strProjectTitle);
         txtEmail.Focus();
         return(false);
     }
     else if (Obj.IsControlTextEmpty(txtAddress))
     {
         clsUtility.ShowInfoMessage("Enter Address   ", clsUtility.strProjectTitle);
         txtAddress.Focus();
         return(false);
     }
     else
     {
         if (Obj.ValidateEmail(txtEmail.Text))
         {
             if (txtMobileNo.Text.Trim().Length >= 10 && txtEmail.Text.Trim().Length >= 10)
             {
                 return(true);
             }
             else
             {
                 clsUtility.ShowErrorMessage("Enter Mobile Number or Email Address", clsUtility.strProjectTitle);
                 txtMobileNo.Focus();
                 return(false);
             }
         }
         else
         {
             clsUtility.ShowErrorMessage("Enter Valid Email Address ", clsUtility.strProjectTitle);
             txtEmail.Focus();
             return(false);
         }
     }
 }
Esempio n. 26
0
        private bool ValidateEmployee()
        {
            if (ObjUtil.IsControlTextEmpty(txtEmployeeCode))
            {
                clsUtility.ShowInfoMessage("Please Enter Employee Code.", clsUtility.strProjectTitle);
                txtEmployeeCode.Focus();
                return(false);
            }

            else if (ObjUtil.IsControlTextEmpty(txtName))
            {
                clsUtility.ShowInfoMessage("Please Enter Employee Name.", clsUtility.strProjectTitle);
                txtName.Focus();
                return(false);
            }

            else if (ObjUtil.IsControlTextEmpty(txtMobileNo))
            {
                clsUtility.ShowInfoMessage("Please Enter Employee Mobile No.", clsUtility.strProjectTitle);
                txtMobileNo.Focus();
                return(false);
            }

            else if (radFemale.Checked == false && radMale.Checked == false)
            {
                clsUtility.ShowInfoMessage("Please Select Gender.", clsUtility.strProjectTitle);
                radMale.Focus();
                radMale.Checked   = false;
                radFemale.Checked = false;


                return(false);
            }

            int result = ObjDAL.ExecuteScalarInt("SELECT COUNT(1) FROM " + clsUtility.DBName + ".dbo.EmployeeDetails WITH(NOLOCK) WHERE EmployeeCode='" + txtEmployeeCode.Text + "' AND EMPID<>" + EmployeeID);

            if (result > 0)
            {
                clsUtility.ShowInfoMessage("The Employee already exist with the given employee code. Please Enter different employee code.", clsUtility.strProjectTitle);
                txtEmployeeCode.Focus();
                return(false);
            }

            if (txtUsername.Text.Trim().Length > 0) // if user name is entered
            {
                if (ObjUtil.IsControlTextEmpty(txtPass))
                {
                    clsUtility.ShowInfoMessage("Please Enter Password.", clsUtility.strProjectTitle);
                    txtPass.Focus();
                    return(false);
                }

                int countuser = ObjDAL.ExecuteScalarInt("SELECT COUNT(1) FROM " + clsUtility.DBName + ".dbo.UserManagement WITH(NOLOCK) WHERE UserName='******' AND EmployeeID<>" + EmployeeID);
                if (countuser > 0)
                {
                    clsUtility.ShowInfoMessage("The user name already exist.Please enter different user name.", clsUtility.strProjectTitle);
                    txtUsername.Focus();
                    return(false);
                }
            }
            return(true);
        }
Esempio n. 27
0
        private bool FormValidation()
        {
            string ValidatingEmailID = txtEmail.Text.Trim();

            if (ObjUtil.IsControlTextEmpty(txtUserName))
            {
                clsUtility.ShowInfoMessage("Enter UserName.", clsUtility.strProjectTitle);
                txtUserName.Focus();
                return(false);
            }

            else if (ObjUtil.IsControlTextEmpty(txtEmail))
            {
                clsUtility.ShowInfoMessage("Enter E-Mail Address.", clsUtility.strProjectTitle);
                txtEmail.Focus();
                return(false);
            }
            else if (!ObjUtil.ValidateEmail(ValidatingEmailID))
            {
                clsUtility.ShowInfoMessage("Enter Valid E-Mail Address.", clsUtility.strProjectTitle);
                txtEmail.Focus();
                return(false);
            }
            else if (ObjUtil.IsControlTextEmpty(cmbSecurity))
            {
                clsUtility.ShowInfoMessage("Select Security question for password retrival.", clsUtility.strProjectTitle);
                cmbSecurity.Focus();
                return(false);
            }
            else if (ObjUtil.IsControlTextEmpty(txtAsnwer))
            {
                clsUtility.ShowInfoMessage("Enter Security's question.", clsUtility.strProjectTitle);
                txtAsnwer.Focus();
                return(false);
            }
            else
            {
                dt = ObjDAL.GetDataCol(clsUtility.DBName + ".dbo.UserManagement", "[UserName],[SecurityQuestion],[Answer],[Password],EmailID", "UserName='******'", null);
                if (ObjUtil.ValidateTable(dt))
                {
                    string SecurityQuestion, Answer, Password, EmailID;

                    SecurityQuestion = dt.Rows[0]["SecurityQuestion"].ToString();
                    Answer           = ObjUtil.Decrypt(dt.Rows[0]["Answer"].ToString(), true);
                    Password         = dt.Rows[0]["Password"].ToString();
                    EmailID          = dt.Rows[0]["EmailID"].ToString();

                    if (SecurityQuestion == cmbSecurity.SelectedItem.ToString() && Answer.ToLower() == txtAsnwer.Text.ToLower() && EmailID.ToLower() == txtEmail.Text.ToLower())
                    {
                        txtRetrivePassword.Text = ObjUtil.Decrypt(Password, true);
                    }
                    else
                    {
                        clsUtility.ShowInfoMessage("Entered details is not matching.", clsUtility.strProjectTitle);
                        return(false);
                    }
                }
                else
                {
                    clsUtility.ShowInfoMessage("Entered UserName or EmailID is not exist.", clsUtility.strProjectTitle);
                    return(false);
                }
                return(true);
            }
        }