protected void btnSearch_Click(object sender, EventArgs e) { txtSort.Text = ""; int i = new int(); //bind grid according Search condition if (!txtFromDate.Text.Trim().Equals("") && !txtToDate.Text.Trim().Equals("")) { i = DateTime.Compare(Convert.ToDateTime(txtToDate.Text), Convert.ToDateTime(txtFromDate.Text)); } if (i.Equals(1) || i.Equals(0)) { string szCmpId = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID.ToString(); Bill_Sys_ReportBO objReport = new Bill_Sys_ReportBO(); DataSet dsOfficeName1 = new DataSet(); dsOfficeName1 = objReport.GetReceived_Report(szCmpId, txtFromDate.Text, txtToDate.Text, txtPatientName.Text, ddlOffice.SelectedValue); #region " default viwe of grid sor by ascending order of date" DataView dv2; dv2 = dsOfficeName1.Tables[0].DefaultView; dv2.Sort = "DATE_OF_REFERRAL_PROC ,PATIENT_NAME ASC"; grdReceivedeport.DataSource = dv2; grdExel.DataSource = dv2; Session["OfficeData"] = dsOfficeName1; grdReceivedeport.DataBind(); grdExel.DataBind(); if ((((Bill_Sys_SystemObject)Session["SYSTEM_OBJECT"]).SZ_CHART_NO != "1")) { grdReceivedeport.Columns[2].Visible = false; grdExel.Columns[2].Visible = false; } #endregion } else { lblMsg.Text = " To date must be greater than From date"; } }
protected void btnRevert_Click(object sender, EventArgs e) { //revert the recored for (int j = 0; j < grdReceivedeport.Items.Count; j++) { CheckBox chkDelete1 = (CheckBox)grdReceivedeport.Items[j].FindControl("chkUpdateStatus"); if (chkDelete1.Checked) { Bill_Sys_ReportBO objUpdateReport = new Bill_Sys_ReportBO(); objUpdateReport.RevertReport(Convert.ToInt32(grdReceivedeport.Items[j].Cells[10].Text.Trim().ToString())); } } //binding grid agin whith new value string szCmpId = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID.ToString(); Bill_Sys_ReportBO objReport = new Bill_Sys_ReportBO(); DataSet dsOfficeName1 = new DataSet(); dsOfficeName1 = objReport.GetReceived_Report(szCmpId, txtFromDate.Text, txtToDate.Text, txtPatientName.Text, ddlOffice.SelectedValue); DataView dv1; dv1 = dsOfficeName1.Tables[0].DefaultView; dv1.Sort = "DATE_OF_REFERRAL_PROC,PATIENT_NAME ASC"; grdReceivedeport.DataSource = dv1; grdExel.DataSource = dv1; Session["OfficeData"] = dsOfficeName1; grdReceivedeport.DataBind(); grdExel.DataBind(); if ((((Bill_Sys_SystemObject)Session["SYSTEM_OBJECT"]).SZ_CHART_NO != "1")) { grdReceivedeport.Columns[2].Visible = false; grdExel.Columns[2].Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { btnRevert.Attributes.Add("onclick", "return ChekOne();"); lblMsg.Text = ""; if (!IsPostBack) {//bind office name to ddlOffice DataSet dsOfficeName = new DataSet(); string szCmpId = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID.ToString(); Bill_Sys_ReportBO objReport = new Bill_Sys_ReportBO(); dsOfficeName = objReport.GetOfficeName(szCmpId); ddlOffice.DataSource = dsOfficeName.Tables[0]; ddlOffice.DataTextField = "SZ_OFFICE"; ddlOffice.DataValueField = "SZ_OFFICE_ID"; ddlOffice.DataBind(); ddlOffice.Items.Insert(0, "--select--"); //bind gride DataSet dsOfficeName1 = new DataSet(); dsOfficeName1 = objReport.GetReceived_Report(szCmpId, "", "", "", "--select--"); #region " default viwe of grid sor by ascending order of date" DataView dv1; dv1 = dsOfficeName1.Tables[0].DefaultView; dv1.Sort = "DATE_OF_REFERRAL_PROC,PATIENT_NAME ASC"; grdReceivedeport.DataSource = dv1; grdExel.DataSource = dv1; Session["OfficeData"] = dsOfficeName1; grdReceivedeport.DataBind(); grdExel.DataBind(); #endregion if ((((Bill_Sys_SystemObject)Session["SYSTEM_OBJECT"]).SZ_CHART_NO != "1")) { grdReceivedeport.Columns[2].Visible = false; grdExel.Columns[2].Visible = false; } } }