Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString[Crypto.ArgumentEncrypt("ching")] != null)
            {
                ManageUserSVC.ManageUserClient Cl = new ManageUserSVC.ManageUserClient();
                Guid CertyID = Guid.Parse(Crypto.Decrypt(Request.QueryString[Crypto.ArgumentEncrypt("ching")].ToString(), true));
                //Get info From CertyID...
                List <usp_GetCertificateByIDResult> ds = new List <usp_GetCertificateByIDResult>();
                ds = Cl.GetCertificateInfoByCertyID(CertyID);
                if (ds != null && ds.Count > 0)
                {
                    //Assign Values...
                    Guid CustomerID = ds.ToList()[0].Cust_ID;

                    DataSet dsCus = new DataSet();
                    dsCus = Cl.GetCustomerInfo(CustomerID);
                    if (dsCus != null && dsCus.Tables[0].Rows.Count > 0)
                    {
                        string InsuredDetail = dsCus.Tables[0].Rows[0]["FirstName"].ToString() + " " + dsCus.Tables[0].Rows[0]["LastName"].ToString() + "\n\r" +
                                               dsCus.Tables[0].Rows[0]["Address"].ToString() + ", " + dsCus.Tables[0].Rows[0]["City"].ToString() + ", " +
                                               dsCus.Tables[0].Rows[0]["State"].ToString() + ", " + dsCus.Tables[0].Rows[0]["ZipCode"].ToString() + ".";



                        lblDate.Text           = ds.ToList()[0].CertiDate.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);
                        lblInsuredDetails.Text = InsuredDetail;
                        lblCertificateNo.Text  = ds.ToList()[0].CretiNo.ToUpper();
                        lblCertyNo.Text        = ds.ToList()[0].CretiNo.ToUpper();
                        lblCertyNopage2.Text   = ds.ToList()[0].CretiNo.ToUpper();
                        lblEffectDate.Text     = ds.ToList()[0].CertiDate.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);

                        if (ds.ToList()[0].AdditionalLang != "")
                        {
                            chkAddInsur.Visible = false;
                            imgAddInsur.Visible = true;
                        }
                        if (bool.Parse(ds.ToList()[0].Waiver.ToString()))
                        {
                            chkSubgrtion.Visible = false;
                            imgSubgrtion.Visible = true;
                        }

                        dsCus = new DataSet();
                        dsCus = Cl.CreateEvedenceInfoByCusID(CustomerID);
                        if (dsCus != null && dsCus.Tables[0].Rows.Count > 0)
                        {
                            DateTime CovStartDate = Convert.ToDateTime(dsCus.Tables[0].Rows[0]["CoverDate"].ToString());
                            DateTime CovEndDate   = CovStartDate.AddMonths(12);
                            lblPolicyStartDate.Text = CovStartDate.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);
                            lblPolicyEndDate.Text   = CovEndDate.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);
                        }

                        lblCertiHolderDetails.Text = ds.ToList()[0].HoldrName.ToString() + "\n\r " +
                                                     ds.ToList()[0].HoldrAdd.ToString();

                        lbl2nameInsured.Text  = InsuredDetail;
                        lbl2nameInsured0.Text = InsuredDetail;
                        //lblAdditionalinsuredpage3.Text = InsuredDetail;
                        lblEventFrom.Text = ds.ToList()[0].EventFrom.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);
                        lblEventTo.Text   = ds.ToList()[0].EventTo.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture);

                        lblAdditionallang.Text = ds.ToList()[0].AdditionalLang;

                        if (ds.ToList()[0].Data.Bytes.Length != 0)
                        {
                            Byte[] bytee = ds.ToList()[0].Data.Bytes;
                            download(bytee);
                        }
                    }
                }
            }
        }