Ejemplo n.º 1
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     btnSave.Enabled = true;
     try
     {
         using (security_modulesEntities db = new security_modulesEntities())
         {
             ad_Bank.AccountNumber    = txtboxAccountNumber.Text.Trim();
             ad_Bank.BankName         = txtboxBankName.Text.Trim();
             ad_Bank.ModificationDate = DateTime.Now;
             ad_Bank.ModifierId       = 1;
             if (rdoIsActiveYes.Checked == true)
             {
                 ad_Bank.IsActive = true;
             }
             else
             {
                 ad_Bank.IsActive = false;
             }
             if (ad_Bank.Id > 0)
             {
                 db.Entry(ad_Bank).State = EntityState.Modified;
                 db.SaveChanges();
             }
         }
         LoadDate();
         MessageBox.Show("Data Updated Successfuly");
         Clear();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         using (security_modulesEntities db = new security_modulesEntities())
         {
             ad_MeasurementUnit.Description      = txtboxDescription.Text.Trim();
             ad_MeasurementUnit.CreationDate     = DateTime.Now;
             ad_MeasurementUnit.CreatorId        = 1;
             ad_MeasurementUnit.ModificationDate = DateTime.Now;
             ad_MeasurementUnit.ModifierId       = 1;
             if (rdoIsActiveYes.Checked == true)
             {
                 ad_MeasurementUnit.IsActive = true;
             }
             else
             {
                 ad_MeasurementUnit.IsActive = false;
             }
             if (ad_MeasurementUnit.Id == 0)
             {
                 db.AD_MeasurementUnit.Add(ad_MeasurementUnit);
                 db.SaveChanges();
             }
             LoadDate();
             MessageBox.Show("Data Save Successfuly");
             Clear();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 3
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         using (security_modulesEntities db = new security_modulesEntities())
         {
             ad_ProductGroup.ProductGroup     = txtboxProductGroup.Text.Trim();
             ad_ProductGroup.ValuationTypeId  = (int)cmbValuationType.SelectedValue;
             ad_ProductGroup.CreationDate     = DateTime.Now;
             ad_ProductGroup.CreatorId        = 1;
             ad_ProductGroup.ModificationDate = DateTime.Now;
             ad_ProductGroup.ModifierId       = 1;
             if (rdoIsActiveYes.Checked == true)
             {
                 ad_ProductGroup.IsActive = true;
             }
             else
             {
                 ad_ProductGroup.IsActive = false;
             }
             if (ad_ProductGroup.Id == 0)
             {
                 db.AD_ProductGroup.Add(ad_ProductGroup);
                 db.SaveChanges();
             }
             LoadDate();
             MessageBox.Show("Data Save Successfuly");
             Clear();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 4
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     btnSave.Enabled = true;
     using (security_modulesEntities db = new security_modulesEntities())
     {
         ad_BusinessType.BusinessType     = txtboxBusinessType.Text.Trim();
         ad_BusinessType.ModificationDate = DateTime.Now;
         ad_BusinessType.ModifierId       = 1;
         if (rdoIsActiveYes.Checked == true)
         {
             ad_BusinessType.IsActive = true;
         }
         else
         {
             ad_BusinessType.IsActive = false;
         }
         if (ad_BusinessType.Id > 0)
         {
             db.Entry(ad_BusinessType).State = EntityState.Modified;
             db.SaveChanges();
         }
     }
     LoadDate();
     MessageBox.Show("Data Updated Successfuly");
     Clear();
 }
Ejemplo n.º 5
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         using (security_modulesEntities db = new security_modulesEntities())
         {
             aD_Product.Description     = txtboxDescription.Text.Trim();
             aD_Product.ProductGroup    = (int)cmbGroup.SelectedValue;
             aD_Product.ProductType     = (int)cmbProductType.SelectedValue;
             aD_Product.MeasurementUnit = (int)cmbUnit.SelectedValue;
             aD_Product.ExpieryDate     = dateTimePicker.Value.Date;
             aD_Product.Rate            = Convert.ToDecimal(txtboxRate.Text.Trim());
             aD_Product.ROL             = Convert.ToDecimal(txtboxROI.Text.Trim());
             aD_Product.SD               = Convert.ToDecimal(txtboxSD.Text.Trim());
             aD_Product.VAT              = Convert.ToDecimal(txtboxVAT.Text.Trim());
             aD_Product.CreationDate     = DateTime.Now;
             aD_Product.CreatorId        = 1;
             aD_Product.ModificationDate = DateTime.Now;
             aD_Product.ModifierId       = 1;
             if (aD_Product.Id == 0)
             {
                 db.AD_Product.Add(aD_Product);
                 db.SaveChanges();
             }
             LoadDate();
             MessageBox.Show("Data Save Successfuly");
             Clear();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public void LoadDate()
 {
     Clear();
     try
     {
         dataGridView.AutoGenerateColumns = false;
         using (security_modulesEntities db = new security_modulesEntities())
         {
             var data = (from CP in db.AD_OpeningBalanceCustomer
                         join BN in db.AD_Customer
                         on CP.CustomerId equals BN.Id
                         select new
             {
                 Id = CP.Id,
                 CustomerId = CP.CustomerId,
                 CustomerName = BN.CustomerName,
                 OpeningBalance = CP.OpeningBalance,
                 OpeningDate = CP.OpeningDate
             }).ToList();
             dataGridView.DataSource = data;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 7
0
 private void btnSaveCodeIntegration_Click(object sender, EventArgs e)
 {
     try
     {
         using (security_modulesEntities db = new security_modulesEntities())
         {
             aD_ProductCodeIntegration.ProductId    = (int)cmbProductCode.SelectedValue;
             aD_ProductCodeIntegration.HSCode       = txtboxHScode.Text.Trim();
             aD_ProductCodeIntegration.ProductCode  = txtboxHScode.Text.Trim();
             aD_ProductCodeIntegration.AccountsCode = txtboxAccountCode.Text.Trim();
             aD_ProductCodeIntegration.Barcode      = Encoding.UTF8.GetBytes(txtboxBarCode.Text.Trim());
             if (aD_ProductCodeIntegration.Id == 0)
             {
                 db.AD_ProductCodeIntegration.Add(aD_ProductCodeIntegration);
                 db.SaveChanges();
             }
             LoadDate();
             MessageBox.Show("Data Save Successfuly");
             Clear();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 8
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                using (security_modulesEntities db = new security_modulesEntities())
                {
                    ad_CompanyProfile.AddressLine1        = txtboxAddressLine1.Text.Trim();
                    ad_CompanyProfile.AddressLine2        = txtboxAddressLine2.Text.Trim();
                    ad_CompanyProfile.BIN                 = txtboxBIN.Text.Trim();
                    ad_CompanyProfile.TIN                 = txtboxBIN.Text.Trim();
                    ad_CompanyProfile.CompanyName         = txtboxCompanyName.Text.Trim();
                    ad_CompanyProfile.ContactPersion      = txtboxContactPersion.Text.Trim();
                    ad_CompanyProfile.IncorporationNumber = txtboxIncorporationNumber.Text.Trim();
                    ad_CompanyProfile.Phone               = txtboxPhone.Text.Trim();
                    ad_CompanyProfile.Remarks             = txtboxRemarks.Text.Trim();
                    ad_CompanyProfile.BusinessNatureId    = (int)cmbBusinessNatureId.SelectedValue;
                    ad_CompanyProfile.BusinessTypeId      = (int)cmbBusinessTypeId.SelectedValue;
                    ad_CompanyProfile.ModificationDate    = DateTime.Now;
                    ad_CompanyProfile.ModifierId          = 1;
                    if (ad_CompanyProfile.Id > 0)
                    {
                        db.Entry(ad_CompanyProfile).State = EntityState.Modified;
                        db.SaveChanges();
                    }

                    LoadDate();
                    MessageBox.Show("Data Updated Successfuly");
                    Clear();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 9
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     btnSave.Enabled = true;
     try
     {
         using (security_modulesEntities db = new security_modulesEntities())
         {
             ad_PaymentMethod.PaymentType      = txtboxPaymentType.Text.Trim();
             ad_PaymentMethod.MethodTypeId     = (int)cmbMethodType.SelectedValue;
             ad_PaymentMethod.ModificationDate = DateTime.Now;
             ad_PaymentMethod.ModifierId       = 1;
             if (rdoIsActiveYes.Checked == true)
             {
                 ad_PaymentMethod.IsActive = true;
             }
             else
             {
                 ad_PaymentMethod.IsActive = false;
             }
             if (ad_PaymentMethod.Id > 0)
             {
                 db.Entry(ad_PaymentMethod).State = EntityState.Modified;
                 db.SaveChanges();
             }
         }
         LoadDate();
         MessageBox.Show("Data Updated Successfuly");
         Clear();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 10
0
        private void dataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (dataGridView.CurrentRow.Index != -1)
                {
                    ad_MeasurementUnit.Id = Convert.ToInt32(dataGridView.CurrentRow.Cells["Id"].Value);
                    using (security_modulesEntities db = new security_modulesEntities())
                    {
                        ad_MeasurementUnit     = db.AD_MeasurementUnit.Where(x => x.Id == ad_MeasurementUnit.Id).FirstOrDefault();
                        txtboxDescription.Text = ad_MeasurementUnit.Description;
                        if (ad_MeasurementUnit.IsActive == true)
                        {
                            rdoIsActiveYes.Checked = true;
                        }
                        else
                        {
                            rdoIsActiveNo.Checked = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            btnSave.Enabled = false;
        }
Ejemplo n.º 11
0
 public void LoadDate()
 {
     Clear();
     try
     {
         dataGridView.AutoGenerateColumns = false;
         using (security_modulesEntities db = new security_modulesEntities())
         {
             var data = (from CP in db.AD_OpeningBalanceCompany
                         join BN in db.AD_PaymentMethod
                         on CP.PaymentMethordId equals BN.Id
                         select new
             {
                 Id = CP.Id,
                 PaymentTypeId = CP.PaymentMethordId,
                 PaymentType = BN.PaymentType,
                 OpeningBalance = CP.OpeningBalance,
                 OpeningDate = CP.OpeningDate
             }).ToList();
             dataGridView.DataSource = data;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 12
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                using (security_modulesEntities db = new security_modulesEntities())
                {
                    ad_HSCode.AIT         = Convert.ToDecimal(txtboxAIT.Text.Trim());
                    ad_HSCode.AT          = Convert.ToDecimal(txtboxAT.Text.Trim());
                    ad_HSCode.CD          = Convert.ToDecimal(txtboxCD.Text.Trim());
                    ad_HSCode.Description = txtboxDescription.Text.Trim();
                    ad_HSCode.HSCode      = txtboxHSCode.Text.Trim();
                    ad_HSCode.RD          = Convert.ToDecimal(txtboxRD.Text.Trim());
                    ad_HSCode.SD          = Convert.ToDecimal(txtboxSD.Text.Trim());
                    ad_HSCode.TTL         = Convert.ToDecimal(txtboxTTL.Text.Trim());
                    ad_HSCode.VAT         = Convert.ToDecimal(txtboxVAT.Text.Trim());

                    if (ad_HSCode.Id == 0)
                    {
                        db.AD_HSCode.Add(ad_HSCode);
                        db.SaveChanges();
                    }
                    LoadDate();
                    MessageBox.Show("Data Save Successfuly");
                    Clear();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 13
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     btnSave.Enabled = true;
     try
     {
         using (security_modulesEntities db = new security_modulesEntities())
         {
             aD_OpeningBalanceCompany.OpeningBalance   = txtboxOpeningBalance.Text.Trim();
             aD_OpeningBalanceCompany.PaymentMethordId = (int)cmbPaymentMethord.SelectedValue;
             aD_OpeningBalanceCompany.OpeningDate      = dateTimePicker.Value;
             if (aD_OpeningBalanceCompany.Id > 0)
             {
                 db.Entry(aD_OpeningBalanceCompany).State = EntityState.Modified;
                 db.SaveChanges();
             }
         }
         LoadDate();
         MessageBox.Show("Data Updated Successfuly");
         Clear();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 14
0
        private void dataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (dataGridView.CurrentRow.Index != -1)
                {
                    ad_HSCode.Id = Convert.ToInt32(dataGridView.CurrentRow.Cells["Id"].Value);
                    using (security_modulesEntities db = new security_modulesEntities())
                    {
                        ad_HSCode              = db.AD_HSCode.Where(x => x.Id == ad_HSCode.Id).FirstOrDefault();
                        txtboxAIT.Text         = ad_HSCode.AIT.ToString();
                        txtboxAT.Text          = ad_HSCode.AT.ToString();
                        txtboxCD.Text          = ad_HSCode.CD.ToString();
                        txtboxDescription.Text = ad_HSCode.Description;
                        txtboxHSCode.Text      = ad_HSCode.HSCode.ToString();
                        txtboxRD.Text          = ad_HSCode.RD.ToString();
                        txtboxSD.Text          = ad_HSCode.SD.ToString();
                        txtboxTTL.Text         = ad_HSCode.TTL.ToString();
                        txtboxVAT.Text         = ad_HSCode.VAT.ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            btnSave.Enabled = false;
        }
Ejemplo n.º 15
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            btnSave.Enabled = true;
            try
            {
                using (security_modulesEntities db = new security_modulesEntities())
                {
                    ad_HSCode.AIT         = Convert.ToDecimal(txtboxAIT.Text.Trim());
                    ad_HSCode.AT          = Convert.ToDecimal(txtboxAT.Text.Trim());
                    ad_HSCode.CD          = Convert.ToDecimal(txtboxCD.Text.Trim());
                    ad_HSCode.Description = txtboxDescription.Text.Trim();
                    ad_HSCode.HSCode      = txtboxHSCode.Text.Trim();
                    ad_HSCode.RD          = Convert.ToDecimal(txtboxRD.Text.Trim());
                    ad_HSCode.SD          = Convert.ToDecimal(txtboxSD.Text.Trim());
                    ad_HSCode.TTL         = Convert.ToDecimal(txtboxTTL.Text.Trim());
                    ad_HSCode.VAT         = Convert.ToDecimal(txtboxVAT.Text.Trim());

                    if (ad_HSCode.Id > 0)
                    {
                        db.Entry(ad_HSCode).State = EntityState.Modified;
                        db.SaveChanges();
                    }
                }
                LoadDate();
                MessageBox.Show("Data Updated Successfuly");
                Clear();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 16
0
        private void btnSavePrice_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (var item in AD_ProductPricing)
                {
                    try
                    {
                        AD_ProductPricing ad_ProductPricing = new AD_ProductPricing();
                        using (security_modulesEntities db = new security_modulesEntities())
                        {
                            ad_ProductPricing.ProductId   = item.ProductId;
                            ad_ProductPricing.PricingType = item.PricingType;

                            if (ad_ProductPricing.Id == 0)
                            {
                                db.AD_ProductPricing.Add(ad_ProductPricing);
                                db.SaveChanges();
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
                LoadDate();
                MessageBox.Show("Data Save Successfuly");
                Clear();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 17
0
 public void LoadDate()
 {
     Clear();
     dataGridView.AutoGenerateColumns = false;
     using (security_modulesEntities db = new security_modulesEntities())
     {
         dataGridView.DataSource = db.AD_MeasurementUnit.ToList();
     }
 }
 public void LoadDate()
 {
     Clear();
     dataGridView.AutoGenerateColumns = false;
     using (security_modulesEntities db = new security_modulesEntities())
     {
         dataGridView.DataSource = db.AD_StoreItemStatusDeclaration.ToList();
     }
 }
Ejemplo n.º 19
0
 private void Delete()
 {
     if (MessageBox.Show("Are You Sure to Delete this Record ?", "Business Nature", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         using (security_modulesEntities db = new security_modulesEntities())
         {
             var entry = db.Entry(ad_BusinessNature);
             if (entry.State == EntityState.Detached)
             {
                 db.AD_BusinessNature.Attach(ad_BusinessNature);
             }
             db.AD_BusinessNature.Remove(ad_BusinessNature);
             db.SaveChanges();
             LoadDate();
             MessageBox.Show("Deleted Successfully");
         }
     }
 }
Ejemplo n.º 20
0
 private void btnSearch_Click(object sender, EventArgs e)
 {
     if (txtboxSearch.Text.Trim() == "")
     {
         LoadDate();
     }
     else
     {
         dataGridView.AutoGenerateColumns = false;
         using (security_modulesEntities db = new security_modulesEntities())
         {
             try
             {
                 var data = (from CP in db.AD_CompanyProfile
                             join BN in db.AD_BusinessNature
                             on CP.BusinessNatureId equals BN.Id
                             join BT in db.AD_BusinessType
                             on CP.BusinessTypeId equals BT.Id
                             select new
                 {
                     Id = CP.Id,
                     CompanyName = CP.CompanyName,
                     BusinessTypeId = CP.BusinessTypeId,
                     BusinessNatureId = CP.BusinessNatureId,
                     BIN = CP.BIN,
                     TIN = CP.TIN,
                     AddressLine1 = CP.AddressLine1,
                     AddressLine2 = CP.AddressLine2,
                     Phone = CP.Phone,
                     ContactPersion = CP.ContactPersion,
                     IncorporationNumber = CP.IncorporationNumber,
                     Remarks = CP.Remarks,
                     BusinessType = BT.BusinessType,
                     BusinessNature = BN.BusinessNature
                 }).Where(x => x.CompanyName.Contains(txtboxSearch.Text.Trim())).ToList();
                 dataGridView.DataSource = data;
             }
             catch (Exception ex)
             {
                 throw ex;
             }
         }
     }
 }
 public void Clear()
 {
     txtboxOpeningBalance.Clear();
     btnSave.Enabled = true;
     ad_OpeningBalanceCustomer.Id = 0;
     try
     {
         using (security_modulesEntities db = new security_modulesEntities())
         {
             cmbCustomerName.DataSource    = db.AD_Customer.ToList();
             cmbCustomerName.DisplayMember = "CustomerName";
             cmbCustomerName.ValueMember   = "Id";
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 22
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         using (security_modulesEntities db = new security_modulesEntities())
         {
             ad_Supplier.SupplierName     = txtboxSupplierName.Text.Trim();
             ad_Supplier.Email            = txtboxEmail.Text.Trim();
             ad_Supplier.BIN              = txtboxBIN.Text.Trim();
             ad_Supplier.TIN              = txtboxTIN.Text.Trim();
             ad_Supplier.NID              = txtboxNID.Text.Trim();
             ad_Supplier.AddressLine1     = txtboxAddressLine1.Text.Trim();
             ad_Supplier.AddressLine2     = txtboxAddressLine2.Text.Trim();
             ad_Supplier.PhoneNo1         = txtboxPhoneNumber1.Text.Trim();
             ad_Supplier.PhoneNo2         = txtboxPhoneNumber2.Text.Trim();
             ad_Supplier.Remarks          = txtboxRemarks.Text.Trim();
             ad_Supplier.CreationDate     = DateTime.Now;
             ad_Supplier.CreatorId        = 1;
             ad_Supplier.ModificationDate = DateTime.Now;
             ad_Supplier.ModifierId       = 1;
             if (rdoIsActiveYes.Checked == true)
             {
                 ad_Supplier.VATAppliable = true;
             }
             else
             {
                 ad_Supplier.VATAppliable = false;
             }
             if (ad_Supplier.Id == 0)
             {
                 db.AD_Supplier.Add(ad_Supplier);
                 db.SaveChanges();
             }
             LoadDate();
             MessageBox.Show("Data Save Successfuly");
             Clear();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 23
0
 public void Clear()
 {
     txtboxProductGroup.Clear();
     rdoIsActiveYes.Checked = true;
     btnSave.Enabled        = true;
     ad_ProductGroup.Id     = 0;
     try
     {
         using (security_modulesEntities db = new security_modulesEntities())
         {
             cmbValuationType.DataSource    = db.AD_ValuationType.ToList();
             cmbValuationType.DisplayMember = "ValuationType";
             cmbValuationType.ValueMember   = "Id";
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 24
0
        public void Clear()
        {
            txtboxOpeningBalance.Clear();

            btnSave.Enabled             = true;
            aD_OpeningBalanceCompany.Id = 0;
            try
            {
                using (security_modulesEntities db = new security_modulesEntities())
                {
                    cmbPaymentMethord.DataSource    = db.AD_PaymentMethod.ToList();
                    cmbPaymentMethord.DisplayMember = "PaymentType";
                    cmbPaymentMethord.ValueMember   = "Id";
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 25
0
 public void LoadDate()
 {
     Clear();
     dataGridView.AutoGenerateColumns = false;
     using (security_modulesEntities db = new security_modulesEntities())
     {
         var data = (from CP in db.AD_PaymentMethod
                     join BN in db.AD_PaymentMethodType
                     on CP.MethodTypeId equals BN.Id
                     select new
         {
             Id = CP.Id,
             PaymentType = CP.PaymentType,
             TypeDescription = BN.TypeDescription,
             IsActive = CP.IsActive
         }).ToList();
         dataGridView.DataSource = data;
         // dataGridView.DataSource = db.AD_PaymentMethod.ToList();
     }
 }
Ejemplo n.º 26
0
 public void Clear()
 {
     txtboxPaymentType.Clear();
     rdoIsActiveYes.Checked = true;
     btnSave.Enabled        = true;
     ad_PaymentMethod.Id    = 0;
     try
     {
         using (security_modulesEntities db = new security_modulesEntities())
         {
             cmbMethodType.DataSource    = db.AD_PaymentMethodType.ToList();
             cmbMethodType.DisplayMember = "TypeDescription";
             cmbMethodType.ValueMember   = "Id";
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 27
0
        private void dataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (dataGridView.CurrentRow.Index != -1)
                {
                    ad_Supplier.Id = Convert.ToInt32(dataGridView.CurrentRow.Cells["Id"].Value);
                    using (security_modulesEntities db = new security_modulesEntities())
                    {
                        ad_Supplier = db.AD_Supplier.Where(x => x.Id == ad_Supplier.Id).FirstOrDefault();

                        txtboxSupplierName.Text = ad_Supplier.SupplierName;
                        txtboxEmail.Text        = ad_Supplier.Email;
                        txtboxBIN.Text          = ad_Supplier.BIN;
                        txtboxTIN.Text          = ad_Supplier.TIN;
                        txtboxNID.Text          = ad_Supplier.NID;
                        txtboxAddressLine1.Text = ad_Supplier.AddressLine1;
                        txtboxAddressLine2.Text = ad_Supplier.AddressLine2;
                        txtboxPhoneNumber1.Text = ad_Supplier.PhoneNo1;
                        txtboxPhoneNumber2.Text = ad_Supplier.PhoneNo2;
                        txtboxRemarks.Text      = ad_Supplier.Remarks;


                        if (ad_Supplier.VATAppliable == true)
                        {
                            rdoIsActiveYes.Checked = true;
                        }
                        else
                        {
                            rdoIsActiveNo.Checked = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            btnSave.Enabled = false;
        }
Ejemplo n.º 28
0
 public void LoadDate()
 {
     Clear();
     dataGridView.AutoGenerateColumns = false;
     using (security_modulesEntities db = new security_modulesEntities())
     {
         var data = (from CP in db.AD_ProductGroup
                     join BN in db.AD_ValuationType
                     on CP.ValuationTypeId equals BN.Id
                     select new
         {
             Id = CP.Id,
             ProductGroup = CP.ProductGroup,
             ValuationType = BN.ValuationType,
             ValuationTypeId = CP.ValuationTypeId,
             IsActive = CP.IsActive
         }).ToList();
         dataGridView.DataSource = data;
         //dataGridView.DataSource = db.AD_ProductGroup.ToList();
     }
 }
Ejemplo n.º 29
0
        private void dataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (dataGridView.CurrentRow.Index != -1)
                {
                    aD_OpeningBalanceCompany.Id = Convert.ToInt32(dataGridView.CurrentRow.Cells["Id"].Value);
                    using (security_modulesEntities db = new security_modulesEntities())
                    {
                        aD_OpeningBalanceCompany = db.AD_OpeningBalanceCompany.Where(x => x.Id == aD_OpeningBalanceCompany.Id).FirstOrDefault();

                        txtboxOpeningBalance.Text = aD_OpeningBalanceCompany.OpeningBalance;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            btnSave.Enabled = false;
        }
Ejemplo n.º 30
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                using (security_modulesEntities db = new security_modulesEntities())
                {
                    ad_SalesOutlet.OutletName   = txtboxOutletName.Text.Trim();
                    ad_SalesOutlet.AddressLine1 = txtboxAddressLine1.Text.Trim();
                    ad_SalesOutlet.AddressLine2 = txtboxAddressLine2.Text.Trim();
                    ad_SalesOutlet.PhoneNumber1 = txtboxPhoneNumber1.Text.Trim();
                    ad_SalesOutlet.PhoneNumber2 = txtboxPhoneNumber2.Text.Trim();

                    ad_SalesOutlet.CreationDate     = DateTime.Now;
                    ad_SalesOutlet.CreatorId        = 1;
                    ad_SalesOutlet.ModificationDate = DateTime.Now;
                    ad_SalesOutlet.ModifierId       = 1;
                    if (rdoIsActiveYes.Checked == true)
                    {
                        ad_SalesOutlet.IsActive = true;
                    }
                    else
                    {
                        ad_SalesOutlet.IsActive = false;
                    }
                    if (ad_SalesOutlet.Id == 0)
                    {
                        db.AD_SalesOutlet.Add(ad_SalesOutlet);
                        db.SaveChanges();
                    }
                    LoadDate();
                    MessageBox.Show("Data Save Successfuly");
                    Clear();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }