protected void btnYes_Click(object sender, EventArgs e)
 {
     BrandDepartmentCode brandDeptCodetoDelete = new BrandDepartmentCode
     {
          RecordNumber = int.Parse(gvBrandDepartmentCode.SelectedValue.ToString())
     };
     BrandDeptCodeManager.Delete(brandDeptCodetoDelete);
     gvBrandDepartmentCode.DataBind();
     initializeBrands();
 }
 protected void btnSaveBrandDepartmentCode_Click(object sender, EventArgs e)
 {
     BrandDepartmentCode newBrandDepartmentCode = new BrandDepartmentCode
     {
         BrandCode = DDLBrands.SelectedValue,
          BrandName = DDLBrands.SelectedItem.Text,
           DepartmentCode = txtBrandDepartmentCode.Text
     };
     BrandDeptCodeManager.Save(newBrandDepartmentCode);
       gvBrandDepartmentCode.DataBind();
       initializeBrands();
 }
 protected void btnSaveUpdate_Click(object sender, EventArgs e)
 {
     BrandDepartmentCode brandDeptCodetoToUpdate = new BrandDepartmentCode
     {
         RecordNumber = int.Parse(gvBrandDepartmentCode.SelectedValue.ToString())
         , BrandCode = DDLBrandsUpdate.SelectedValue,
          BrandName = DDLBrandsUpdate.SelectedItem.Text,
           DepartmentCode = txtBrandDeptCodeToUpdate.Text
     };
     BrandDeptCodeManager.Save(brandDeptCodetoToUpdate);
     gvBrandDepartmentCode.DataBind();
     initializeBrands();
 }
コード例 #4
0
 protected void btnSaveBrandDepartmentCode_Click(object sender, EventArgs e)
 {
     BrandDepartmentCode newBrandDeptCode = new BrandDepartmentCode
     {
        BrandCode=hfBrandCode.Value,
         BrandName = txtBrand.Text,
          DepartmentCode = txtBrandDepartmentCode.Text
     };
     txtBrandDepartmentCodePreview.Text = newBrandDeptCode.DepartmentCode;
     BrandDeptCodeManager.Save(newBrandDeptCode);
     txtSeriesNumber.Text = generateSeriesNumber(txtBranchDepartmentCodePreview.Text, int.Parse(hfLastPullOutLetterNumber.Value))[1];
     pnlBrandDepartmentCodeCommand.Visible = false;
 }