Esempio n. 1
0
        public Models.TemplateDo GetTemplate(Models.TemplateCriteriaDo criteria)
        {
            Models.TemplateDo result = null;

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

                command.AddParameter(typeof(int), "TemplateID", criteria.TemplateID);
                command.AddParameter(typeof(string), "BrandCode", criteria.BrandCode);
                command.AddParameter(typeof(string), "TemplateName", criteria.TemplateName);

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

            return(result);
        }
Esempio n. 2
0
        public Models.TemplateDo UpdateTemplateMenu(Models.TemplateDo entity)
        {
            Models.TemplateDo result = null;

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

                command.AddParameter(typeof(int), "TemplateID", entity.TemplateID);
                command.AddParameter(typeof(string), "BrandCode", entity.BrandCode);
                command.AddParameter(typeof(string), "TemplateName", entity.TemplateName);
                command.AddParameter(typeof(bool), "FlagActive", entity.FlagActive);

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

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

            return(result);
        }
Esempio n. 3
0
        public void DeleteTemplateMenu(Models.TemplateDo entity)
        {
            db.CreateCommand(new Utils.SQL.SQLCommandHandler((Utils.SQL.ASQLDbCommand command) =>
            {
                command.CommandType = System.Data.CommandType.StoredProcedure;
                command.CommandText = "[dbo].[sp_Delete_TemplateMenu]";

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

                command.ExecuteNonQuery();
            }));
        }