Esempio n. 1
0
 public static TypeproductModel ToDto(TypeproductEntity entity)
 {
     return(new TypeproductModel
     {
         TypeProductID = entity.TypeProductID,
         TypeName = entity.TypeName,
         TypeEnabled = entity.TypeEnabled,
     });
 }
Esempio n. 2
0
        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); }
            }
        }
Esempio n. 3
0
        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); }
            }
        }