コード例 #1
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (gvCustomerData.SelectedRows.Count == 0)
            {
                "Please Select Details Your Want To Edit.".ShowError();
                return;
            }
            int id       = gvCustomerData.SelectedRows[0].Cells[gvcId.Name].GetString().ToInt();
            var custData = CustomerImplementation.FindById(id);

            /* var custData = new Customer {
             *   Id = 12,
             *   JoiningDate = DateTime.Now,
             *   CustomerName = "abc company",
             *   ContactPerson = "Sagar",
             *   ContactNumber = "9700 5800 12",
             *   Address = "amber talkist",
             *   Email = "*****@*****.**",
             *   OutstadningBalance = 2000.75,
             *   Remarks = "Here Some Remarks"
             * };*/

            frmCustomer_New form = new frmCustomer_New(custData);

            form.ShowDialog();

            FillGrid();
        }
コード例 #2
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (gvCustomerData.SelectedRows.Count == 0)
            {
                "Please Select Details Your Want To Delete.".ShowError();
                return;
            }

            if ("Are You Sure You Want To Delete This Information ?".ConfirmDialouge() == false)
            {
                return;
            }

            int id     = gvCustomerData.SelectedRows[0].Cells[gvcId.Name].GetString().ToInt();
            var result = CustomerImplementation.DeleteById(id);

            if (result == false)
            {
                "Failed To Delete Information.".ShowError();
                return;
            }

            FillGrid();
            "Details Deleted Successfully.".ShowInformation();
        }
コード例 #3
0
        public void setAutoSuggestControl()
        {
            txtCustomerName.SuggestCustomSource(CustomerImplementation.Suggest_CustomerName());
            txtContactNo.SuggestCustomSource(CustomerImplementation.Suggest_ContactNumber());

            cmbGstType.DataSource = Enum.GetValues(typeof(GstType));
        }
コード例 #4
0
        private void txtCustomerName_Leave(object sender, EventArgs e)
        {
            if (txtCustomerName.GetStringLength() == 0)
            {
                return;
            }

            var custData = CustomerImplementation.FindByCustomerName(txtCustomerName.GetString(), customer.Id);

            if (custData != null)
            {
                "Duplicate Customer Name".ShowError();
                txtCustomerName.Text = "";
                txtCustomerName.Focus();
                return;
            }
        }
コード例 #5
0
        private void txtCustomerName_Leave(object sender, EventArgs e)
        {
            invoiceData.CustomerData   = null;
            invoiceData.CustomerDataId = 0;
            if (txtCustomerName.GetStringLength() == 0)
            {
                return;
            }

            invoiceData.CustomerData = CustomerImplementation.FindByCustomerName(txtCustomerName.GetString());
            if (invoiceData.CustomerData == null)
            {
                "Please Enter Valid Customer Name.".ShowError();
                return;
            }
            invoiceData.CustomerDataId = invoiceData.CustomerData.Id;
            txtCustomerName.Text       = invoiceData.CustomerName;
            txtContactNo.Text          = invoiceData.CustomerData.ContactNumber;
        }
コード例 #6
0
 public void AutoSuggestData()
 {
     txtCustomerName.SuggestCustomSource(CustomerImplementation.Suggest_CustomerName());
     txtContactPerson.SuggestCustomSource(CustomerImplementation.Suggest_ContactPerson());
 }