コード例 #1
0
ファイル: ProductTypeRepo.cs プロジェクト: htphongqn/B2C_EC
 public int UpdateProductType(ProductType U)
 {
     try
     {
         db.Entry(U).State = EntityState.Modified;
         return db.SaveChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
コード例 #2
0
ファイル: ProductTypeRepo.cs プロジェクト: htphongqn/B2C_EC
 public int CreateProductType(ProductType U)
 {
     try
     {
         this.db.ProductTypes.Add(U);
         return db.SaveChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
コード例 #3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            ProductType productType = new ProductType();
            productType.Name = ToSQL.EmptyNull(txtName.Text);
            productType.Note = ToSQL.EmptyNull(txtNote.Text);
            productType.IsActive = true;
            productType.SortId = 0;
            productType.DateCreated = DateTime.Now;
            productType.DescriptionTemplate = CKEditorControlDescriptionType.Text;

            int i = productTypeRepo.CreateProductType(productType);
            Response.Redirect("Management-ProductType.aspx");
        }