Пример #1
0
    //static string officeo, GenContNumbglob,globContClub="";
    protected void Page_Load(object sender, EventArgs e)
    {
        //string user =  (string)Session["username"];
        //string office = Queries.GetOffice(user);
        // string resort="", resort1="";
        // Session["officeo"] = "";
        //Session["officeo"] = office;


        string user = (string)Session["username"];
        //  string office = Queries.GetOffice(user);
        string resort = "", resort1 = "";

        // Session["officeo"] = "";
        // Session["officeo"] = office;



        if (user == null)
        {
            Response.Redirect("~/WebSite5/production/login.aspx");
        }
        if (!Page.IsPostBack)
        {
            //string contractno = "RGC9/271117/114";//.ToString(Request.QueryString["ContractNo"]);

            string contractno = Convert.ToString(Request.QueryString["ContractNo"]);
            Session["GenContNumbglob"] = "";
            Session["GenContNumbglob"] = contractno;

            string ProfileID = Queries2.getProfileIDfromNo(contractno);

            // string  office = Queries2.GetOfficeFromCountry(ProfileID);
            string office = Queries2.GetOfficeFromCountry(ProfileID);


            string fracid = Queries2.getcontIDfromNo(contractno);

            DataSet ds4      = Queries2.LoadAllContractFractionalDetails(fracid);
            string  conttype = ds4.Tables[0].Rows[0]["Contract_Finance_Cont_Type"].ToString(); //ds4.Tables[0].Rows[0][""].ToString();
            Session["globContClub"] = "";
            if (conttype == "Points")
            {
                Session["globContClub"] = ds4.Tables[0].Rows[0]["CT_Points_Club"].ToString();
            }
            else if (conttype == "Trade Into Points")
            {
                Session["globContClub"] = ds4.Tables[0].Rows[0]["TP_New_CLub"].ToString();
            }
            else if (conttype == "Fractional")
            {
                Session["globContClub"] = "";
                resort1 = ds4.Tables[0].Rows[0]["Contract_Fractional_Resort"].ToString();
                if (resort1 == "FRACTIONAL MEMBER")
                {
                    resort = "FM";
                }
            }
            else if (conttype == "Trade Into Fractional")
            {
                Session["globContClub"] = "";


                resort1 = ds4.Tables[0].Rows[0]["TF_Resort"].ToString();
                if (resort1 == "FRACTIONAL MEMBER")
                {
                    resort = "FM";
                }
            }


            string PaymentMethod = ds4.Tables[0].Rows[0]["Contract_Finance_Payment_Method"].ToString();
            string affilice      = ds4.Tables[0].Rows[0]["Contract_Finance_Affil_ICE"].ToString();
            string CrownCurr     = ds4.Tables[0].Rows[0]["Contract_Finance_Crown_Curr"].ToString();
            string financeCurr   = ds4.Tables[0].Rows[0]["Contract_Finance_Currency"].ToString();
            string coolonoff     = ds4.Tables[0].Rows[0]["Contract_Finance_Cool_OnOff"].ToString();

            string PaymentMethod2, affil2;
            if (PaymentMethod == "Crown Finance")
            {
                PaymentMethod2 = "Crown Finance";
            }
            else
            {
                PaymentMethod2 = "NCrown Finance";
            }

            if (affilice == "True")
            {
                affil2 = "ICE";
            }
            else
            {
                affil2 = "NICE";
            }



            if (office == "GER" || office == "GRE" || office == "FRA" || office == "ITA" || office == "IRE")
            {
                if (coolonoff == "1")
                {
                    Session["Pofficeo"] = "GER";
                    Session["Cooloff"]  = "1";
                }
                else
                {
                    Session["Pofficeo"] = "GER";
                    Session["Cooloff"]  = "";
                }
            }
            else
            {
                Session["Cooloff"]  = "";
                Session["Pofficeo"] = office;
            }



            Session["PConttype"] = conttype;//DropDownList40.SelectedItem.Text;
            //Session["Pofficeo"] = office;
            Session["PGlobContClub"]  = Session["globContClub"].ToString();
            Session["PPaymentMethod"] = PaymentMethod2;
            Session["PAffil"]         = affil2;
            Session["PCrownCurr"]     = CrownCurr;
            Session["Presort"]        = resort;
            Session["PFinaCurrency"]  = financeCurr;


            if (financeCurr == "INR")
            {
                if (PaymentMethod == "PARSHURAM FINANCE")
                {
                    Session["PPaymentMethod"] = PaymentMethod2 = "Parshuram";
                }
                else
                {
                    Session["PPaymentMethod"] = PaymentMethod2 = "NP";
                }

                PrintPdfDropDownList.Items.Clear();
                //string ContType1 = DropDownList40.SelectedItem.Text;
                DataSet ds21 = Queries2.LoadPrintFiles3(conttype, (string)Session["Pofficeo"], (string)Session["globContClub"], PaymentMethod2, affil2, financeCurr, resort);
                PrintPdfDropDownList.DataSource           = ds21;
                PrintPdfDropDownList.DataTextField        = "Printpdf_name";
                PrintPdfDropDownList.DataValueField       = "Printpdf_name";
                PrintPdfDropDownList.AppendDataBoundItems = true;
                PrintPdfDropDownList.Items.Insert(0, new ListItem("", ""));
                PrintPdfDropDownList.DataBind();
            }
            else
            {
                PrintPdfDropDownList.Items.Clear();
                //string ContType1 = DropDownList40.SelectedItem.Text;
                DataSet ds21 = Queries2.LoadPrintFiles2(conttype, Session["Pofficeo"].ToString(), (string)Session["globContClub"], PaymentMethod2, affil2, CrownCurr, resort, Session["Cooloff"].ToString(), Session["PFinaCurrency"].ToString());
                PrintPdfDropDownList.DataSource           = ds21;
                PrintPdfDropDownList.DataTextField        = "Printpdf_name";
                PrintPdfDropDownList.DataValueField       = "Printpdf_name";
                PrintPdfDropDownList.AppendDataBoundItems = true;
                PrintPdfDropDownList.Items.Insert(0, new ListItem("", ""));
                PrintPdfDropDownList.DataBind();
            }
        }
    }