//[Authorize(Roles ="SAdmin")] public async Task <HttpResponseMessage> ListForSA(MT_Staff_Members SMD) { Db = con.SurgeryCenterDb(SMD.Slug); StaffMResponse Response = new StaffMResponse(); try { List <MT_Staff_Members> AnesList = new List <MT_Staff_Members>(); MT_Staff_Members staff = new MT_Staff_Members(); Query docRef = Db.Collection("MT_Staff_Members").WhereEqualTo("Staff_Is_Deleted", false).WhereEqualTo("Staff_Created_By", SMD.Staff_Created_By); QuerySnapshot ObjQuerySnap = await docRef.GetSnapshotAsync(); if (ObjQuerySnap != null) { foreach (DocumentSnapshot Docsnapshot in ObjQuerySnap.Documents) { AnesList.Add(Docsnapshot.ConvertTo <MT_Staff_Members>()); } Response.DataList = AnesList.OrderBy(o => o.Staff_Name).ThenBy(o => o.Staff_Last_Name).ToList(); } Response.Status = con.StatusSuccess; Response.Message = con.MessageSuccess; } catch (Exception ex) { Response.Status = con.StatusFailed; Response.Message = con.MessageFailed + ", Exception : " + ex.Message; } return(ConvertToJSON(Response)); }
//[Authorize(Roles ="SAdmin")] public async Task <HttpResponseMessage> GetFormFilterWithSurgeryPhysicianCenterID(MT_Forms FMD) { Db = con.SurgeryCenterDb(FMD.Slug); FormsResponse Response = new FormsResponse(); try { List <MT_Forms> AnesList = new List <MT_Forms>(); Query docRef = Db.Collection("MT_Forms").WhereEqualTo("Form_Is_Deleted", false).WhereEqualTo("Form_Is_Active", true).WhereEqualTo("Form_Surgery_Physician_Id", FMD.Form_Surgery_Physician_Id); QuerySnapshot ObjQuerySnap = await docRef.GetSnapshotAsync(); if (ObjQuerySnap != null) { foreach (DocumentSnapshot Docsnapshot in ObjQuerySnap.Documents) { AnesList.Add(Docsnapshot.ConvertTo <MT_Forms>()); } Response.DataList = AnesList; } Response.Status = con.StatusSuccess; Response.Message = con.MessageSuccess; } catch (Exception ex) { Response.Status = con.StatusFailed; Response.Message = con.MessageFailed + ", Exception : " + ex.Message; } return(ConvertToJSON(Response)); }
//[Authorize(Roles ="SAdmin")] public async Task <HttpResponseMessage> GetDeletedList(MT_Religion NMD) { Db = con.SurgeryCenterDb(NMD.Slug); ReligionResponse Response = new ReligionResponse(); try { List <MT_Religion> AnesList = new List <MT_Religion>(); Query docRef = Db.Collection("MT_Religion").WhereEqualTo("Reli_Is_Deleted", true); QuerySnapshot ObjQuerySnap = await docRef.GetSnapshotAsync(); if (ObjQuerySnap != null) { foreach (DocumentSnapshot Docsnapshot in ObjQuerySnap.Documents) { AnesList.Add(Docsnapshot.ConvertTo <MT_Religion>()); } Response.DataList = AnesList.OrderBy(o => o.Reli_Name).ToList(); } Response.Status = con.StatusSuccess; Response.Message = con.MessageSuccess; } catch (Exception ex) { Response.Status = con.StatusFailed; Response.Message = con.MessageFailed + ", Exception : " + ex.Message; } return(ConvertToJSON(Response)); }
//[Authorize(Roles ="SAdmin")] public async Task <HttpResponseMessage> ListDD(MT_Anesthesia AMD) { Db = con.SurgeryCenterDb(AMD.Slug); AnesthesiaResponse Response = new AnesthesiaResponse(); try { List <MT_Anesthesia> AnesList = new List <MT_Anesthesia>(); Query docRef = Db.Collection("MT_Anesthesia").WhereEqualTo("Anes_Is_Deleted", false).WhereEqualTo("Anes_Is_Active", true).OrderBy("Anes_Name"); QuerySnapshot ObjQuerySnap = await docRef.GetSnapshotAsync(); if (ObjQuerySnap != null) { foreach (DocumentSnapshot Docsnapshot in ObjQuerySnap.Documents) { AnesList.Add(Docsnapshot.ConvertTo <MT_Anesthesia>()); } Response.DataList = AnesList; } Response.Status = con.StatusSuccess; Response.Message = con.MessageSuccess; } catch (Exception ex) { Response.Status = con.StatusFailed; Response.Message = con.MessageFailed + ", Exception : " + ex.Message; } return(ConvertToJSON(Response)); }
public async Task <HttpResponseMessage> GetInsurCompanyFilterWithName(MT_Insurance_Company ICMD) { Db = con.SurgeryCenterDb(ICMD.Slug); InsurCompanyResponse Response = new InsurCompanyResponse(); try { List <MT_Insurance_Company> InsuranceList = new List <MT_Insurance_Company>(); Query docRef = Db.Collection("MT_Insurance_Company").WhereEqualTo("INC_Is_Deleted", false).OrderBy("INC_Company_Name").StartAt(ICMD.INC_Company_Name.ToUpper()).EndAt(ICMD.INC_Company_Name.ToUpper() + '\uf8ff'); QuerySnapshot ObjQuerySnap = await docRef.GetSnapshotAsync(); if (ObjQuerySnap != null) { foreach (DocumentSnapshot Docsnapshot in ObjQuerySnap.Documents) { InsuranceList.Add(Docsnapshot.ConvertTo <MT_Insurance_Company>()); } Response.DataList = InsuranceList; Response.Message = con.MessageSuccess; Response.Status = con.StatusSuccess; } } catch (Exception ex) { Response.Status = con.StatusFailed; Response.Message = con.MessageFailed + ", Exception : " + ex.Message; } return(ConvertToJSON(Response)); }
public async Task <HttpResponseMessage> GetDeletedList(MT_Document_Category DCMD) { Db = con.SurgeryCenterDb(DCMD.Slug); DocuCategoryResponse Response = new DocuCategoryResponse(); try { List <MT_Document_Category> List = new List <MT_Document_Category>(); Query docRef = Db.Collection("MT_Document_Category").WhereEqualTo("DOC_Is_Deleted", true).OrderBy("DOC_Category"); QuerySnapshot ObjQuerySnap = await docRef.GetSnapshotAsync(); if (ObjQuerySnap != null) { foreach (DocumentSnapshot Docsnapshot in ObjQuerySnap.Documents) { List.Add(Docsnapshot.ConvertTo <MT_Document_Category>()); } Response.DataList = List; } Response.Status = con.StatusSuccess; Response.Message = con.MessageSuccess; } catch (Exception ex) { Response.Status = con.StatusFailed; Response.Message = con.MessageFailed + ", Exception : " + ex.Message; } return(ConvertToJSON(Response)); }
public async Task <HttpResponseMessage> List(MT_Patient_Form_Data PFMD) { Db = con.SurgeryCenterDb(PFMD.Slug); PatientFormResponse Response = new PatientFormResponse(); try { List <MT_Patient_Form_Data> patilist = new List <MT_Patient_Form_Data>(); Query ObjQuery = Db.Collection("MT_Patient_Form_Data").WhereEqualTo("PFD_Booking_ID", PFMD.PFD_Booking_ID); QuerySnapshot ObjQuerySnap = await ObjQuery.GetSnapshotAsync(); if (ObjQuerySnap != null) { foreach (DocumentSnapshot Docsnapshot in ObjQuerySnap.Documents) { patilist.Add(Docsnapshot.ConvertTo <MT_Patient_Form_Data>()); } Response.DataList = patilist; Response.Status = con.StatusSuccess; Response.Message = con.MessageSuccess; } else { Response.Status = con.StatusDNE; Response.Message = con.MessageDNE; } } catch (Exception ex) { Response.Status = con.StatusFailed; Response.Message = con.MessageFailed + ", Exception : " + ex.Message; } return(ConvertToJSON(Response)); }
//[Authorize(Roles ="SAdmin")] public async Task <HttpResponseMessage> GetPermission(MT_Role RMD) { Db = con.SurgeryCenterDb(RMD.Slug); RoleResponse Response = new RoleResponse(); try { List <MT_Role> AnesList = new List <MT_Role>(); Query docRef = Db.Collection("MT_Role").WhereEqualTo("ROM_Is_Deleted", false).WhereEqualTo("ROM_Is_Active", true).WhereEqualTo("ROM_Surgery_Physician_Center_ID", RMD.ROM_Surgery_Physician_Center_ID).WhereEqualTo("ROM_Office_Type", RMD.ROM_Office_Type); QuerySnapshot ObjQuerySnap = await docRef.GetSnapshotAsync(); if (ObjQuerySnap != null) { foreach (DocumentSnapshot Docsnapshot in ObjQuerySnap.Documents) { AnesList.Add(Docsnapshot.ConvertTo <MT_Role>()); } Response.DataList = AnesList.OrderBy(o => o.ROM_Name).ToList(); } Response.Status = con.StatusSuccess; Response.Message = con.MessageSuccess; } catch (Exception ex) { Response.Status = con.StatusFailed; Response.Message = con.MessageFailed + ", Exception : " + ex.Message; } return(ConvertToJSON(Response)); }
public async Task <HttpResponseMessage> VCListForPO(MT_Virtual_Consultant_Booking VCMD) { Db = con.SurgeryCenterDb(VCMD.Slug); VCBookingResponse Response = new VCBookingResponse(); try { List <MT_Virtual_Consultant_Booking> patilist = new List <MT_Virtual_Consultant_Booking>(); Query ObjQuery; if (VCMD.VCB_Booking_Physician_Office_ID == "0") { ObjQuery = Db.Collection("MT_Virtual_Consultant_Booking").WhereEqualTo("VCB_Is_Deleted", false); } else { ObjQuery = Db.Collection("MT_Virtual_Consultant_Booking").WhereEqualTo("VCB_Is_Deleted", false).WhereEqualTo("VCB_Booking_Physician_Office_ID", VCMD.VCB_Booking_Physician_Office_ID); } QuerySnapshot ObjQuerySnap = await ObjQuery.GetSnapshotAsync(); if (ObjQuerySnap != null) { foreach (DocumentSnapshot Docsnapshot in ObjQuerySnap.Documents) { if (VCMD.VCB_Booking_Physician_Office_ID != null) { if (Docsnapshot.ConvertTo <MT_Virtual_Consultant_Booking>().VCB_Status != "Draft" && Docsnapshot.ConvertTo <MT_Virtual_Consultant_Booking>().VCB_Status != "Cancelled" && Docsnapshot.ConvertTo <MT_Virtual_Consultant_Booking>().VCB_Status != "Complete") { patilist.Add(Docsnapshot.ConvertTo <MT_Virtual_Consultant_Booking>()); } } else if (VCMD.VCB_Booking_Physician_Office_ID == "0") { patilist.Add(Docsnapshot.ConvertTo <MT_Virtual_Consultant_Booking>()); } } Response.DataList = patilist.OrderBy(o => o.VCB_Booking_Date).ToList(); Response.Status = con.StatusSuccess; Response.Message = con.MessageSuccess; } else { Response.Status = con.StatusDNE; Response.Message = con.MessageDNE; } } catch (Exception ex) { Response.Status = con.StatusFailed; Response.Message = con.MessageFailed + ", Exception : " + ex.Message; } return(ConvertToJSON(Response)); }
//[Authorize(Roles ="SAdmin")] public async Task <HttpResponseMessage> LoginAsync(MT_User Objuser) { //Db = con.SurgeryCenterDb(Objuser.Project_ID); UserResponse Response = new UserResponse(); try { MT_User user = new MT_User(); Query colref = Db.Collection("MT_User").WhereEqualTo("UM_Is_Deleted", false).WhereEqualTo("UM_Is_Active", true); QuerySnapshot ObjDocSnap = await colref.GetSnapshotAsync(); if (ObjDocSnap != null) { foreach (DocumentSnapshot Docsnapshot in ObjDocSnap.Documents) { user = Docsnapshot.ConvertTo <MT_User>(); if (user != null) { if ((user.UM_Email.ToLower() == Objuser.UM_Email.ToLower() || user.UM_PhoneNo == Objuser.UM_PhoneNo) && user.UM_Password == Objuser.UM_Password) { Response.Data = user; Response.Status = con.StatusSuccess; Response.Message = con.MessageSuccess; } } else { Response.Data = null; Response.Status = con.StatusSuccess; Response.Message = con.MessageSuccess; } } } else { Response.Data = null; Response.Status = con.StatusSuccess; Response.Message = con.MessageSuccess; } } catch (Exception ex) { Response.Status = con.StatusFailed; Response.Message = con.MessageFailed + ", Exception : " + ex.Message; } return(ConvertToJSON(Response)); }
//[Authorize(Roles ="SAdmin")] public async Task <HttpResponseMessage> TruncateUserMaster() { //Db = con.SurgeryCenterDb(UMD.Project_ID); UserResponse Response = new UserResponse(); try { MT_User User = new MT_User(); CollectionReference docRef = Db.Collection("MT_User"); QuerySnapshot ObjQuerySnap = await docRef.GetSnapshotAsync(); if (ObjQuerySnap != null) { foreach (DocumentSnapshot Docsnapshot in ObjQuerySnap.Documents) { User = Docsnapshot.ConvertTo <MT_User>(); if (User.UM_Unique_ID != "28bLAlDi21ab1a937541a6") { DocumentReference DocRef = Db.Collection("MT_User").Document(User.UM_Unique_ID); WriteResult Result = await DocRef.DeleteAsync(); if (Result != null) { Response.Status = con.StatusSuccess; Response.Message = con.MessageSuccess; Response.Data = null; } } } } Response.Status = con.StatusSuccess; Response.Message = con.MessageSuccess; } catch (Exception ex) { Response.Status = con.StatusFailed; Response.Message = con.MessageFailed + ", Exception : " + ex.Message; } return(ConvertToJSON(Response)); }
public async Task <HttpResponseMessage> SubCategoryListDD(MT_KBCategory KCMD) { Db = con.SurgeryCenterDb(KCMD.Slug); KBCategoryResponse Response = new KBCategoryResponse(); try { List <MT_KBCategory> List = new List <MT_KBCategory>(); Query docRef = Db.Collection("MT_KBCategory").WhereEqualTo("KBC_Is_Deleted", false).WhereEqualTo("KBC_Is_Active", true).OrderBy("KBC_Category"); QuerySnapshot ObjQuerySnap = await docRef.GetSnapshotAsync(); if (ObjQuerySnap != null) { if (KCMD.KBC_Categories != null) { foreach (DocumentSnapshot Docsnapshot in ObjQuerySnap.Documents) { MT_KBCategory cate = Docsnapshot.ConvertTo <MT_KBCategory>(); foreach (string str in KCMD.KBC_Categories) { if (cate.KBC_Category == str && cate.KBC_Sub_Category != null) { List.Add(cate); } } } } Response.DataList = List; } Response.Status = con.StatusSuccess; Response.Message = con.MessageSuccess; } catch (Exception ex) { Response.Status = con.StatusFailed; Response.Message = con.MessageFailed + ", Exception : " + ex.Message; } return(ConvertToJSON(Response)); }
//[Authorize(Roles ="SAdmin")] public async Task <HttpResponseMessage> ListDD(MT_Pack Pck) { Db = con.SurgeryCenterDb(Pck.Slug); PackResponse Response = new PackResponse(); try { List <MT_Pack> AnesList = new List <MT_Pack>(); Query docRef = Db.Collection("MT_Pack").WhereEqualTo("Pack_Is_Deleted", false).WhereEqualTo("Pack_Is_Active", true); QuerySnapshot ObjQuerySnap = await docRef.GetSnapshotAsync(); if (ObjQuerySnap != null) { foreach (DocumentSnapshot Docsnapshot in ObjQuerySnap.Documents) { if (Pck.Pack_Surgery_Physician_Id != "28bLAlDi21ab1a937541a6") { if (Docsnapshot.ConvertTo <MT_Pack>().Pack_Surgery_Physician_Id == "28bLAlDi21ab1a937541a6" || Docsnapshot.ConvertTo <MT_Pack>().Pack_Surgery_Physician_Id == Pck.Pack_Surgery_Physician_Id || Docsnapshot.ConvertTo <MT_Pack>().Pack_Surgery_Physician_Id == Pck.Pack_SC_Id) { AnesList.Add(Docsnapshot.ConvertTo <MT_Pack>()); } } else { AnesList.Add(Docsnapshot.ConvertTo <MT_Pack>()); } } Response.DataList = AnesList.OrderBy(o => o.Pack_Name).ToList(); } Response.Status = con.StatusSuccess; Response.Message = con.MessageSuccess; } catch (Exception ex) { Response.Status = con.StatusFailed; Response.Message = con.MessageFailed + ", Exception : " + ex.Message; } return(ConvertToJSON(Response)); }
//[Authorize(Roles ="SAdmin")] public async Task <HttpResponseMessage> GetAlertListFilterWithSCPO(MT_Alert AMD) { Db = con.SurgeryCenterDb(AMD.Slug); AlertResponse Response = new AlertResponse(); try { List <MT_Alert> AnesList = new List <MT_Alert>(); MT_Alert Alert = new MT_Alert(); Query docRef = Db.Collection("MT_Alert").WhereEqualTo("Alert_Is_Deleted", false).WhereEqualTo("Alert_Is_Active", true).OrderBy("Alert_Name"); QuerySnapshot ObjQuerySnap = await docRef.GetSnapshotAsync(); if (ObjQuerySnap != null) { foreach (DocumentSnapshot Docsnapshot in ObjQuerySnap.Documents) { Alert = Docsnapshot.ConvertTo <MT_Alert>(); if (AMD.Alert_Surgery_Physician_Id == Alert.Alert_Surgery_Physician_Id) { AnesList.Add(Alert); } else if (Alert.Alert_Surgery_Physician_Id == "0") { AnesList.Add(Alert); } } Response.DataList = AnesList.OrderBy(o => o.Alert_Name).ToList(); } Response.Status = con.StatusSuccess; Response.Message = con.MessageSuccess; } catch (Exception ex) { Response.Status = con.StatusFailed; Response.Message = con.MessageFailed + ", Exception : " + ex.Message; } return(ConvertToJSON(Response)); }