protected void rgAdminSMS_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; switch (e.DetailTableView.Name) { case "AccountType": { int LoginId = Convert.ToInt32(dataItem.GetDataKeyValue("LoginId")); e.DetailTableView.DataSource = new AdministrationBAL().GetAccountType(LoginId); break; } case "Account": { int LoginId = Convert.ToInt32(dataItem.GetDataKeyValue("LoginId")); int AccountTypeId = Convert.ToInt32(dataItem.GetDataKeyValue("AccountTypeId")); DataTable dtAccountType = new AdministrationBAL().GetSMSDetails(LoginId, AccountTypeId); foreach (DataRow dr in dtAccountType.Rows) { dr["CreatedOn"] = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(Convert.ToDateTime(dr["CreatedOn"]), "India Standard Time"); } e.DetailTableView.DataSource = dtAccountType; //e.DetailTableView.DataSource = new AdministrationBAL().GetSMSDetails(LoginId, AccountTypeId); break; } } }
protected void rgAdminListDiagnosis_InsertCommand(object source, GridCommandEventArgs e) { GridEditableItem dataItem = (GridEditableItem)e.Item; int diagnosisId = 0; TextBox txtDiagnosis = (TextBox)dataItem["Diagnosis"].Controls[0]; TextBox txtDescription = (TextBox)dataItem["Description"].Controls[0]; if (txtDiagnosis.Text == string.Empty || txtDescription.Text == string.Empty) { ShowAlertMessage("Please enter the diagnosis and description to add!"); } else { int IsSaved = new AdministrationBAL().InsertDiagnosis(diagnosisId, txtDiagnosis.Text, txtDescription.Text); if (IsSaved < 0) { ShowAlertMessage("Entered Diagnosis is already exists!"); } else { ShowAlertMessage("New Diagnosis Saved successfully!"); } } BindDiagnosis(false); }
private void BindPatientSearch(bool isBind) { DataTable dtPatientSearch = new AdministrationBAL().GetSearchCount(); rgAdminPatientSearchView.DataSource = dtPatientSearch; if (!isBind) { rgAdminPatientSearchView.DataBind(); } }
private void BindAppointment(bool isBind) { DataTable dtDeletedDoctorView = new AdministrationBAL().OrganizationNoDoctors(); rgAdminOrgNoDoctor.DataSource = dtDeletedDoctorView; if (!isBind) { rgAdminOrgNoDoctor.DataBind(); } }
private void BindDepartment(bool IsRebind) { DataTable dtDepartment = new AdministrationBAL().GetDepartment(); rgAdminListDepartment.DataSource = dtDepartment; if (!IsRebind) { rgAdminListDepartment.DataBind(); } }
private void BindAppointment(bool isBind) { DataTable dtDeletedDoctorView = new AdministrationBAL().NoProfile(); rgAdminNoProfileView.DataSource = dtDeletedDoctorView; if (!isBind) { rgAdminNoProfileView.DataBind(); } }
private void BindDiagnosis(bool IsRebind) { DataTable dtDiagnosis = new AdministrationBAL().GetDiagnosis(); rgAdminListDiagnosis.DataSource = dtDiagnosis; if (!IsRebind) { rgAdminListDiagnosis.DataBind(); } }
private void BindSymptom(bool IsRebind) { DataTable dtSymptom = new AdministrationBAL().GetSymptom(); rgAdminListSymptom.DataSource = dtSymptom; if (!IsRebind) { rgAdminListSymptom.DataBind(); } }
private DataTable GetAccountType(int LoginId) { DataTable dtAccountType = new AdministrationBAL().GetAccountTypeByLoginView(); DataRow[] dr = dtAccountType.Select("LoginId=" + LoginId.ToString()); DataTable dtvalid = dtAccountType.Clone(); dtvalid = dr.CopyToDataTable(); return(dtvalid); }
protected void rgAdminListDiagnosis_DeleteCommand(object source, GridCommandEventArgs e) { GridDataItem dataItem = (GridDataItem)e.Item; int diagnosisId = Convert.ToInt32(dataItem.GetDataKeyValue("DiagnosisId").ToString()); bool IsDeleted = Convert.ToBoolean(dataItem["IsDeleted"].Text); int isDeleted = new AdministrationBAL().DeleteDepartmentDiagnosisSymptomByDirectId(diagnosisId, diagnosisType);// for diagnosis type is 1 BindDiagnosis(false); if (isDeleted > 0) { ShowAlertMessage("Deleted Successfully!"); } }
protected void btnAddTreatment_Click(object sender, EventArgs e) { string[] treatment = null; if (rtbtreatment.Text.Trim() != string.Empty) { if (ddlDepartment.SelectedIndex > 0) { int i = 0; int IsSaved = 0; treatment = rtbtreatment.Text.ToString().Split(','); for ( ; i < treatment.Length; i++) { IsSaved = new AdministrationBAL().InsertTreatment(Convert.ToInt32(ddlDepartment.SelectedItem.Value), treatment[i].ToString().Trim()); if (IsSaved < 0) { ShowAlertMessage("Entered treatment (" + treatment[i].ToString() + ") already exists!"); break; } else { continue; } } if ((i == treatment.Length) && IsSaved > 0) { ShowAlertMessage("New treatment saved successfully!"); rtbtreatment.Text = ""; LoadSelectedTreatment(); } } else { cvAddTreatment.ErrorMessage = "Please select one department to map these treatment(s)!"; cvAddTreatment.IsValid = false; return; } } else { cvAddTreatment.ErrorMessage = "Please enter treatment(s) to add!"; cvAddTreatment.IsValid = false; return; } }
private void BindAdminDetail() { try { DataTable dtAdminHospitalDetail = new AdministrationBAL().GetOrganizationByOrganizationId(Convert.ToInt32(ddlHospitalView.SelectedValue)); if (dtAdminHospitalDetail.Rows.Count > 0) { _HospitalAdminName = dtAdminHospitalDetail.Rows[0]["AdminName"].ToString(); _HospitalAdminEmail = dtAdminHospitalDetail.Rows[0]["EmailId"].ToString(); _HospitalAdminMobile = dtAdminHospitalDetail.Rows[0]["MobileId"].ToString(); } } catch { } }
protected void lnkActivation_OnUpdate(object sender, CommandEventArgs e) { if (e.CommandArgument.ToString().Length > 0) { string[] cmd = e.CommandArgument.ToString().Split(','); int id = Convert.ToInt32(cmd[0]); int type = Convert.ToInt32(cmd[1]); string message = new AdministrationBAL().ActivateLoginById(id, type); BindLoginDetail(false); ShowAlertMessage(message + " Successfully!"); } }
private void BindIndividualSMSSearch(bool isBind) { DataTable dtIndividualSMS = new AdministrationBAL().GetSMSIndividual(); foreach (DataRow dr in dtIndividualSMS.Rows) { dr["CreatedOn"] = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(Convert.ToDateTime(dr["CreatedOn"]), "India Standard Time"); } dtIndividualSMS.AcceptChanges(); rgSMSIndividual.DataSource = dtIndividualSMS; if (!isBind) { rgSMSIndividual.DataBind(); } }
private void BindPatientSearch(bool isBind) { DataTable dtRemainderSMS = new AdministrationBAL().GetRemainderSMS(); foreach (DataRow dr in dtRemainderSMS.Rows) { dr["Sent On"] = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(Convert.ToDateTime(dr["Sent On"]), "India Standard Time"); } dtRemainderSMS.AcceptChanges(); rgRemainderSMS.DataSource = dtRemainderSMS; if (!isBind) { rgRemainderSMS.DataBind(); } }
protected void btnDeleteDepartment_Click(object sender, EventArgs e) { if (ddlDepartment.SelectedIndex > 0) { int isDeleted = new AdministrationBAL().DeleteDepartmentDiagnosisSymptomByDirectId(Convert.ToInt32(ddlDepartment.SelectedValue), 0); //for department type is 0 } else { cvDeleteDepartment.ErrorMessage = "Please select one department from Department list to delete."; cvDeleteDepartment.IsValid = false; } rlbSelectedSymptomList.Items.Clear(); rlbSelectedDiagnosisList.Items.Clear(); rlbTreatmentList.Items.Clear(); BindDepartment(); }
protected void btnAddNewSymptom_Click(object sender, EventArgs e) { if (txtSymptom.Text != string.Empty && txtDescriptionSymptom.Text != string.Empty) { int isSaved = new AdministrationBAL().InsertSymptom(0, txtSymptom.Text, txtDescriptionSymptom.Text); if (isSaved < 0) { cvNewSymptom.IsValid = false; } } else { cvEmptySymptom.IsValid = false; } txtSymptom.Text = ""; txtDescriptionSymptom.Text = ""; BindSymptom(); }
protected void btnAddNewDepartments_Click(object sender, EventArgs e) { if (txtDepartment.Text != string.Empty && txtDescriptionDepartment.Text != string.Empty) { int isSaved = new AdministrationBAL().InsertDepartment(0, txtDepartment.Text, txtDescriptionDepartment.Text); if (isSaved < 0) { cvNewDepartment.IsValid = false; } } else { cvEmptyDepatment.IsValid = false; } txtDepartment.Text = ""; txtDescriptionDepartment.Text = ""; BindDepartment(); }
private void LoadSelectedTreatment() { lblInfo.Visible = false; lblInfoSymptom.Visible = false; btnSaveSymptom.Visible = false; btnSave.Visible = false; rlbTreatmentList.Items.Clear(); int departmentId = Convert.ToInt32(ddlDepartment.SelectedItem.Value); DataTable dtTreatment = new AdministrationBAL().GetTreatmentByDepartmentId(departmentId); rlbTreatmentList.DataSource = dtTreatment; rlbTreatmentList.DataTextField = "Diagnosis"; rlbTreatmentList.DataValueField = "DiagnosisId"; rlbTreatmentList.DataBind(); SortTreatment(); }
protected void btnDeleteSymptom_Click(object sender, EventArgs e) { if (rlbSymptomList.SelectedItems.Count > 0) { foreach (RadListBoxItem list in rlbSymptomList.SelectedItems) { if (list.Selected) { int isDeleted = new AdministrationBAL().DeleteDepartmentDiagnosisSymptomByDirectId(Convert.ToInt32(list.Value), 2); //for symptoms type is 2 } } } else { cvDeleteSymptom.ErrorMessage = "Please select a symptom from Symptoms list to delete."; cvDeleteSymptom.IsValid = false; } BindSymptom(); }
protected void btnDeleteTreatment_Click(object sender, EventArgs e) { if (rlbTreatmentList.SelectedItems.Count > 0) { foreach (RadListBoxItem list in rlbTreatmentList.SelectedItems) { if (list.Selected) { int isDeleted = new AdministrationBAL().DeleteDepartmentDiagnosisSymptomByDirectId(Convert.ToInt32(list.Value), 1); //for diagnosis type is 1 LoadSelectedTreatment(); } } } else { cvDeleteTreatment.ErrorMessage = "Please select a treatment from the treatment list to delete."; cvDeleteTreatment.IsValid = false; } }
protected void rgAdminHospitalList_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e) { GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; string mobileId = dataItem.GetDataKeyValue("Mobile").ToString(); DataTable dtDepartment = new AdministrationBAL().GetExistingHospital(mobileId); dtDepartment.Columns.Add("Address", typeof(string)); foreach (DataRow dr in dtDepartment.Rows) { if (!string.IsNullOrEmpty(dr["AddressLine"].ToString())) { dr["Address"] += dr["AddressLine"].ToString(); } if (!string.IsNullOrEmpty(dr["CityName"].ToString())) { dr["Address"] += ", " + dr["CityName"].ToString(); } if (!string.IsNullOrEmpty(dr["StateName"].ToString())) { dr["Address"] += ", " + dr["StateName"].ToString(); } if (!string.IsNullOrEmpty(dr["CountryName"].ToString())) { dr["Address"] += ", " + dr["CountryName"].ToString(); } if (!string.IsNullOrEmpty(dr["PostalCode"].ToString())) { dr["Address"] += ", " + dr["PostalCode"].ToString(); } } dtDepartment.AcceptChanges(); e.DetailTableView.DataSource = dtDepartment; //if (!IsRebind) // rgAdminHospitalList.DataBind(); }
private void BindHospital(bool IsRebind) { DataTable dtDepartment = new AdministrationBAL().GetHospital(); dtDepartment.Columns.Add("Address", typeof(string)); foreach (DataRow dr in dtDepartment.Rows) { if (!string.IsNullOrEmpty(dr["AddressLine"].ToString())) { dr["Address"] += dr["AddressLine"].ToString(); } if (!string.IsNullOrEmpty(dr["CityName"].ToString())) { dr["Address"] += ", " + dr["CityName"].ToString(); } if (!string.IsNullOrEmpty(dr["StateName"].ToString())) { dr["Address"] += ", " + dr["StateName"].ToString(); } if (!string.IsNullOrEmpty(dr["CountryName"].ToString())) { dr["Address"] += ", " + dr["CountryName"].ToString(); } if (!string.IsNullOrEmpty(dr["PostalCode"].ToString())) { dr["Address"] += ", " + dr["PostalCode"].ToString(); } } dtDepartment.AcceptChanges(); rgAdminHospitalList.DataSource = dtDepartment; if (!IsRebind) { rgAdminHospitalList.DataBind(); } }
private DataTable GetLoginTable(int LoginId, int AccountTypeId) { DataTable dtLoginView = new AdministrationBAL().GetLoginTypeById(); DataRow[] drLogin = dtLoginView.Select("LoginId=" + LoginId.ToString() + " AND " + "Type=" + AccountTypeId.ToString()); DataTable dtLogin = null; if (drLogin.Length > 0) { dtLogin = dtLoginView.Clone(); dtLogin = drLogin.CopyToDataTable(); } else { dtLogin = dtLoginView.Clone(); } return(dtLogin); }
private void BindHospital() { DataTable dtHospital = new AdministrationBAL().GetHospitalList(); foreach (DataRow dr in dtHospital.Rows) { dr["OrganizationName"] += " ("; dr["OrganizationName"] += dr["CountryName"].ToString(); dr["OrganizationName"] += (!string.IsNullOrEmpty(dr["StateName"].ToString())) ? ", " + dr["StateName"].ToString() : string.Empty; dr["OrganizationName"] += (!string.IsNullOrEmpty(dr["CityName"].ToString())) ? ", " + dr["CityName"].ToString() : string.Empty; dr["OrganizationName"] += ")"; } dtHospital.AcceptChanges(); ddlHospitalView.DataSource = dtHospital; ddlHospitalView.DataTextField = "OrganizationName"; ddlHospitalView.DataValueField = "OrganizationId"; ddlHospitalView.DataBind(); //ddlHospitalView.Items.Insert(0, new ListItem("-------------------------------------Select Hospital-----------------------------------------------", "0")); //ddlHospitalView.SelectedIndex = 0; }
protected void btnDeleteDiagnosis_Click(object sender, EventArgs e) { if (rlbDiagnosisList.SelectedItems.Count > 0) { foreach (RadListBoxItem list in rlbDiagnosisList.SelectedItems) { if (list.Selected) { int isDeleted = new AdministrationBAL().DeleteDepartmentDiagnosisSymptomByDirectId(Convert.ToInt32(list.Value), 1); //for diagnosis type is 1 } } } else { cvDeleteDiagnosis.ErrorMessage = "Please select a diagnosis from Diagnosis list to delete."; cvDeleteDiagnosis.IsValid = false; } rlbSelectedSymptomList.Items.Clear(); rlbSelectedDiagnosisList.Items.Clear(); BindDiagnosis(); }
private void BindAppointment(bool isBind) { DataTable dtAppointmentView = new AdministrationBAL().GetAppointmentview(); foreach (DataRow drAppointmentView in dtAppointmentView.Rows) { if (!string.IsNullOrEmpty(drAppointmentView["ScheduleAddress"].ToString())) { drAppointmentView["ScheduleAddress"] = drAppointmentView["ScheduleAddress"].ToString().Replace("\r\n\r\n", "\n").Replace("\r\n", "\n").Replace("\n\n", "\n").Replace("\n", ", \n"); } else { StringBuilder ScheduleAddress = new StringBuilder(); ScheduleAddress.AppendLine(drAppointmentView["OrganizationName"].ToString()); ScheduleAddress.AppendLine((!string.IsNullOrEmpty(drAppointmentView["AddressLine2"].ToString())) ? " \n" + drAppointmentView["AddressLine1"].ToString() + " \n" + drAppointmentView["AddressLine2"].ToString() : " \n" + drAppointmentView["AddressLine1"].ToString()); ScheduleAddress.AppendLine((!string.IsNullOrEmpty(drAppointmentView["CityName"].ToString())) ? " \n" + drAppointmentView["CityName"].ToString() : string.Empty); ScheduleAddress.AppendLine((!string.IsNullOrEmpty(drAppointmentView["StateName"].ToString())) ? " \n" + drAppointmentView["StateName"].ToString() : string.Empty); ScheduleAddress.AppendLine((!string.IsNullOrEmpty(drAppointmentView["CountryName"].ToString())) ? " \n" + drAppointmentView["CountryName"].ToString() : string.Empty); ScheduleAddress.AppendLine((!string.IsNullOrEmpty(drAppointmentView["PostalCode"].ToString())) ? " \nPostalCode:" + drAppointmentView["PostalCode"].ToString() : string.Empty); ScheduleAddress.AppendLine((!string.IsNullOrEmpty(drAppointmentView["Phone"].ToString())) ? " \nPhone: " + drAppointmentView["Phone"].ToString() : string.Empty); drAppointmentView["ScheduleAddress"] = ScheduleAddress.ToString(); } drAppointmentView["CreatedOn"] = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(Convert.ToDateTime(drAppointmentView["CreatedOn"]), "India Standard Time"); } dtAppointmentView.AcceptChanges(); rgAdminAppointmentView.DataSource = dtAppointmentView; if (!isBind) { rgAdminAppointmentView.DataBind(); } }