예제 #1
0
파일: AL_AlertBL.cs 프로젝트: swigithub/MVC
        public List <AL_GetAlertConfiguration> Configuration(string Filter, AL_GetAlertConfiguration Configuration)
        {
            DataTable dataTableModel = AL.Get(Filter, Configuration);

            List <AL_GetAlertConfiguration> ListModel = dataTableModel.ToList <AL_GetAlertConfiguration>();

            return(ListModel);
        }
예제 #2
0
        public HttpResponseMessage RoleConfiguration(AL_GetAlertConfiguration Configuration)
        {
            Response   result = new Response();
            AL_AlertBL model  = new AL_AlertBL();

            if (Configuration.KeyCode != null)
            {
                List <AL_GetAlertConfiguration> ModelResult = model.Configuration("Get_Alert_Role_Configurations", Configuration);
                return(Request.CreateResponse(HttpStatusCode.OK, ModelResult));
            }
            else
            {
                result.Message = "KeyCode is required!";
                return(Request.CreateResponse(HttpStatusCode.OK, result));
            }
        }
예제 #3
0
        public HttpResponseMessage GlobalConfiguration(AL_GetAlertConfiguration Configuration)
        {
            Response   result = new Response();
            AL_AlertBL model  = new AL_AlertBL();
            var        dd     = System.Web.HttpContext.Current.Application["User"];

            if (Configuration.KeyCode != null)
            {
                List <AL_GetAlertConfiguration> ModelResult = model.Configuration("Get_Alert_Configurations", Configuration);
                return(Request.CreateResponse(HttpStatusCode.OK, ModelResult));
            }
            else
            {
                result.Message = "KeyCode is required!";
                return(Request.CreateResponse(HttpStatusCode.OK, result));
            }
        }
예제 #4
0
        public DataTable Get(string Filter, AL_GetAlertConfiguration Configuration)
        {
            SqlCommand loCommand = DataContext.OpenConnection();

            try
            {
                loCommand = DataContext.SetStoredProcedure(loCommand, "AL_ManageAlert");
                return(DataContext.Select(DataContext.AddParameters(loCommand, "@Filter", Filter, "@UserId", Configuration.UserId, "@KeyCode", Configuration.KeyCode, "@RoleId", Configuration.RoleId)));
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                DataContext.CloseConnection(loCommand);
            }
        }
예제 #5
0
        public int UpdateConfiguration(string Filter, AL_GetAlertConfiguration ConfigurationList)
        {
            SqlCommand loCommand = DataContext.OpenConnection();

            try
            {
                loCommand = DataContext.SetStoredProcedure(loCommand, "AL_ManageAlert");
                loCommand = DataContext.StartTransaction(loCommand);
                bool result = DataContext.ExecuteNonQuery(DataContext.AddParameters(loCommand, "@Filter", Filter, "@UserId", ConfigurationList.UserId, "@RoleId", ConfigurationList.RoleId, "@IsSubscribed", ConfigurationList.IsSubscribed, "@IsPushAlertRequired", ConfigurationList.IsPushAlertRequired, "@IsEmailAlertRequired", ConfigurationList.IsEmailAlertRequired, "@AlertConfigId", ConfigurationList.AlertConfigId));
                DataContext.EndTransaction(loCommand);
                return(Convert.ToInt32(result));
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                DataContext.CloseConnection(loCommand);
            }
        }