Ejemplo n.º 1
0
        public static bool InsertBaoYangPackageBrandPriorityConfig(BaoYangPackageBrandPriorityConfig model)
        {
            const string sql = @"INSERT INTO Configuration..SE_BaoYangPackageBrandPriorityConfig
                                          ( 
                                           [VehicleID]                                       
                                          ,[PackageBrands]
                                          ,[JiYouGrade]
                                          ,[CreateTime]
                                          ,[UpdateTime]
                                          )
                                  VALUES( 
                                           @VehicleID                                         
                                          ,@PackageBrands
                                          ,@JiYouGrade
                                          ,GETDATE()
                                          ,GETDATE()                                       
                                          )";

            var sqlParameter = new SqlParameter[]
            {
                new SqlParameter("@VehicleID", model.VehicleID ?? string.Empty),
                new SqlParameter("@PackageBrands", model.PackageBrands ?? string.Empty),
                new SqlParameter("@JiYouGrade", model.JiYouGrade ?? string.Empty)
            };

            return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, sql, sqlParameter) > 0);
        }
 public ActionResult Edit(int id = 0, string edit = "", string VehicleID = "")
 {
     ViewBag.Edit      = edit;
     ViewBag.VehicleID = VehicleID;
     if (id == 0)
     {
         BaoYangPackageBrandPriorityConfig model = new BaoYangPackageBrandPriorityConfig();
         return(View(model));
     }
     else
     {
         return(View(BaoYangPackageBrandPriorityConfigManager.GetBaoYangPackageBrandPriorityConfig(id)));
     }
 }
Ejemplo n.º 3
0
 public bool InsertBaoYangPackageBrandPriorityConfig(BaoYangPackageBrandPriorityConfig model)
 {
     try
     {
         return(DALBaoYangPackageBrandPriorityConfig.InsertBaoYangPackageBrandPriorityConfig(model));
     }
     catch (TuhuBizException)
     {
         throw;
     }
     catch (Exception ex)
     {
         var exception = new BaoYangPackageBrandPriorityConfigException(1, "InsertBaoYangPackageBrandPriorityConfig", ex);
         Logger.Log(Level.Error, exception, "InsertBaoYangPackageBrandPriorityConfig");
         throw ex;
     }
 }
Ejemplo n.º 4
0
        public static bool UpdateBaoYangPackageBrandPriorityConfig(BaoYangPackageBrandPriorityConfig model)
        {
            const string sql          = @"UPDATE Configuration..SE_BaoYangPackageBrandPriorityConfig SET                                      
                                           VehicleID=@VehicleID                                       
                                          ,PackageBrands=@PackageBrands      
                                          ,JiYouGrade=@JiYouGrade
                                          ,[UpdateTime]=GETDATE()                                        
                                WHERE Id=@Id";
            var          sqlParameter = new SqlParameter[]
            {
                new SqlParameter("@VehicleID", model.VehicleID ?? string.Empty),
                new SqlParameter("@Brand", model.Brand ?? string.Empty),
                new SqlParameter("@Vehicle", model.Vehicle ?? string.Empty),
                new SqlParameter("@PackageBrands", model.PackageBrands ?? string.Empty),
                new SqlParameter("@JiYouGrade", model.JiYouGrade ?? string.Empty),
                new SqlParameter("@Id", model.Id)
            };

            return(SqlHelper.ExecuteNonQuery(conn, CommandType.Text, sql, sqlParameter) > 0);
        }