public void Delete(Brand brand)
 {
     using (DbManager db = new DbManager())
     {
         Accessor.Query.Delete(db, brand);
     }
 }
 protected void btnSaveUpdate_Click(object sender, EventArgs e)
 {
     brand = BM.GetBrandByKey(long.Parse(gvBrandList.SelectedRow.Cells[2].Text));
     brand.BrandCode = txtBrandCodeUpdate.Text.ToUpper();
     brand.BrandDescription = txtBranDescriptionUpdate.Text.ToUpper();
     BM.Save(brand);
     LoadAllBrands();
 }
 protected void btnSaveBrand_Click(object sender, EventArgs e)
 {
     var brand = new Brand{
         BrandCode = txtBrandCode.Text.ToUpper(),
         BrandDescription = txtBrandDescription.Text.ToUpper(),
         DateCreated = DateTimeOffset.Now ,
         IsActive = "Yes"
     };
     BM.Save(brand);
     txtBrandCode.Text = null;
     txtBrandDescription.Text = null;
     LoadAllBrands();
 }
 public void Save(Brand brand)
 {
     using (DbManager db = new DbManager())
     {
         if (brand.RecordNo != 0)
         {
             Accessor.Query.Update(db, brand);
         }
         else
         {
             Accessor.Query.Insert(db, brand);
         }
     }
 }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                Session["person"] = p;
                Brand brand = new Brand();
                Label1.Text  = ConfigurationManager.AppSettings["UserImagePath"].ToString();
                //Session["person"] = p;
                // p.Add(new Person{ FirstName="Dennis", Id =1, LastName ="Pitallano", MiddleName ="Quibral"});
                // GridView1.DataSource = p;
                // GridView1.DataBind();
            }
            else {

            }
        }
        private void GetObjectsFromDropList()
        {
            if (dlAccounts.SelectedIndex > 0)
            {
                AccountClass accountSelect = new AccountClass();
                accountSelect = AM.GetAccountByAccountCode(dlAccounts.SelectedValue);
                account = accountSelect;
                //CIM.AccountObject = accountSelect;
                OM.AccountObject = accountSelect;
            }

            if (dlBranch.SelectedIndex > -1)
            {
                BranchClass branchSelect = new BranchClass();
                branchSelect = BM.GetBranchByBranchCode(dlBranch.SelectedValue);
                branch = branchSelect;
                //CIM.BranchObject = branchSelect;
                OM.BranchObject = branchSelect;
            }

            if (dlBrand.SelectedIndex > 0)
            {
                Brand brandlocal = new Brand();

                brandlocal = BrM.GetBrandByBrandCode(dlBrand.SelectedValue);
                brand = brandlocal;
                //CIM.BrandObject = brandlocal;
                OM.BrandObject = brandlocal;
            }
        }
 protected void gvGarmentList_SelectedIndexChanged(object sender, EventArgs e)
 {
     brand = BM.GetBrandByKey(long.Parse(gvBrandList.SelectedRow.Cells[2].Text));
     txtBrandCodeUpdate.Text = brand.BrandCode;
     txtBranDescriptionUpdate.Text = brand.BrandDescription;
 }