Exemplo n.º 1
0
 private void txtBankAccNo_KeyPress(object sender, KeyPressEventArgs e)
 {
     e.Handled = ObjUtil.IsNumeric(e);
     if (e.Handled == true)
     {
         clsUtility.ShowInfoMessage("Enter Only Number...", clsUtility.strProjectTitle);
     }
 }
Exemplo n.º 2
0
 private void txtSearchByMobileNo_KeyPress(object sender, KeyPressEventArgs e)
 {
     e.Handled = ObjUtil.IsNumeric(e);
     if (e.Handled == true)
     {
         clsUtility.ShowInfoMessage("Enter Only Charactors...", clsUtility.strProjectTitle);
         txtCustomerName.Focus();
     }
 }
Exemplo n.º 3
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);
 }
Exemplo n.º 4
0
        private void txtMobileNo_KeyPress(object sender, KeyPressEventArgs e)
        {
            TextBox txt = (TextBox)sender;

            e.Handled = ObjUtil.IsNumeric(e);
            if (e.Handled == true)
            {
                clsUtility.ShowInfoMessage("Enter Only Number...", clsUtility.strProjectTitle);
                txt.Focus();
            }
        }
Exemplo n.º 5
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);
            }
        }
Exemplo n.º 6
0
 private void txtMobileNo_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (Objutil.IsNumeric(e) == false)
     {
         e.Handled = false;
     }
     else
     {
         if (e.KeyChar != 47)
         {
             clsUtility.ShowErrorMessage("Enter Only Numbers ", clsUtility.strProjectTitle);
         }
         if (e.KeyChar == 47 && txtMobileNo.TextLength == 10 || txtMobileNo.TextLength == 21 || txtMobileNo.TextLength == 32 || txtMobileNo.TextLength == 43)
         {
             e.Handled = false;
         }
         else
         {
             e.Handled = true;
         }
     }
 }
Exemplo n.º 7
0
        private void txtProductName_TextChanged(object sender, EventArgs e)
        {
            if (cboEntryMode.SelectedIndex == 1) // if manual entry
            {
                if (txtProductName.Text.Trim().Length == 0)
                {
                    return;
                }

                try
                {
                    string strQ = "EXEC " + clsUtility.DBName + ".dbo.GetProductDetailsByProductName " + cmbShop.SelectedValue.ToString() + ", '" + txtProductName.Text + "'";


                    DataTable dt = ObjDAL.ExecuteSelectStatement(strQ);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        ObjUtil.SetControlData(txtProductName, "ProductName");
                        ObjUtil.SetControlData(txtProductID, "ProductID");

                        ObjUtil.SetControlData(txtColorID, "ColorID");
                        ObjUtil.SetControlData(txtSizeID, "SizeID");

                        ObjUtil.ShowDataPopup(dt, txtProductName, this, this);

                        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["ProductID"].Visible = false;

                                ObjUtil.GetDataPopup().Columns["ColorID"].Visible      = false;
                                ObjUtil.GetDataPopup().Columns["QTY"].Visible          = false;
                                ObjUtil.GetDataPopup().Columns["SizeID"].Visible       = false;
                                ObjUtil.GetDataPopup().Columns["ColorName"].HeaderText = "Color";

                                ObjUtil.SetDataPopupSize(450, 0);
                            }
                        }
                        ObjUtil.GetDataPopup().CellClick += Sales_Invoice_CellClick;
                        ObjUtil.GetDataPopup().KeyDown   += Sales_Invoice_KeyDown;
                    }
                    else
                    {
                        ObjUtil.CloseAutoExtender();
                    }
                }
                catch (Exception)
                {
                }
            }
            else
            {
                if (txtProductName.Text.Trim().Length != 0 && !ObjUtil.IsNumeric(txtProductName.Text))
                {
                    clsUtility.ShowInfoMessage("Invalid BarCode Entry. Please check the Product Code.", clsUtility.strProjectTitle);
                }
            }
        }