Example #1
0
        public async void LoginMe()
        {
            if (string.IsNullOrEmpty(loginOrEmail) || string.IsNullOrEmpty(password))
            {
                await Page.DisplayAlert("Ошибка!", "Имя пользователя и пароль должны быть заполнены", "Ok");

                return;
            }

            ResponceModel <UserAuthModel> responce = await requestHelper.GetWithResponce <UserAuthModel>("http://rstore.kikoriki.space/User", new Dictionary <string, object>
            {
                { "loginOrEmail", loginOrEmail },
                { "password", password }
            });

            if (responce.ErrorCode == 0)
            {
                _sessionDataStore.UserAuthModel = responce.content;

                ShowNext();
            }
            else
            {
                await Page.DisplayAlert("Ошибка!", responce.ErrorDescription, "Ok");
            }
        }
Example #2
0
        public IActionResult Delete(int id)
        {
            //permissions
            if (SharedData.isManageUserMenuAccessible == false)
            {
                return(AccessDeniedView());
            }
            ResponceModel responceModel = new ResponceModel();

            try
            {
                var UserData = _customerService.GetCustomerById(id);
                _customerService.DeleteCustomer(UserData);
                responceModel.Success = true;
                responceModel.Message = "Deleted.";
                AddNotification(NotificationMessage.TitleSuccess, NotificationMessage.msgUserDeleted, NotificationMessage.TypeSuccess);
                return(Json(responceModel));
            }
            catch (Exception e)
            {
                responceModel.Success = false;
                responceModel.Message = "NotDeleted.";
                AddNotification(NotificationMessage.TitleError, NotificationMessage.ErrormsgUserDeleted, NotificationMessage.TypeError);
                return(Json(responceModel));
            }
        }
Example #3
0
        public virtual IActionResult CancelAppointment(AppointmentDatesModel model)
        {
            //permissions
            if (SharedData.isAppointmentMenuAccessible == false)
            {
                return(AccessDeniedView());
            }
            ResponceModel responceModel = new ResponceModel();

            try
            {
                //Get AppointmentDate By Ussing AppointmentId and AppointmentDate
                var appointmentDateData = _appointmentServices.GetAppointmentDateByAppointmentIdAndAppointmentDateId(AppointmentDateId: model.Id, AppointmentId: model.AppointmentMasterId);
                if (appointmentDateData != null)
                {
                    appointmentDateData.AppointmentStatusId = (int)AppointmentStatus.Cancelled;
                    _appointmentServices.UpdateAppointmentDate(appointmentDateData);
                    responceModel.Success = true;
                    responceModel.Message = "Deleted.";
                    return(Json(responceModel));
                }
                else
                {
                    responceModel.Success = false;
                    responceModel.Message = "NotDelete";
                    return(Json(responceModel));
                }
            }
            catch (Exception e) { }
            responceModel.Success = false;
            responceModel.Message = "NotDelete";
            return(Json(responceModel));
        }
Example #4
0
        public JsonResult Get(string credit, string email, string portrait, string phone)
        {
#if DEBUG
            return(Post(credit, email, portrait, phone));
#else
            return(ResponceModel.GetInstanceBaned());
#endif
        }
Example #5
0
        public JsonResult Get(string credit, string bindname, string password, string pid)
        {
#if DEBUG
            return(Post(credit, bindname, password, pid));
#else
            return(ResponceModel.GetInstanceBaned());
#endif
        }
        public JsonResult Get(string method, string credit, int?id, int?subid, string time, string content, string pic)
        {
#if DEBUG
            return(Post(method, credit, id, subid, time, content, pic));
#else
            return(ResponceModel.GetInstanceBaned());
#endif
        }
        public JsonResult Get(string credit, int year, int term)
        {
#if DEBUG
            return(Post(credit, year, term));
#else
            return(ResponceModel.GetInstanceBaned());
#endif
        }
