public static TypeproductModel ToDto(TypeproductEntity entity) { return(new TypeproductModel { TypeProductID = entity.TypeProductID, TypeName = entity.TypeName, TypeEnabled = entity.TypeEnabled, }); }
public bool UpdateTypeproduct(TypeproductEntity typeproduct) { string sql = @"[sp_typeproduct_UPDATE]"; object[] obj = { "@TypeProductID", typeproduct.TypeProductID, "@TypeName", typeproduct.TypeName }; using (TransactionScope ts = new TransactionScope()) { try { Db.Update(sql, obj); ts.Complete(); return(true); } catch { return(false); } } }
public bool InsertTypeproduct(TypeproductEntity typeproduct) { string sql = @"sp_typeproduct_INSERT"; object[] obj = { "@TypeName", typeproduct.TypeName }; using (TransactionScope ts = new TransactionScope()) { try { Db.Insert(sql, obj); ts.Complete(); return(true); } catch { return(false); } } }