Exemple #1
0
        public Models.UpdateMenuGroupResultDo CreateMenuGroup(Models.MenuGroupDo entity)
        {
            Models.UpdateMenuGroupResultDo result = new Models.UpdateMenuGroupResultDo();

            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Create_MenuGroup]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(string), "Code", entity.Code);
                command.AddParameter(typeof(string), "Name", entity.Name);

                command.AddParameter(typeof(DateTime), "CreateDate", entity.CreateDate);
                command.AddParameter(typeof(string), "CreateUser", entity.CreateUser);

                Utils.SQL.ISQLDbParameter error = command.AddErrorParameter();

                List <Models.MenuGroupDo> list = command.ToList <Models.MenuGroupDo>();
                if (list != null)
                {
                    if (list.Count > 0)
                    {
                        result.Group = list[0];
                    }
                }
                result.ErrorParameter(error);
            }));

            return(result);
        }
Exemple #2
0
        public void DeleteMenuGroup(Models.MenuGroupDo entity)
        {
            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandText = "[dbo].[sp_Delete_MenuGroup]";
                command.CommandType = System.Data.CommandType.StoredProcedure;

                command.AddParameter(typeof(int), "GroupID", entity.GroupID);

                command.AddParameter(typeof(DateTime), "UpdateDate", entity.UpdateDate);
                command.AddParameter(typeof(string), "UpdateUser", entity.UpdateUser);

                command.ExecuteNonQuery();
            }));
        }