Example #8
0
        public JsonResult Get(string type, string query)
        {
#if DEBUG
            return(Post(type, query));
#else
            return(new JsonResult(ResponceModel.GetInstanceBaned()));
#endif
        }
        public JsonResult Get(string credit, string type)
        {
#if DEBUG
            return(Post(credit, type));
#else
            return(ResponceModel.GetInstanceBaned());
#endif
        }
        public JsonResult Get(string method, string username, string password, string nickname, string devicetype, string newpassword, string credit)
        {
#if DEBUG
            return(Post(method, username, password, nickname, devicetype, newpassword, credit));
#else
            return(new JsonResult(ResponceModel.GetInstanceBaned()));
#endif
        }
        public ActionResult Delete(int id)
        {
            ResponceModel responceModel = new ResponceModel();

            try
            {
                var companyProfileData = _companyProfileService.GetCompanyProfileById(id);

                if (companyProfileData != null)
                {
                    bool IsProcedureIdUsed = false;
                    foreach (var data in companyProfileData.PoliciesAndProcedures.Where(a => a.IsPolicy == false))
                    {
                        //To Check Is it Used In PatientInfo As FK
                        var count = _treatmentRecordservice.GetPatientInfoByProcedureId(data.Id).Count();
                        if (count != 0)
                        {
                            IsProcedureIdUsed = true;
                        }
                    }
                    if (!IsProcedureIdUsed)
                    {
                        _companyProfileService.DeleteCompanyProfile(companyProfileData);
                        responceModel.Success = true;
                        responceModel.Message = "Deleted.";
                        AddNotification(NotificationMessage.TitleSuccess, NotificationMessage.msgDeleteCompanyProfile, NotificationMessage.TypeSuccess);
                        return(Json(responceModel));
                    }
                    else
                    {
                        responceModel.Success = false;
                        responceModel.Message = "NotDeleted.";

                        AddNotification(NotificationMessage.TitleError, NotificationMessage.CompanyProfileInUse, NotificationMessage.TypeError);
                        return(Json(responceModel));
                    }
                }
                else
                {
                    responceModel.Success = false;
                    responceModel.Message = "NotDeleted.";

                    AddNotification(NotificationMessage.TitleError, NotificationMessage.CompanyProfileNotFount, NotificationMessage.TypeError);

                    return(Json(responceModel));
                }
            }
            catch (Exception e)
            {
                responceModel.Success = false;
                responceModel.Message = "NotDeleted.";

                return(Json(responceModel));
            }
        }
 public JsonResult Post(string credit, int year, int term)
 {
     if (credit == null)
     {
         return(ResponceModel.GetInstanceInvalid());
     }
     else
     {
         return(Course.GetCourse(credit, year, term));
     }
 }
 public JsonResult Post(string method, string credit, int?id, int?subid, string time, string content, string pic)
 {
     if (credit == null)
     {
         return(ResponceModel.GetInstanceInvalid());
     }
     else
     {
         return(MsgBoard.Control(method, credit, id, subid, time, content, pic));
     }
 }
Example #14
0
        private static async Task <ResponceModel <T> > GetResponce <T>(HttpResponseMessage responce)
        {
            if (responce.StatusCode != System.Net.HttpStatusCode.OK)
            {
                throw new Exception("Ошибка запроса - " + responce.StatusCode);
            }

            var jsonString = await responce.Content.ReadAsStringAsync();

            ResponceModel <T> model = JsonConvert.DeserializeObject <ResponceModel <T> >(jsonString);

            return(model);
        }
Example #15
0
        async void RegisterIt()
        {
            ResponceModel <UserAuthModel> responce = await requestHelper.PostWithResponce <UserAuthModel, User>("http://rstore.kikoriki.space/User", _user);

            if (responce.ErrorCode == 0)
            {
                await _page.Navigation.PopModalAsync();
            }
            else
            {
                await _page.DisplayAlert("Ошибка!", responce.ErrorDescription, "Ok");
            }
        }
Example #16
0
        public async Task <ResultModel> AddVehicle([FromBody] Vehicle vehicle)
        {
            try
            {
                int response = await _vehicleRepository.AddVehicleAsync(vehicle);

                return(ResponceModel.GetSavedResponse(response > 0, response));
            }
            catch (Exception ex)
            {
                var st = new StackTrace();
                return(ResponceModel.GetExceptionResponse(ex, st.GetFrame(0).GetMethod().DeclaringType.FullName));
            }
        }
