Exemplo n.º 1
0
        public List <API.LABURNUM.COM.AdmissionType> GetAdmissionTypeByAdvanceSearch(DTO.LABURNUM.COM.AdmissionTypeModel model)
        {
            IQueryable <API.LABURNUM.COM.AdmissionType> iQuery = null;

            if (model.AdmissionTypeId > 0)
            {
                iQuery = this._laburnum.AdmissionTypes.Where(x => x.AdmissionTypeId == model.AdmissionTypeId && x.IsActive == true);
            }
            if (iQuery != null)
            {
                if (model.Name != null)
                {
                    iQuery = iQuery.Where(x => x.Name.Trim().ToLower().Equals(model.Name.Trim().ToLower()) && x.IsActive == true);
                }
            }
            else
            {
                if (model.Name != null)
                {
                    iQuery = this._laburnum.AdmissionTypes.Where(x => x.Name.Trim().ToLower().Equals(model.Name.Trim().ToLower()) && x.IsActive == true);
                }
            }

            List <API.LABURNUM.COM.AdmissionType> dbAdmissionTypes = iQuery.ToList();

            return(dbAdmissionTypes);
        }
Exemplo n.º 2
0
 public void UpdateStatus(DTO.LABURNUM.COM.AdmissionTypeModel model)
 {
     if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password))
     {
         new FrontEndApi.AdmissionTypeApi().UpdateIsActive(model);
     }
 }
Exemplo n.º 3
0
 public long Add(DTO.LABURNUM.COM.AdmissionTypeModel model)
 {
     if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password))
     {
         return(new FrontEndApi.AdmissionTypeApi().Add(model));
     }
     else
     {
         return(-1);
     }
 }
Exemplo n.º 4
0
 public List <DTO.LABURNUM.COM.AdmissionTypeModel> SearchAllAdmissionTypes(DTO.LABURNUM.COM.AdmissionTypeModel model)
 {
     if (new FrontEndApi.ApiClientApi().IsClientValid(model.ApiClientModel.UserName, model.ApiClientModel.Password))
     {
         return(new AdmissionTypeHelper(new FrontEndApi.AdmissionTypeApi().GetAllAdmissionTypes()).Map());
     }
     else
     {
         return(null);
     }
 }
Exemplo n.º 5
0
 private long AddAdmissionType(DTO.LABURNUM.COM.AdmissionTypeModel model)
 {
     API.LABURNUM.COM.AdmissionType admissionType = new AdmissionType()
     {
         Name      = model.Name,
         CreatedOn = new Component.Utility().GetISTDateTime(),
         IsActive  = true
     };
     this._laburnum.AdmissionTypes.Add(admissionType);
     this._laburnum.SaveChanges();
     return(admissionType.AdmissionTypeId);
 }
Exemplo n.º 6
0
 private DTO.LABURNUM.COM.AdmissionTypeModel MapCore(API.LABURNUM.COM.AdmissionType admissionType)
 {
     DTO.LABURNUM.COM.AdmissionTypeModel dtoClass = new DTO.LABURNUM.COM.AdmissionTypeModel()
     {
         AdmissionTypeId = admissionType.AdmissionTypeId,
         Name            = admissionType.Name,
         CreatedOn       = admissionType.CreatedOn,
         IsActive        = admissionType.IsActive,
         LastUpdated     = admissionType.LastUpdated
     };
     return(dtoClass);
 }
Exemplo n.º 7
0
 private long AddAdmissionType(DTO.LABURNUM.COM.AdmissionTypeModel model)
 {
     API.LABURNUM.COM.AdmissionType admissionType = new AdmissionType()
     {
         Name      = model.Name,
         CreatedOn = System.DateTime.Now,
         IsActive  = true
     };
     this._laburnum.AdmissionTypes.Add(admissionType);
     this._laburnum.SaveChanges();
     return(admissionType.AdmissionTypeId);
 }
Exemplo n.º 8
0
 public ActionResult SeachAdmissionTypeByAdvanceSearch(DTO.LABURNUM.COM.AdmissionTypeModel model)
 {
     try
     {
         List <DTO.LABURNUM.COM.AdmissionTypeModel> dbAdmissionTypeList = new LABURNUM.COM.Component.AdmissionType().GetAdmissionTypeByAdvanceSearch(model);
         string html = new LABURNUM.COM.Component.HtmlHelper().RenderViewToString(this.ControllerContext, "~/Views/AdmissionType/SearchResult.cshtml", dbAdmissionTypeList);
         return(Json(new { code = 0, message = "success", result = html }));
     }
     catch (Exception)
     {
         return(Json(new { code = -2, message = "failed", result = new LABURNUM.COM.Component.Common().GetErrorView() }));
     }
 }
Exemplo n.º 9
0
 public ActionResult EditAdmissionTypePopup(long id)
 {
     try
     {
         DTO.LABURNUM.COM.AdmissionTypeModel model = new DTO.LABURNUM.COM.AdmissionTypeModel();
         model = new LABURNUM.COM.Component.AdmissionType().GetAdmissionTypeByAdmissionTypeId(id);
         string html = new LABURNUM.COM.Component.HtmlHelper().RenderViewToString(this.ControllerContext, "~/Views/AjaxRequest/EditAdmissionTypePopup.cshtml", model);
         return(Json(new { code = 0, message = "success", result = html }));
     }
     catch (Exception)
     {
         return(Json(new { code = -1, message = "failed", result = new LABURNUM.COM.Component.Common().GetErrorView() }));
     }
 }
