private async void getAdmissionData() { progress.Show(); try { AdmissionModel response = await admissionapi.GetCareerList(); List <ResDataAdmission> resddat = response.res_data; Admission = resddat[0].content_text + resddat[0].content_title; //finalAdmission = new List<AdmissionModel>(); //for (int i = 0; i < resddat.Count; i++) //{ // Admission_List.Add(resddat[i].content_id); // Admission_List.Add(resddat[i].content_text); // Admission_List.Add(resddat[i].content_title); // Admission_List.Add(resddat[i].content_date); //} mWebView.Settings.JavaScriptEnabled = true; mWebView.SetWebViewClient(new MyWebViewClientAdmission()); mWebView.LoadData("<html>" + Admission + "</html>", "text/html", "utf-8"); // Toast.MakeText(this.Activity, "-->" + myFinalList[0].name,ToastLength.Short).Show(); // MyList.Adapter = new ArrayAdapter(Activity, Android.Resource.Layout.SimpleListItem1, aboutExamCoursename); progress.Dismiss(); if (Admission.Length <= 0) { ISharedPreferences pref = Android.App.Application.Context.GetSharedPreferences("AdmissionInfo", FileCreationMode.Private); ISharedPreferencesEditor edit = pref.Edit(); edit.PutString("Admissioncontent", Admission); edit.Apply(); } Intent intent = new Intent(Activity, typeof(Admission_Fragment)); Activity.StartActivity(intent); } catch (Exception e) { } }
public HttpResponseMessage Post([FromBody] AdmissionModel aModel) { var formate = RequestFormat.JsonFormaterString(); try { if (aModel.PtIndoorId == 0) { return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { Output = "error", Msg = "Name is Null" })); } if (Math.Abs(aModel.TotalAmount) < 1) { return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { Output = "error", Msg = "Charge Can" })); } else { string msg = _gt.Save(aModel); return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { Output = "success", Msg = msg }, formate)); } } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { Output = "error", Msg = ex.ToString() }, formate)); } }
public AdmissionPresenter(IAdmissionView view) { admissionView = view; admissionModel = new AdmissionModel(); patientRegModel = new PatientRegistrationModel(); wardModel = new WardModel(); }
// GET: AdmissionSurface public ActionResult submit(AdmissionModel admission) { if (!ModelState.IsValid) { return(RedirectToUmbracoPage(admission.AdmissionID)); } return(CurrentUmbracoPage()); }
public string GetPersianCloseDate(AdmissionModel model) { System.Globalization.PersianCalendar pdate = new System.Globalization.PersianCalendar(); var closeYear = pdate.GetYear(model.DateOfClose); var closeMonth = pdate.GetMonth(model.DateOfClose); var closeDay = pdate.GetDayOfMonth(model.DateOfClose); return($"{closeYear}/{closeMonth.ToString().PadLeft('0')}/{closeDay.ToString().PadLeft('0')}"); }
public string CapacityExceed(AdmissionModel model) { string result = string.Empty; if (model.NumberOfSubmittedStudents > model.CapacityOfStudents) { result = $"The course {model.Course} has reached the maximum size of capacity"; } return(result); }
private void SendEmail(AdmissionModel admission) { MailMessage message = new MailMessage(admission.EmailAddress, "*****@*****.**"); message.Subject = string.Format("Enquiry from {0} {1} - {2}", admission.Firstname, admission.Lastname, admission.EmailAddress, admission.TelephoneNumber, admission.HomeAddress, admission.GradeChoice, admission.PFirstname, admission.PLastname, admission.ReasonChoice); SmtpClient client = new SmtpClient("127.0.0.1", 25); client.Send(message); }
public void Test_Get_Georgian_CloseDate() { //Arrange var fakeModel = new AdmissionModel() { DateOfClose = _date }; var fakeAdmissionLogic = new Business.AdmissionLogic(); //Act var actualResult = fakeAdmissionLogic.GetGeorgianCloseDate(fakeModel); //Assert Assert.Equal(fakeModel.DateOfClose, actualResult); }
public async Task <HttpResponseMessage> Post([FromBody] AdmissionModel mAdmission) { var formatter = RequestFormat.JsonFormaterString(); try { if (mAdmission.PtRegId == 0) { return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { Output = "error", Msg = "Patient Name is Empty" }, formatter)); } if (mAdmission.RefDrId == 0) { return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { Output = "error", Msg = "Dotor Name Empty" }, formatter)); } if (mAdmission.BedId == 0) { return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { Output = "error", Msg = "Bed No is Empty" }, formatter)); } if (mAdmission.UserName == "") { return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { Output = "error", Msg = "UserName is Empty" }, formatter)); } else { string msg = await _gtAdmissionGateway.Save(mAdmission); // _gtInvoice.PrintReport("DiagnosisInvoiceRPT.rpt", "SP_GET_INVOICE_PRINT", "" + mInvoice.ElementAt(0).InvMasterId + "", "SP_GET_INVOICE_PRINT", "", "", "S"); return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { Output = "success", Msg = msg }, formatter)); } } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation { Output = "error", Msg = ex.ToString() }, formatter)); } }
//we're calculating days by subtracting AdmissionDate from DischargeDate //minimum days will be 1 <needs revision> sud: 20Aug'18 private int CalculateBedStayForAdmission(AdmissionModel adm) { int totalDays = 1; if (adm != null) { DateTime admissionTime = adm.AdmissionDate; DateTime dischargeTime = (DateTime)(adm.DischargeDate != null ? adm.DischargeDate : DateTime.Now); int daysDiff = ((TimeSpan)(dischargeTime - admissionTime)).Days; if (daysDiff != 1) { totalDays = daysDiff; } } return(totalDays); }
public void Test_Course_Specification(string courseName, int duration, int capacity) { //Arrange var fakeModel = new AdmissionModel() { Course = courseName, Duration = duration, CapacityOfStudents = capacity }; var fakeAdmissionLogic = new Business.AdmissionLogic(); //Act var actualResult = fakeAdmissionLogic.CourseSpecification(fakeModel); //Assert Assert.Equal($"The Course '{fakeModel.Course}' will carry out in {fakeModel.Duration} hours with the number of {fakeModel.CapacityOfStudents} Students", actualResult); }
public void Test_Capacity_Exceed(string courseName, int submited, int capacity) { //Arrange var fakeModel = new AdmissionModel() { Course = courseName, NumberOfSubmittedStudents = submited, CapacityOfStudents = capacity }; var fakeAdmissionLogic = new Business.AdmissionLogic(); //Act var actualResult = fakeAdmissionLogic.CapacityExceed(fakeModel); //Assert Assert.Equal($"The course {fakeModel.Course} has reached the maximum size of capacity", actualResult); }
public JsonResult Admission(AdmissionModel model) { if (ModelState.IsValid) { var formModel = new FormModel() { FormTypeID = FormType.Admission, Data = SerializeUtilities.Serialize(model), EmailBodyString = RenderRazorViewToString("Admission", model) }; var respone = _formServices.SaveForm(formModel); if (respone) { return(Json(new { success = true })); } } return(Json(new { success = false, id = "" })); }
public void Test_Get_Persian_CloseDate() { //Arrange var fakeModel = new AdmissionModel() { DateOfClose = _date }; var fakeAdmissionLogic = new Business.AdmissionLogic(); //Act var actualResult = fakeAdmissionLogic.GetPersianCloseDate(fakeModel); //Assert System.Globalization.PersianCalendar pdate = new System.Globalization.PersianCalendar(); var closeYear = pdate.GetYear(fakeModel.DateOfClose); var closeMonth = pdate.GetMonth(fakeModel.DateOfClose); var closeDay = pdate.GetDayOfMonth(fakeModel.DateOfClose); Assert.Equal($"{closeYear}/{closeMonth.ToString().PadLeft('0')}/{closeDay.ToString().PadLeft('0')}", actualResult); }
public string Save(AdmissionModel aModel) { try { const string msg = ""; Con.Open(); _trans = Con.BeginTransaction(); string refNo = "AC" + GetTrNoWithOpenCon("RefNo", "tbl_IN_LEDGER_OF_ADMITTED_PATIENT", _trans); _insertGateway.InsertLedgerOfAdmittedPatient(refNo, Convert.ToInt32(ReturnFieldValueOpenCon("tbl_IN_PATIENT_ADMISSION", "Id=" + aModel.PtIndoorId + "", "RegId", _trans)), aModel.PtIndoorId, 1969, aModel.TotalAmount, 1, 0, 0, 0, aModel.TotalAmount, 0, 0, 0, 0, GetSubSubPnoByIndoorId(aModel.PtIndoorId, _trans), aModel.UserName, Convert.ToInt32(ReturnFieldValueOpenCon("tbl_IN_PATIENT_ADMISSION", "Id=" + aModel.PtIndoorId + "", "BedId", _trans)), Convert.ToInt32(ReturnFieldValueOpenCon("tbl_IN_PATIENT_ADMISSION", "Id=" + aModel.PtIndoorId + "", "RefDrId", _trans)), Convert.ToInt32(ReturnFieldValueOpenCon("tbl_IN_PATIENT_ADMISSION", "Id=" + aModel.PtIndoorId + "", "AdmitDrId", _trans)), Convert.ToInt32(ReturnFieldValueOpenCon("tbl_IN_PATIENT_ADMISSION", "Id=" + aModel.PtIndoorId + "", "UnderDrId", _trans)), aModel.CashAmount, aModel.CardAmount, aModel.CheaqueAmount, aModel.CardBankId, aModel.CheaqueBankId, aModel.CardNumber, aModel.CheaqueNumber, aModel.Remarks, _trans, Con); _trans.Commit(); Con.Close(); return("Save uccess"); } catch (Exception exception) { if (Con.State == ConnectionState.Open) { Con.Close(); _trans.Rollback(); } return(exception.Message); } }
public ActionResult Admission() { var model = new AdmissionModel(); return(View(model)); }
public DateTime GetGeorgianCloseDate(AdmissionModel model) { return(model.DateOfClose); }
public string CourseSpecification(AdmissionModel model) { return($"The Course '{model.Course}' will carry out in {model.Duration} hours with the number of {model.CapacityOfStudents} Students"); }
public Task <string> Save(AdmissionModel aModel) { try { const string msg = ""; //Image Con.Open(); string ptId = "P" + GetTrNoWithOpenCon("PatientId", "tbl_IN_PATIENT_ADMISSION", _trans); _trans = Con.BeginTransaction(); const string query = @"INSERT INTO tbl_IN_PATIENT_ADMISSION (PatientId, RegId, AdmissionDate, AdmissionTime, BedId, BedCharge, AdmissionCharge, ContractAmount, R_Name_1, Relation_1, R_Phone_1, R_Name_2, Relation_2, R_Phone_2, RefDrId, AdmitDrId, UnderDrId, MpoId, UserName, BranchId,Age,SubSubPnoId) OUTPUT INSERTED.ID VALUES (@PatientId, @RegId, @AdmissionDate, @AdmissionTime, @BedId, @BedCharge, @AdmissionCharge, @ContractAmount, @R_Name_1, @Relation_1, @R_Phone_1, @R_Name_2, @Relation_2, @R_Phone_2, @RefDrId, @AdmitDrId, @UnderDrId, @MpoId, @UserName, @BranchId,@Age,@SubSubPnoId)"; var cmd = new SqlCommand(query, Con, _trans); cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@PatientId", ptId); cmd.Parameters.AddWithValue("@RegId", aModel.PtRegId); cmd.Parameters.AddWithValue("@AdmissionDate", DateTime.Now.ToString("yyyy-MM-dd")); cmd.Parameters.AddWithValue("@AdmissionTime", DateTime.Now.ToString("h:mm:ss tt")); cmd.Parameters.AddWithValue("@BedId", aModel.BedId); cmd.Parameters.AddWithValue("@BedCharge", aModel.BedCharge); cmd.Parameters.AddWithValue("@AdmissionCharge", aModel.AdmissionCharge); cmd.Parameters.AddWithValue("@ContractAmount", aModel.ContractAmount); cmd.Parameters.AddWithValue("@R_Name_1", aModel.RName1); cmd.Parameters.AddWithValue("@Relation_1", aModel.Relation1); cmd.Parameters.AddWithValue("@R_Phone_1", aModel.RPhone1); cmd.Parameters.AddWithValue("@R_Name_2", aModel.RName2); cmd.Parameters.AddWithValue("@Relation_2", aModel.Relation2); cmd.Parameters.AddWithValue("@R_Phone_2", aModel.RPhone2); cmd.Parameters.AddWithValue("@RefDrId", aModel.RefDrId); cmd.Parameters.AddWithValue("@AdmitDrId", aModel.AdmitDrId); cmd.Parameters.AddWithValue("@UnderDrId", aModel.UnderDrId); cmd.Parameters.AddWithValue("@MpoId", aModel.MioId); cmd.Parameters.AddWithValue("@UserName", aModel.UserName); cmd.Parameters.AddWithValue("@BranchId", 1);//System.Web.HttpContext.Current.Session["BranchId"]); cmd.Parameters.AddWithValue("@Age", aModel.PtAgeDetail); cmd.Parameters.AddWithValue("@SubSubPnoId", aModel.SubSubPnoId); var ptIndoorId = (int)cmd.ExecuteScalar(); int regId = Convert.ToInt32(ReturnFieldValueOpenCon("tbl_IN_PATIENT_ADMISSION", "Id=" + ptIndoorId + "", "RegId", _trans)); //int subSubPnoId =Convert.ToInt32(ReturnFieldValueOpenCon("tbl_IN_BED_INFO", "Id=" + aModel.BedId + "", "DeptId", _trans)); _aLedgerInsertGateway.InsertLedgerOfAdmittedPatient(ptId, regId, ptIndoorId, 1941, aModel.AdmissionCharge, 1, 0, 0, aModel.AdmissionCharge, 0, 0, 0, 0, 0, aModel.SubSubPnoId, aModel.UserName, aModel.BedId, Convert.ToInt32(ReturnFieldValueOpenCon("tbl_IN_PATIENT_ADMISSION", "Id=" + ptIndoorId + "", "RefDrId", _trans)), Convert.ToInt32(ReturnFieldValueOpenCon("tbl_IN_PATIENT_ADMISSION", "Id=" + ptIndoorId + "", "AdmitDrId", _trans)), Convert.ToInt32(ReturnFieldValueOpenCon("tbl_IN_PATIENT_ADMISSION", "Id=" + ptIndoorId + "", "UnderDrId", _trans)), 0, 0, 0, 0, 0, "N/A", "N/A", "N/A", _trans, Con); _aLedgerInsertGateway.InsertLedgerOfAdmittedPatient(ptId, regId, ptIndoorId, 1942, aModel.BedCharge, 1, 0, 0, aModel.BedCharge, 0, 0, 0, 0, 0, aModel.SubSubPnoId, aModel.UserName, aModel.BedId, Convert.ToInt32(ReturnFieldValueOpenCon("tbl_IN_PATIENT_ADMISSION", "Id=" + ptIndoorId + "", "RefDrId", _trans)), Convert.ToInt32(ReturnFieldValueOpenCon("tbl_IN_PATIENT_ADMISSION", "Id=" + ptIndoorId + "", "AdmitDrId", _trans)), Convert.ToInt32(ReturnFieldValueOpenCon("tbl_IN_PATIENT_ADMISSION", "Id=" + ptIndoorId + "", "UnderDrId", _trans)), 0, 0, 0, 0, 0, "N/A", "N/A", "Bed Charge Of : " + ReturnFieldValueOpenCon("tbl_IN_BED_INFO", "Id=" + aModel.BedId + "", "Description", _trans), _trans, Con); _trans.Commit(); Con.Close(); DeleteInsert("Update tbl_IN_BED_INFO SET IsBooked=1 WHERE Id=" + aModel.BedId + ""); return(Task.FromResult <string>("Save uccess")); } catch (Exception exception) { if (Con.State == ConnectionState.Open) { Con.Close(); _trans.Rollback(); } return(Task.FromResult(exception.Message)); } }
public HttpResponseMessage Post([FromBody] AdmissionModel aModel) { var formatter = RequestFormat.JsonFormaterString(); return(Request.CreateResponse(HttpStatusCode.OK, _gt.SaveBedChange(aModel.PtIndoorId, aModel.BedCharge, aModel.BedId, aModel.UserName, aModel.Remarks), formatter)); }
public AdmissionInqueryPresenter(IAdmissionInqueryView view) { inquiryView = view; inquiryModel = new AdmissionModel(); }