Example #17
0
        public async Task <ResultModel> SearchVehicles(Vehicle vehicle, int PageSize = 10, int PageNo = 1)
        {
            try
            {
                var data = await _vehicleRepository.GetSearchVehiclesAsync(PageSize, PageNo, vehicle);

                return(ResponceModel.GetResponse(data));
            }
            catch (Exception ex)
            {
                var st = new StackTrace();
                return(ResponceModel.GetExceptionResponse(ex, st.GetFrame(0).GetMethod().DeclaringType.FullName));
            }
        }
Example #18
0
        public async Task <ResultModel> UpdateVehicle(int id, [FromBody] Vehicle vehicle)
        {
            try
            {
                bool response = await _vehicleRepository.UpdateVehicleAsync(id, vehicle);

                return(ResponceModel.GetUpdatedResponse(response, id));
            }
            catch (Exception ex)
            {
                var st = new StackTrace();
                return(ResponceModel.GetExceptionResponse(ex, st.GetFrame(0).GetMethod().DeclaringType.FullName));
            }
        }
Example #19
0
        public async Task <ResultModel> GetVehicles()
        {
            try
            {
                var data = await _vehicleRepository.GetVehiclesAsync();

                return(ResponceModel.GetResponse(data));
            }
            catch (Exception ex)
            {
                var st = new StackTrace();
                return(ResponceModel.GetExceptionResponse(ex, st.GetFrame(0).GetMethod().DeclaringType.FullName));
            }
        }
Example #20
0
        public virtual IActionResult PostAddAppointmentDates(AppointmentDates model)
        {
            ResponceModel responceModel   = new ResponceModel();
            var           appointmentData = _appointmentServices.GetAppointmentById(model.AppointmentMasterId);
            var           appointmentDate = new AppointmentDates();

            appointmentDate.AppointmentDate     = model.AppointmentDate;
            appointmentDate.AppointmentMasterId = model.AppointmentMasterId;
            appointmentDate.AppointmentStatusId = (int)AppointmentStatus.Created;
            appointmentData.AppointmentDates.Add(appointmentDate);
            _appointmentServices.UpdateAppointment(appointmentData);
            responceModel.Success           = true;
            responceModel.Message           = "Create";
            responceModel.AppointmentDateId = appointmentDate.Id;
            return(Json(responceModel));
        }
        // GET: Nurse/Delete/5
        public virtual IActionResult Delete(int id)
        {
            ResponceModel responceModel = new ResponceModel();

            try
            {
                var nurse = _nurseServices.GetNurseById(id);

                if (nurse != null)
                {
                    //To Check Is it Used In PatientInfo As FK
                    var count = _treatmentRecordservice.GetPatientInfoByNurseId(id).Count();
                    if (count == 0)
                    {
                        _nurseServices.DeleteNurse(nurse);
                        responceModel.Success = true;
                        responceModel.Message = "Deleted.";
                        AddNotification(NotificationMessage.TitleSuccess, NotificationMessage.msgDeleteNurse, NotificationMessage.TypeSuccess);
                        return(Json(responceModel));
                    }
                    else
                    {
                        responceModel.Success = false;
                        responceModel.Message = "NotDeleted.";

                        AddNotification(NotificationMessage.TitleError, NotificationMessage.NurseInUser, NotificationMessage.TypeError);
                        return(Json(responceModel));
                    }
                }
                else
                {
                    responceModel.Success = false;
                    responceModel.Message = "NotDeleted.";

                    AddNotification(NotificationMessage.TitleError, NotificationMessage.NurseNotFount, NotificationMessage.TypeError);

                    return(Json(responceModel));
                }
            }
            catch (Exception e)
            {
                responceModel.Success = false;
                responceModel.Message = "NotDeleted.";

                return(Json(responceModel));
            }
        }
        public IActionResult EquipmentDelete(int id)
        {
            //permissions
            if (SharedData.isDiagnosisMenuAccessible == false)
            {
                return(AccessDeniedView());
            }
            ResponceModel responceModel = new ResponceModel();

            try
            {
                var equipment = _equipmentService.GetEquiipmentInfoById(id);

                if (equipment == null)
                {
                    //No product found with the specified id
                    return(RedirectToAction("List"));
                }

                var count = _treatmentRecordService.GetMachineInfoByEquipmentId(id).Count();
                if (count == 0)
                {
                    _equipmentService.DeleteEquipment(equipment);
                    responceModel.Success = true;
                    responceModel.Message = "Deleted.";
                    AddNotification(NotificationMessage.TitleSuccess, NotificationMessage.msgDeleteHospital, NotificationMessage.TypeSuccess);
                    return(Json(responceModel));
                }
                else
                {
                    responceModel.Success = false;
                    responceModel.Message = "NotDeleted.";
                    AddNotification(NotificationMessage.TitleError, NotificationMessage.ErrormsgDeleteHospital, NotificationMessage.TypeError);

                    return(Json(responceModel));
                }
            }
            catch (Exception e)
            {
                responceModel.Success = false;
                responceModel.Message = "NotDeleted.";
                AddNotification(NotificationMessage.TitleError, NotificationMessage.ErrormsgDeleteHospital, NotificationMessage.TypeError);

                return(Json(responceModel));
            }
        }
        // Post: Treatment/Delete/5
        public IActionResult CommentTypeDelete(int id)
        {
            //permissions
            if (SharedData.isCommentTypeMenuAccessible == false)
            {
                return(AccessDeniedView());
            }
            ResponceModel responceModel = new ResponceModel();

            try
            {
                var commentType = _treatmentServices.GetCommentTypeById(id);

                if (commentType == null)
                {
                    //No product found with the specified id
                    return(RedirectToAction("List"));
                }

                var count = _treatmentServices.GetAutoTextByCommentTypeId(id).Count();
                if (count == 0)
                {
                    _treatmentServices.DeleteCommentType(commentType);
                    responceModel.Success = true;
                    responceModel.Message = "Deleted.";
                    AddNotification(NotificationMessage.TitleSuccess, NotificationMessage.msgDeleteHospital, NotificationMessage.TypeSuccess);
                    return(Json(responceModel));
                }
                else
                {
                    responceModel.Success = false;
                    responceModel.Message = "NotDeleted.";
                    AddNotification(NotificationMessage.TitleError, NotificationMessage.ErrorMsg, NotificationMessage.TypeError);

                    return(Json(responceModel));
                }
            }
            catch (Exception e)
            {
                responceModel.Success = false;
                responceModel.Message = "NotDeleted.";
                AddNotification(NotificationMessage.TitleError, NotificationMessage.ErrorMsg, NotificationMessage.TypeError);

                return(Json(responceModel));
            }
        }
