/// <summary> /// 添加模具 /// </summary> /// <param name="model"></param> /// <returns></returns> public int AddModel(UserRoles model) { string sql = string.Empty; sql = "INSERT INTO [QX_G_UserRoles] ([UserID],[RoleID],[Description]) " + "VALUES (@UserID, @RoleID, @Description)"; IList <DbParameter> parameters = new List <DbParameter>(); parameters.Add(_commonDbConneciton.CreateSqlParameter("@UserID", SqlDbType.Int, model.UserID)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@RoleID", SqlDbType.NText, model.RoleID)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@Description", SqlDbType.NVarChar, 200, model.Description)); return(ExecuteNonQuery(sql, parameters)); }
/// <summary> /// 添加 /// </summary> /// <param name="model"></param> /// <returns></returns> public int AddModel(MenuType model) { string sql = string.Empty; sql = "INSERT INTO [QX_MenuType] ([MenuTypeName],[Description]) " + "VALUES (@MenuTypeName,@Description)"; IList <DbParameter> parameters = new List <DbParameter>(); parameters.Add(_commonDbConneciton.CreateSqlParameter("@MenuTypeName", SqlDbType.NVarChar, 100, model.MenuTypeName)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@Description", SqlDbType.NVarChar, 200, model.Description)); return(ExecuteNonQuery(sql, parameters)); }
/// <summary> /// 添加实体 /// </summary> public int AddModel(SC_OrderDetailedArrange model) { string sql = string.Empty; sql = @"SET identity_insert OrderList ON;INSERT INTO [SC_OrderDetailedArrange]( [OrderDetailedArrangeID] ,[OrderDetailedID] ,[ProduceTaskID] ,[CreateDate] ,[CreateUserID] ,[DeleteDate] ,[DeleteReason] ,[DeleteUserID] )VALUES( @OrderDetailedArrangeID ,@OrderDetailedID ,@ProduceTaskID ,@CreateDate ,@CreateUserID ,@DeleteDate ,@DeleteReason ,@DeleteUserID )"; IList <DbParameter> parameters = new List <DbParameter>(); parameters.Add(_commonDbConneciton.CreateSqlParameter("@OrderDetailedArrangeID", SqlDbType.Int, model.OrderDetailedArrangeID)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@OrderDetailedID", SqlDbType.Int, model.OrderDetailedID)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@ProduceTaskID", SqlDbType.Int, model.ProduceTaskID)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@CreateDate", SqlDbType.DateTime, model.CreateDate)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@CreateUserID", SqlDbType.NVarChar, model.CreateUserID)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@DeleteDate", SqlDbType.DateTime, model.DeleteDate)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@DeleteReason", SqlDbType.NVarChar, model.DeleteReason)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@DeleteUserID", SqlDbType.NVarChar, model.DeleteUserID)); return(ExecuteNonQuery(sql, parameters)); }
/// <summary> /// 添加模具 /// </summary> /// <param name="model"></param> /// <returns></returns> public int AddModel(Roles model) { string sql = string.Empty; sql = "INSERT INTO [QX_Roles] ([MenuTypeID], [ParentID], [RoleName], [Sort], [Description]) " + "VALUES (@MenuTypeID, @ParentID, @RoleName, @Sort, @Description)"; IList <DbParameter> parameters = new List <DbParameter>(); parameters.Add(_commonDbConneciton.CreateSqlParameter("@MenuTypeID", SqlDbType.Int, model.MenuTypeID)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@ParentID", SqlDbType.Int, model.ParentID)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@RoleName", SqlDbType.NVarChar, 100, model.RoleName)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@Sort", SqlDbType.Int, model.Sort)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@Description", SqlDbType.NVarChar, 200, model.Description)); return(ExecuteNonQuery(sql, parameters)); }
/// <summary> /// 添加实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public int AddModel(Users model) { string sql = string.Empty; sql = "INSERT INTO [QX_Users] ([UserAccount],[Password],[UserName],[Sex],[Birthday],[Phone],[Email],[EmployeeID],[DepartmentID],[EntryDate],[UserType],[Remark]) " + "VALUES (@UserAccount,@Password,@UserName,@Sex,@Birthday,@Phone,@Email,@EmployeeID,@DepartmentID,@EntryDate,@UserType,@Remark)"; IList <DbParameter> parameters = new List <DbParameter>(); parameters.Add(_commonDbConneciton.CreateSqlParameter("@UserAccount", SqlDbType.NVarChar, 50, model.UserAccount)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@Password", SqlDbType.NVarChar, 50, model.Password)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@UserName", SqlDbType.NVarChar, 50, model.UserName)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@Sex", SqlDbType.TinyInt, model.Sex)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@Birthday", SqlDbType.DateTime, model.Birthday)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@Phone", SqlDbType.NVarChar, 20, model.Phone)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@Email", SqlDbType.NVarChar, 50, model.Email)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@EmployeeID", SqlDbType.NVarChar, 50, model.EmployeeID)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@DepartmentID", SqlDbType.Int, model.DepartmentID)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@EntryDate", SqlDbType.DateTime, model.EntryDate)); parameters.Add(_commonDbConneciton.CreateSqlParameter("@UserType", SqlDbType.TinyInt, model.UserType.GetHashCode())); parameters.Add(_commonDbConneciton.CreateSqlParameter("@Remark", SqlDbType.NVarChar, 200, model.Remark)); return(ExecuteNonQuery(sql, parameters)); }