protected void btnDownload_Click(object sender, EventArgs e)
    {
        ArrayList list2 = new ArrayList();
        string    str   = this.Page.Request.ServerVariables["REMOTE_ADDR"].ToString();
        string    str2  = ((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ID;
        string    str3  = ((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_NAME;

        for (int i = 0; i < this.grdBillSearch.Rows.Count; i++)
        {
            CheckBox box = (CheckBox)this.grdBillSearch.Rows[i].FindControl("ChkselectBllno");
            if (box.Checked)
            {
                DAO_PatientList list = new DAO_PatientList();
                list.CaseID             = this.grdBillSearch.Rows[i].Cells[0].Text.ToString();
                list.Bill_NO            = this.grdBillSearch.Rows[i].Cells[3].Text.ToString();//Change Cell 1 to 3
                list.CompanyId          = this.grdBillSearch.DataKeys[i]["SZ_COMPANY_ID"].ToString();
                list.LAWFIRM_COMPANY_ID = this.txtCompanyId.Text.ToString();
                list.USER_ID            = (str2);
                list.IP_ADDRESS         = (str);
                list.PATIENT_NAME       = this.grdBillSearch.DataKeys[i]["PATIENT_NAME"].ToString();
                list.PROCEDURE_GROUP_ID = this.grdBillSearch.DataKeys[i]["SPECIALITY_ID"].ToString();
                list.USER_NAME          = str3;
                new Bill_Sys_CollectDocAndZip();
                list2.Add(list);
            }
        }
        string str4 = "";
        Bill_Sys_CollectDocAndZip zip = new Bill_Sys_CollectDocAndZip();

        if (this.chkCaseDoc.Checked)
        {
            str4 = zip.CollectAndZipBillDocs(list2, "1");
        }
        else
        {
            str4 = zip.CollectAndZipBillDocs(list2, "0");
        }
        if (str4 == "")
        {
            ScriptManager.RegisterClientScriptBlock((Page)this, base.GetType(), "Done", "alert('There are no files available on the server to download.');", true);
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock((Page)this, base.GetType(), "Msg", "window.open('" + ConfigurationSettings.AppSettings["LFIRMDOCURL"].ToString() + str4 + "'); ", true);
        }
    }
Exemplo n.º 2
0
    protected void lnkDownload_Click(object sender, EventArgs e)
    {
        try
        {
            //_objDesc.LAWFIRM_COMPANY_ID, DateTime.Now.ToString(), _objDesc.USER_ID, _objDesc.IP_ADDRESS
            DAO_PatientList     _objDesc             = new DAO_PatientList();
            Bill_Sys_CaseObject _bill_Sys_CaseObject = new Bill_Sys_CaseObject();
            ArrayList           objAL = new ArrayList();
            mbs.lawfirm.Bill_Sys_CollectDocAndZip cNz = new mbs.lawfirm.Bill_Sys_CollectDocAndZip();
            szCaseId                    = ((Bill_Sys_CaseObject)Session["CASE_OBJECT"]).SZ_CASE_ID;
            _objDesc.CaseID             = szCaseId;
            _objDesc.CompanyId          = cNz.GetCompanyId(szCaseId);
            _objDesc.LAWFIRM_COMPANY_ID = ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID;
            _objDesc.USER_ID            = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_ID;
            _objDesc.IP_ADDRESS         = Page.Request.ServerVariables["REMOTE_ADDR"].ToString();

            objAL.Add(_objDesc);

            string path = cNz.CollectAndZip(objAL, ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID);
            if (path == "")
            {
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "Done", "alert('There are no files available on the server to download.');", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, GetType(), "Msg", "window.open('" + ConfigurationSettings.AppSettings["LFIRMDOCURL"].ToString() + path + "'); ", true);
            }
            // ScriptManager.RegisterClientScriptBlock(this, GetType(), "mm", "openURL('" + ConfigurationSettings.AppSettings["LFIRMDOCURL"].ToString() + path + "','" + path + "');", true);
        }
        catch (Exception ex)
        {
            usrMessage.PutMessage(ex.ToString());
            usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_ErrorMessage);
            usrMessage.Show();
        }
    }