Example #24
0
        public ActionResult Index()
        {
            SendEmailViewModel obj = new SendEmailViewModel();

            obj.CommunicationMstSelectList = db.CommunicationGroupMasters.Select(x => new SelectListItem()
            {
                Text = x.Title, Value = x.Id.ToString()
            }).ToList();
            ResponceModel rm   = new ResponceModel();
            var           list = db.StudentEmailMasters.Where(x => x.Type.Equals("Inbox"));

            obj.StudentEmailMasterList = list.ToList();
            rm.Inboxcount = list.Count();
            rm.Draftcount = db.StudentEmailMasters.Where(c => c.Type.Equals("Draft")).Count();
            rm.Sentcount  = db.StudentEmailMasters.Where(x => x.Type.Equals("Sent")).Count();
            obj.responce  = rm;
            return(View(obj));
        }
Example #25
0
        public virtual IActionResult AppointmentDateDelete(int id, int AppointmentId)
        {
            //permissions
            if (SharedData.isAppointmentMenuAccessible == false)
            {
                return(AccessDeniedView());
            }
            ResponceModel responceModel = new ResponceModel();

            try
            {
                var appointment     = _appointmentServices.GetAppointmentById(AppointmentId);
                var appointmentDate = appointment.AppointmentDates.Where(a => a.Id == id).FirstOrDefault();
                if (appointment == null)
                {
                    //No product found with the specified id
                    return(RedirectToAction("List"));
                }

                if (appointment != null)
                {
                    _appointmentServices.DeleteAppointmentDate(appointmentDate);
                    responceModel.Success = true;
                    responceModel.Message = "Deleted.";
                    return(Json(responceModel));
                }
                else
                {
                    responceModel.Success = false;
                    responceModel.Message = "NotDelete";
                    return(Json(responceModel));
                }
            }
            catch (Exception e)
            {
                responceModel.Success = false;
                responceModel.Message = "NotDeleted.";
                return(Json(responceModel));
            }
        }
        //1/10/19 aakansha

        // Post: Hospital/Delete/5
        public virtual IActionResult Delete(int id)
        {
            ResponceModel responceModel = new ResponceModel();

            try
            {
                var hospital = _hospitalServices.GetHospitalById(id);
                if (hospital == null)
                {
                    //No product found with the specified id
                    return(RedirectToAction("List"));
                }
                if (hospital != null)
                {
                    var count = _treatmentRecordService.GetPatientInfoByHospitalId(id).Count();
                    if (count == 0)
                    {
                        _hospitalServices.DeleteHospital(hospital);
                        responceModel.Success = true;
                        responceModel.Message = "Deleted.";
                        AddNotification(NotificationMessage.TitleSuccess, NotificationMessage.msgDeleteHospital, NotificationMessage.TypeSuccess);
                        return(Json(responceModel));
                    }
                    else
                    {
                    }
                }
                responceModel.Success = false;
                responceModel.Message = "NotDeleted.";
                AddNotification(NotificationMessage.TitleError, NotificationMessage.ErrormsgDeleteHospital, NotificationMessage.TypeError);
                return(Json(responceModel));
            }
            catch (Exception e)
            {
                responceModel.Success = false;
                responceModel.Message = "NotDeleted.";
                AddNotification(NotificationMessage.TitleError, NotificationMessage.ErrormsgDeleteHospital, NotificationMessage.TypeError);
                return(Json(responceModel));
            }
        }