Exemplo n.º 10
0
 public ActionResult AdmissionTypeStatusUpdateAlert(long id, bool cIsActive)
 {
     try
     {
         DTO.LABURNUM.COM.AdmissionTypeModel model = new DTO.LABURNUM.COM.AdmissionTypeModel()
         {
             AdmissionTypeId = id, IsActive = cIsActive
         };
         string html = new LABURNUM.COM.Component.HtmlHelper().RenderViewToString(this.ControllerContext, "~/Views/AjaxRequest/AdmissionTypeStatusUpdateAlert.cshtml", model);
         return(Json(new { code = 0, message = "success", result = html }));
     }
     catch (Exception)
     {
         return(Json(new { code = -1, message = "failed", result = new LABURNUM.COM.Component.Common().GetErrorView() }));
     }
 }
Exemplo n.º 11
0
        public void UpdateIsActive(DTO.LABURNUM.COM.AdmissionTypeModel model)
        {
            model.AdmissionTypeId.TryValidate();
            IQueryable <API.LABURNUM.COM.AdmissionType> iQuery           = this._laburnum.AdmissionTypes.Where(x => x.AdmissionTypeId == model.AdmissionTypeId && x.IsActive == true);
            List <API.LABURNUM.COM.AdmissionType>       dbAdmissionTypes = iQuery.ToList();

            if (dbAdmissionTypes.Count == 0)
            {
                throw new Exception(API.LABURNUM.COM.Component.Constants.ERRORMESSAGES.NO_RECORD_FOUND);
            }
            if (dbAdmissionTypes.Count > 1)
            {
                throw new Exception(API.LABURNUM.COM.Component.Constants.ERRORMESSAGES.MORE_THAN_ONE_RECORDFOUND);
            }
            dbAdmissionTypes[0].IsActive    = model.IsActive;
            dbAdmissionTypes[0].LastUpdated = System.DateTime.Now;
            this._laburnum.SaveChanges();
        }
Exemplo n.º 12
0
 public ActionResult StatusUpdate(DTO.LABURNUM.COM.AdmissionTypeModel model)
 {
     try
     {
         model.ApiClientModel = new LABURNUM.COM.Component.Common().GetApiClientModel();
         HttpClient          client   = new LABURNUM.COM.Component.Common().GetHTTPClient("application/json");
         HttpResponseMessage response = client.PostAsJsonAsync("AdmissionType/UpdateStatus", model).Result;
         if (response.IsSuccessStatusCode)
         {
             return(Json(new { code = 0, message = "success" }));
         }
         else
         {
             return(Json(new { code = -1, message = "failed" }));
         }
     }
     catch (Exception)
     {
         return(Json(new { code = -2, message = "failed" }));
     }
 }
Exemplo n.º 13
0
 public List <DTO.LABURNUM.COM.AdmissionTypeModel> GetAllAdmissionTypes()
 {
     try
     {
         DTO.LABURNUM.COM.AdmissionTypeModel model = new DTO.LABURNUM.COM.AdmissionTypeModel();
         model.ApiClientModel = new LABURNUM.COM.Component.Common().GetApiClientModel();
         HttpClient          client   = new LABURNUM.COM.Component.Common().GetHTTPClient("application/json");
         HttpResponseMessage response = client.PostAsJsonAsync("AdmissionType/SearchAllAdmissionTypes", model).Result;
         if (response.IsSuccessStatusCode)
         {
             var data = response.Content.ReadAsStringAsync().Result;
             return(JsonConvert.DeserializeObject <List <DTO.LABURNUM.COM.AdmissionTypeModel> >(data));
         }
         else
         {
             return(null);
         }
     }
     catch (Exception)
     {
         throw new Exception("Error While Getting AdmissionType List");
     }
 }
Exemplo n.º 14
0
 public DTO.LABURNUM.COM.AdmissionTypeModel GetAdmissionTypeByAdmissionTypeId(long id)
 {
     try
     {
         DTO.LABURNUM.COM.AdmissionTypeModel model = new DTO.LABURNUM.COM.AdmissionTypeModel()
         {
             AdmissionTypeId = id
         };
         List <DTO.LABURNUM.COM.AdmissionTypeModel> dbAdmissionTypes = GetAdmissionTypeByAdvanceSearch(model);
         if (dbAdmissionTypes.Count == 0)
         {
             throw new Exception(LABURNUM.COM.Component.Constants.ERRORMESSAGES.NO_RECORD_FOUND);
         }
         if (dbAdmissionTypes.Count > 1)
         {
             throw new Exception(LABURNUM.COM.Component.Constants.ERRORMESSAGES.MORE_THAN_ONE_RECORDFOUND);
         }
         return(dbAdmissionTypes[0]);
     }
     catch (Exception)
     {
         return(null);
     }
 }
Exemplo n.º 15
0
 private long AddValidation(DTO.LABURNUM.COM.AdmissionTypeModel model)
 {
     model.Name.TryValidate();
     return(AddAdmissionType(model));
 }
Exemplo n.º 16
0
 public long Add(DTO.LABURNUM.COM.AdmissionTypeModel model)
 {
     return(AddValidation(model));
 }
Exemplo n.º 17
0
 public ActionResult SearchAdmissionTypeByAdvanceSearchIndex()
 {
     DTO.LABURNUM.COM.AdmissionTypeModel model = new DTO.LABURNUM.COM.AdmissionTypeModel();
     return(View(model));
 }
Exemplo n.º 18
0
        //
        // GET: /AdmissionType/

        public ActionResult AddIndex()
        {
            DTO.LABURNUM.COM.AdmissionTypeModel model = new DTO.LABURNUM.COM.AdmissionTypeModel();
            return(View(model));
        }