Пример #1
0
    private void BindGrid()
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }

        _ReqDocBO = new Bill_Sys_RequiredDocumentBO();

        try
        {
            DataSet objds = new DataSet();
            if ((txtFromDate.Text != "" && txtToDate.Text != "") && (extddlSpeciality.Text == "NA" || extddlSpeciality.Text == ""))
            {
                objds = _ReqDocBO.GetBillReportsByDate(txtCompanyID.Text, txtFromDate.Text, txtToDate.Text);
            }
            else if ((txtFromDate.Text == "" && txtToDate.Text == "") && (extddlSpeciality.Text != "NA"))
            {
                objds = _ReqDocBO.GetBillReportsBySpecialty(txtCompanyID.Text, extddlSpeciality.Text);
            }
            else if ((txtFromDate.Text != "" && txtToDate.Text != "") && (extddlSpeciality.Text != "NA"))
            {
                objds = _ReqDocBO.GetBillReportsByDateAndSpecialty(txtCompanyID.Text, txtFromDate.Text, txtToDate.Text, extddlSpeciality.Text);
            }
            else
            {
                objds = _ReqDocBO.GetBillReports(txtCompanyID.Text, txtFromDate.Text, txtToDate.Text, extddlSpeciality.Text);
            }
            //objds.Tables[0].Columns[13].ColumnMapping= System.Data.MappingType.Hidden;
            grdPacketing.DataSource = objds;
            grdExel.DataSource      = objds;
            grdPacketing.DataBind();
            grdExel.DataBind();
            Session["DataBind"] = objds;
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }

        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