Example #27
0
        public async Task <ResultModel> UploadProfileImage(int id, [FromForm] IFormFile file)
        {
            try
            {
                string fName      = file.FileName;
                string imagesPath = @"ProfileImages/" + file.FileName;
                string path       = Path.Combine(_environment.ContentRootPath, imagesPath);

                using (var stream = new FileStream(path, FileMode.Create))
                {
                    await file.CopyToAsync(stream);
                }

                bool response = await _userRepository.UploadProfileImageAsync(id, imagesPath);

                return(ResponceModel.GetUpdatedResponse(response, id));
            }
            catch (Exception ex)
            {
                var st = new StackTrace();
                return(ResponceModel.GetExceptionResponse(ex, st.GetFrame(0).GetMethod().DeclaringType.FullName));
            }
        }
Example #28
0
        public ActionResult EmailTemplatePost(SendEmailViewModel data)
        {
            StudentEmailMaster sem;

            if (data.Id != 0)
            {
                sem = db.StudentEmailMasters.Find(data.Id);
            }
            else
            {
                sem = new StudentEmailMaster();
            }
            sem.AcademicYear = "not defined yet";//(db.AcademicYears.FirstOrDefault().Academic_Year_En==null)? "Not defined yet": db.AcademicYears.FirstOrDefault(x => x.isCurrent == true).Academic_Year_En;
            sem.MailContent  = HttpUtility.HtmlDecode(data.EmailBody);
            sem.Subject      = data.Subject;
            //  string s = Regex.Replace(data.EmailBody, "<.*?>", String.Empty);
            sem.IsTemplate = true;
            sem.Type       = "Draft";
            sem.CreatedOn  = DateTime.Now;
            sem.CreatedBy  = (User.Identity.Name == "") ? "Naveed" : User.Identity.Name;

            if (data.Id == 0)
            {
                sem = db.StudentEmailMasters.Add(sem);
                db.SaveChanges();
            }
            else
            {
                db.SaveChanges();
            }
            ResponceModel rm = new ResponceModel();

            rm.Draftcount = db.StudentEmailMasters.Where(x => x.Type.Equals("Draft")).Count();
            rm.Id         = sem.Id;
            return(RedirectToAction("Index"));
        }
        public IActionResult Delete(int id)
        {
            ResponceModel responceModel  = new ResponceModel();
            var           deleteUserData = _customerService.GetCustomerRoleById(id);
            var           count          = _customerService.GetCustomerByCustomerRoleId(id).Count();

            if (count == 0)
            {
                _customerService.DeleteCustomerRole(deleteUserData);
                responceModel.Success = true;
                responceModel.Message = "Deleted.";
                AddNotification(NotificationMessage.TitleSuccess, NotificationMessage.msgDeleteUserRole, NotificationMessage.TypeSuccess);

                return(Json(responceModel));
            }
            else
            {
                responceModel.Success = false;
                responceModel.Message = "NotDeleted.";
                AddNotification(NotificationMessage.TitleError, NotificationMessage.ErrormsgUserRoleDeleted, NotificationMessage.TypeError);

                return(Json(responceModel));
            }
        }
