예제 #1
0
        private void BindingData(Models.RQ_Customer _rqObj)
        {
            try
            {
                DAL_Customers _objDAL = new DAL_Customers();

                var lstData = _objDAL.GetCustomers(_rqObj);

                DataGridViewButtonColumn bcol = new DataGridViewButtonColumn();
                bcol.HeaderText = " ";
                bcol.Text       = "Edit";
                bcol.Name       = "btnClickMe";
                bcol.UseColumnTextForButtonValue = true;
                gdvwCustomers.Columns.Add(bcol);

                DataGridViewButtonColumn dcol = new DataGridViewButtonColumn();
                dcol.HeaderText = " ";
                dcol.Text       = "Delete";
                dcol.Name       = "btnClickMe";
                dcol.UseColumnTextForButtonValue = true;
                gdvwCustomers.Columns.Add(dcol);

                rSCustomersBindingSource.DataSource = lstData;

                //gdvwCustomers.DataSource = lstData;
                //gdvwCustomers.DataBindings();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #2
0
        private void BindCustomers()
        {
            try
            {
                _dalCustomers = new DAL_Customers();
                var result = _dalCustomers.GetM_CustomersDDL();
                result.Insert(0, new Models.M_Customers_DDL_RS()
                {
                    CustID = 0, CustName = " "
                });
                if (result != null && result.Count > 0)
                {
                    cmbCustomers.DataSource    = result;
                    cmbCustomers.DisplayMember = "CustName";
                    cmbCustomers.ValueMember   = "CustID";
                }
                cmbCustomers.SelectedIndex = 0;

                //Set AutoCompleteMode.
                cmbCustomers.AutoCompleteMode   = AutoCompleteMode.Suggest;
                cmbCustomers.AutoCompleteSource = AutoCompleteSource.ListItems;
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #3
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            DAL_Customers _objDAL = new DAL_Customers();

            Models.Customers customers = _objDAL.UpdateCustomer(new Models.Customers()
            {
                Address = txtAddress.Text,
                //txtBSTNo.Text ,
                CustomerName  = txtCompanyName.Text,
                ContactPerson = txtContactPerson.Text,
                //txtCSTNo.Text ,
                //txtEmail.Text ,
                //txtFYF.Text ,
                //txtFYT.Text ,
                MobileNo = txtMobile.Text,
                Id       = Convert.ToInt32(lblID.Text)
                           //txtPhone.Text ,
            });
            if (customers != null && !string.IsNullOrWhiteSpace(customers.MessageText))
            {
                lblStatus.Visible = true;
                lblStatus.Text    = customers.MessageText;
                if (customers.Code == Models.MessageCode.Success)
                {
                    // ClearControl();
                }
            }
            else
            {
                lblStatus.Visible = false;
            }
        }
예제 #4
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         if (!string.IsNullOrWhiteSpace(txtBoxCustomersName.Text))
         {
             dAL_Customers = new DAL_Customers();
             dAL_Customers.AddUpdateCustomers(new Models.M_Customers()
             {
                 CreatedBy    = CommonConstants.CreatedBy,
                 CreatedOn    = DateTime.Now,
                 CustAddress  = txtBoxCustomerAddress.Text,
                 CustID       = Convert.ToInt32(!string.IsNullOrWhiteSpace(lblCustomerID.Text) ? lblCustomerID.Text : "0"),
                 CustMobile   = txtBoxCustomerMobile.Text,
                 IsActive     = true,
                 CustName     = txtBoxCustomersName.Text,
                 CustomerType = Convert.ToString(cmbCustomerType.SelectedValue),
                 EmailID      = Convert.ToString(txtEmail.Text)
             });
             BindCustomerData();
             ClearControls();
         }
         else
         {
             CommonConstants.ShowMessageBox("Please enter customer name !!", "Warning", MessageBoxIcon.Warning);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #5
0
 private void BindCustomerData()
 {
     try
     {
         dAL_Customers            = new DAL_Customers();
         dgvwCustomers.DataSource = dAL_Customers.GetCustomers(new Models.M_Customers_RQ()
         {
         });
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #6
0
 private void dgvwCustomers_SelectionChanged(object sender, EventArgs e)
 {
     if (dgvwCustomers.Focused)
     {
         DataGridViewRow dr = dgvwCustomers.CurrentRow;
         if (dr != null && dr.Index != -1)
         {
             dAL_Customers = new DAL_Customers();
             Int32 intCust      = Convert.ToInt32(dr.Cells[0].Value);
             var   lstcustomers = dAL_Customers.GetCustomers(new M_Customers_RQ()
             {
                 CustID = intCust
             });
             if (lstcustomers.Count > 0)
             {
                 FillFormForEdit(lstcustomers[0]);
             }
         }
     }
 }
예제 #7
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            try
            {
                DAL_Customers _objDAL = new DAL_Customers();

                Models.Customers customers = _objDAL.CreateCust(new Models.Customers()
                {
                    Address = txtAddress.Text,
                    //txtBSTNo.Text ,
                    CustomerName  = txtCompanyName.Text,
                    ContactPerson = txtContactPerson.Text,
                    //txtCSTNo.Text ,
                    //txtEmail.Text ,
                    //txtFYF.Text ,
                    //txtFYT.Text ,
                    MobileNo = txtMobile.Text,
                    //txtPhone.Text ,
                    CreatedBy = "System",
                    CreatedOn = DateTime.Today
                });
                if (customers != null && !string.IsNullOrWhiteSpace(customers.MessageText))
                {
                    lblStatus.Visible = true;
                    lblStatus.Text    = customers.MessageText;
                    if (customers.Code == Models.MessageCode.Success)
                    {
                        ClearControl();
                    }
                }
                else
                {
                    lblStatus.Visible = false;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #8
0
        private void FillDetails(int custid)
        {
            DAL_Customers dAL_Customers = new DAL_Customers();
            var           result        = dAL_Customers.GetCustomersById(new Models.RQ_Customer()
            {
                CustId = custid
            });

            if (result != null && result.CustomerName != string.Empty)
            {
                txtAddress.Text      = result.Address;
                lblCustomerCode.Text = "(" + result.CustomerCode + ")";
                // txtBSTNo.Text =
                txtCompanyName.Text   = result.CustomerName;
                txtContactPerson.Text = result.ContactPerson;
                //txtCSTNo.Text
                //txtEmail.Text = result.em
                txtMobile.Text = result.MobileNo;
                //txtPhone.Text =result.p
                lblID.Text = Convert.ToString(result.Id);
            }
        }
예제 #9
0
        public long SaveCustomerProductMapping(CustomerProductMapping customerProductMapping)
        {
            DAL_Customers dL_Customers = new DAL_Customers();

            return(dL_Customers.SaveCustomerProductMapping(customerProductMapping));
        }
예제 #10
0
        public long CreateNewCustomer(Customer customer)
        {
            DAL_Customers dL_Customers = new DAL_Customers();

            return(dL_Customers.CreateNewCustomer(customer));
        }
예제 #11
0
        public bool CheckIfCustomerExistByName(string name, out long customerID)
        {
            DAL_Customers dL_Customers = new DAL_Customers();

            return(dL_Customers.CheckIfCustomerExistByName(name, out customerID));
        }
예제 #12
0
        public bool CheckIfCustomerExistByPAN(string pan, out long customerID)
        {
            DAL_Customers dL_Customers = new DAL_Customers();

            return(dL_Customers.CheckIfCustomerExistByPAN(pan, out customerID));
        }
예제 #13
0
        public bool CheckIfCustomerExistByGSTIN(string gSTIN, out Int64 customerID)
        {
            DAL_Customers dL_Customers = new DAL_Customers();

            return(dL_Customers.CheckIfCustomerExistByGSTIN(gSTIN, out customerID));
        }
예제 #14
0
        public List <Customer> GetAllCustomers()
        {
            DAL_Customers dL_Customers = new DAL_Customers();

            return(dL_Customers.GetAllProductList());
        }