Пример #2
0
    //end

    protected void grdPacketing_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        _ReqDocBO = new Bill_Sys_RequiredDocumentBO();
        _ReqDocEO = new REQUIREDDOCUMENT_EO();
        ArrayList objarr         = new ArrayList();
        string    szOpenFilePath = "";
        string    _CompanyName   = "";
        int       index          = 0;

        try
        {
            #region "Create Packet"
            if (e.CommandName.ToString() == "CreatePacket")
            {
                if (!txtPacketId.Text.Equals(""))
                {
                    index        = Convert.ToInt32(e.CommandArgument);
                    _CompanyName = Convert.ToString(((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME);
                    objarr.Add(grdPacketing.DataKeys[index][0].ToString()); //caseID
                    objarr.Add(grdPacketing.DataKeys[index][1].ToString()); //Bill Number
                    objarr.Add(txtCompanyID.Text);                          //companyID
                    objarr.Add(_CompanyName);                               //companyName
                    _ReqDocEO            = _ReqDocBO.CheckExists(objarr);
                    Session["PacketDoc"] = objarr;

                    if (_ReqDocEO.SZ_ERROR_MSG != "")
                    {
                        msgPatientExists.InnerHtml = _ReqDocEO.SZ_ERROR_MSG;
                        //Page.RegisterStartupScript("mm", "<script language='javascript'>openExistsPage();</script>");
                        ScriptManager.RegisterClientScriptBlock(this, GetType(), "mm", "openExistsPage();", true);
                    }
                    else
                    {
                        _ReqDocEO = _ReqDocBO.MergeDocument(objarr);
                        ///set paket bill status id to bill number --atul
                        Bill_Sys_RequiredDocumentBO objDocumentBO1 = new Bill_Sys_RequiredDocumentBO();
                        objDocumentBO1.Set_PacketId(txtCompanyID.Text, grdPacketing.DataKeys[index][1].ToString(), txtPacketId.Text, ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID);
                        BindGrid();
                    }

                    if (_ReqDocEO.SZ_OPEN_FILE_PATH != "")
                    {
                        szOpenFilePath = _ReqDocEO.SZ_OPEN_FILE_PATH;
                        szOpenFilePath = ConfigurationSettings.AppSettings["DocumentManagerURL"].ToString() + szOpenFilePath;
                        //Page.ClientScript.RegisterClientScriptBlock(typeof(GridView), "Msg", "window.open('" + szOpenFilePath.ToString() + "'); ", true);
                        ScriptManager.RegisterClientScriptBlock(this, GetType(), "Msg", "window.open('" + szOpenFilePath.ToString() + "'); ", true);
                    }
                }
                else
                {
                    msgPatientExists.InnerHtml = "You don't have bill status for packeting,you can not create packet.Please enter bill status for packeting.";
                    Page.RegisterStartupScript("mm", "<script language='javascript'>openExistsPage();</script>");
                }
            }
            #endregion

            #region "Grid Sort"

            DataView dv;
            DataSet  ds = new DataSet();
            ds = (DataSet)Session["DataBind"];
            dv = ds.Tables[0].DefaultView;

            if (e.CommandName.ToString() == "Bill No")
            {
                if (txtSort.Text == e.CommandArgument + " ASC")
                {
                    txtSort.Text = e.CommandArgument + "  DESC";
                }
                else
                {
                    txtSort.Text = e.CommandArgument + " ASC";
                }
            }
            else if (e.CommandName.ToString() == "Bill Date")
            {
                if (txtSort.Text == e.CommandArgument + " ASC")
                {
                    txtSort.Text = e.CommandArgument + " DESC";
                }
                else
                {
                    txtSort.Text = e.CommandArgument + " ASC";
                }
            }
            else if (e.CommandName.ToString() == "Chart No")
            {
                if (txtSort.Text == e.CommandArgument + " ASC")
                {
                    txtSort.Text = e.CommandArgument + " DESC";
                }
                else
                {
                    txtSort.Text = e.CommandArgument + " ASC";
                }
            }
            else if (e.CommandName.ToString() == "Patient Name")
            {
                if (txtSort.Text == e.CommandArgument + " ASC")
                {
                    txtSort.Text = e.CommandArgument + " DESC";
                }
                else
                {
                    txtSort.Text = e.CommandArgument + " ASC";
                }
            }
            else if (e.CommandName.ToString() == "Reffering Office")
            {
                if (txtSort.Text == e.CommandArgument + " ASC")
                {
                    txtSort.Text = e.CommandArgument + " DESC";
                }
                else
                {
                    txtSort.Text = e.CommandArgument + " ASC";
                }
            }
            else if (e.CommandName.ToString() == "Insurance Company")
            {
                if (txtSort.Text == e.CommandArgument + " ASC")
                {
                    txtSort.Text = e.CommandArgument + " DESC";
                }
                else
                {
                    txtSort.Text = e.CommandArgument + " ASC";
                }
            }
            else if (e.CommandName.ToString() == "Insurance Claim No")
            {
                if (txtSort.Text == e.CommandArgument + " ASC")
                {
                    txtSort.Text = e.CommandArgument + " DESC";
                }
                else
                {
                    txtSort.Text = e.CommandArgument + " ASC";
                }
            }
            else if (e.CommandName.ToString() == "Speciality")
            {
                if (txtSort.Text == e.CommandArgument + " ASC")
                {
                    txtSort.Text = e.CommandArgument + " DESC";
                }
                else
                {
                    txtSort.Text = e.CommandArgument + " ASC";
                }
            }
            else if (e.CommandName.ToString() == "Case No")
            {
                if (txtSort.Text == e.CommandArgument + " ASC")
                {
                    txtSort.Text = e.CommandArgument + " DESC";
                }
                else
                {
                    txtSort.Text = e.CommandArgument + " ASC";
                }
            }
            else if (e.CommandName.ToString() == "Bill Amt")
            {
                if (txtSort.Text == e.CommandArgument + " ASC")
                {
                    txtSort.Text = e.CommandArgument + " DESC";
                }
                else
                {
                    txtSort.Text = e.CommandArgument + " ASC";
                }
            }

            dv.Sort = txtSort.Text;
            grdPacketing.DataSource = dv;
            grdExel.DataSource      = dv;
            grdExel.DataBind();
            grdPacketing.DataBind();
            #endregion

            if (e.CommandName.ToString() == "PLS")
            {
                index = Convert.ToInt32(e.CommandArgument);
                string divname = "div";

                divname = divname + grdPacketing.DataKeys[index][0].ToString();
                GridView   gv    = (GridView)grdPacketing.Rows[index].FindControl("GridView2");
                LinkButton plus  = (LinkButton)grdPacketing.Rows[index].FindControl("lnkP");
                LinkButton minus = (LinkButton)grdPacketing.Rows[index].FindControl("lnkM");

                _ReqDocBO = new Bill_Sys_RequiredDocumentBO();
                DataSet objds = new DataSet();
                objds = _ReqDocBO.GetBillReports(txtCompanyID.Text, txtFromDate.Text, txtToDate.Text, "PG000000000000000164");


                gv.DataSource = objds;
                gv.DataBind();
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "mp", "ShowChildGrid('" + divname + "') ;", true);
                plus.Visible  = false;
                minus.Visible = true;
            }
            if (e.CommandName.ToString() == "MNS")
            {
                index = Convert.ToInt32(e.CommandArgument);
                string divname = "div";

                divname = divname + grdPacketing.DataKeys[index][0].ToString();
                LinkButton plus  = (LinkButton)grdPacketing.Rows[index].FindControl("lnkP");
                LinkButton minus = (LinkButton)grdPacketing.Rows[index].FindControl("lnkM");


                ScriptManager.RegisterClientScriptBlock(this, GetType(), "mm", "HideChildGrid('" + divname + "') ;", true);
                plus.Visible  = true;
                minus.Visible = false;
            }
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }

        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }