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); }
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); }
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(); })); }