Example #30
0
        public ActionResult draftemails(SendEmailViewModel data)
        {
            StudentEmailMaster sem;

            if (data.Id != 0)
            {
                sem = db.StudentEmailMasters.Find(data.Id);
            }
            else
            {
                sem = new StudentEmailMaster();
            }
            sem.AcademicYear = "not defined yet";//(db.AcademicYears.FirstOrDefault().Academic_Year_En==null)? "Not defined yet": db.AcademicYears.FirstOrDefault(x => x.isCurrent == true).Academic_Year_En;
            sem.MailContent  = HttpUtility.HtmlDecode(data.EmailBody);
            sem.Subject      = data.Subject;
            //  string s = Regex.Replace(data.EmailBody, "<.*?>", String.Empty);
            sem.IsTemplate = false;
            sem.Type       = "Draft";
            sem.CreatedOn  = DateTime.Now;
            sem.CreatedBy  = (User.Identity.Name == "") ? "Naveed" : User.Identity.Name;
            HttpFileCollectionBase files = Request.Files;

            sem.IsFile  = files.Count > 0 ? true : false;
            sem.NoFiles = files.Count;
            List <string> allfiles = new List <string>();

            foreach (string fcName in Request.Files)
            {
                HttpPostedFileBase file = files[fcName];
                if (!string.IsNullOrEmpty(file.FileName))
                {
                    if (sem.StudentEmailFiles.Count > 0)
                    {
                        var check = sem.StudentEmailFiles.FirstOrDefault(x => x.ShowFileName.Equals(file.FileName));
                        if (check == null)
                        {
                            StudentEmailFile filedetail = new StudentEmailFile();
                            filedetail.ShowFileName = file.FileName;
                            filedetail.FileExtnsion = file.ContentType;
                            filedetail.URL          = DateTime.Now.Ticks.ToString();
                            filedetail.CreatedBy    = "Naveed";
                            filedetail.CreatedOn    = DateTime.Now;
                            filedetail.IsActive     = true;
                            string path       = "/Images/" + "Mailes/" + filedetail.URL + file.FileName.LastIndexOf('.');
                            string createpath = "/Images/" + "Mailes/";
                            string dicrectory = Request.MapPath(createpath);
                            Directory.CreateDirectory(dicrectory);
                            string dicrectory2 = Request.MapPath(path);
                            allfiles.Add(dicrectory2);
                            file.SaveAs(dicrectory2);
                            sem.StudentEmailFiles.Add(filedetail);
                        }
                    }
                    else
                    {
                        StudentEmailFile filedetail = new StudentEmailFile();
                        filedetail.ShowFileName = file.FileName;
                        filedetail.FileExtnsion = file.ContentType;
                        filedetail.URL          = DateTime.Now.Ticks.ToString();
                        filedetail.CreatedBy    = "Naveed";
                        filedetail.CreatedOn    = DateTime.Now;
                        filedetail.IsActive     = true;
                        string path       = "/Images/" + "Mailes/" + filedetail.URL + file.FileName.LastIndexOf('.');
                        string createpath = "/Images/" + "Mailes/";
                        string dicrectory = Request.MapPath(createpath);
                        Directory.CreateDirectory(dicrectory);
                        string dicrectory2 = Request.MapPath(path);
                        allfiles.Add(dicrectory2);
                        file.SaveAs(dicrectory2);
                        sem.StudentEmailFiles.Add(filedetail);
                    }
                }
            }
            if (data.Id == 0)
            {
                sem = db.StudentEmailMasters.Add(sem);
                db.SaveChanges();
            }
            else
            {
                db.SaveChanges();
            }
            ResponceModel rm = new ResponceModel();

            rm.Draftcount = db.StudentEmailMasters.Where(x => x.Type.Equals("Draft")).Count();
            rm.Id         = sem.Id;
            return(Json(rm, JsonRequestBehavior.AllowGet));
        }