Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     serverpath = Server.MapPath("~/");
     if (Session["aid"] != null)
     {
         xaid.Value = Session["aid"].ToString();
     }
     if (Session["vid"] != null)
     {
         xvid.Value = Session["vid"].ToString();
     }
     else
     {
         Response.Redirect("http://www.iponigeria.com/userarea/dashboard");
     }
     if (Session["amt"] != null)
     {
         xamt.Value = Session["amt"].ToString();
     }
     if (Session["gt"] != null)
     {
         xgt.Value = Session["gt"].ToString();
     }
     if (Session["pc"] != null)
     {
         pc = xpc.Value = Session["pc"].ToString();
     }
     if (Session["pwalletID"] != null)
     {
         xpwalletID.Value = Session["pwalletID"].ToString();
     }
     if (Session["agentemail"] != null)
     {
         xagentemail.Value = Session["agentemail"].ToString();
     }
     if (Session["cname"] != null)
     {
         xcname.Value = Session["cname"].ToString();
     }
     if (Session["agentpnumber"] != null)
     {
         xagentpnumber.Value = Session["agentpnumber"].ToString();
     }
     if (Session["applicantname"] != null)
     {
         xapplicantname.Value = Session["applicantname"].ToString();
     }
     if (Session["product_title"] != null)
     {
         xproduct_title.Value = Session["product_title"].ToString();
     }
     if (Session["log_staffID"] != null)
     {
         log_staffID = Session["log_staffID"].ToString();
     }
     xcode.Text = xaid.Value.ToUpper();
     xname.Text = xapplicantname.Value.ToUpper();
     if (selectDay.Text == "")
     {
         selectDay.Text = DateTime.Now.Day.ToString();
     }
     if (selectMonth.Text == "")
     {
         selectMonth.Text = DateTime.Now.Month.ToString();
     }
     if (selectYear.Text == "")
     {
         selectYear.Text = DateTime.Now.Year.ToString();
     }
     description_no.Text = "1";
     claim_no.Text       = "1";
     abstract_no.Text    = "1";
     drawing_no.Text     = "1";
     if (rbPriorityClaim.SelectedValue == "Yes")
     {
         rbPriorityClaim_text = "1";
     }
     if (rbInventors.SelectedValue == "Yes")
     {
         rbInventors_text = "1";
     }
     if (rbOtherInventors.SelectedValue == "Yes")
     {
         rbInventors_text      = "1";
         rbOtherInventors_text = "1";
     }
     if (IsPostBack)
     {
         lt_state = t.getState(residence.SelectedValue);
         if (lt_state.Count == 0)
         {
             state_row     = "1";
             state_visible = "1";
         }
         lt_rep_state = t.getState(rep_residence.SelectedValue);
         if (lt_rep_state.Count == 0)
         {
             rep_state_row = "1";
             state_visible = "1";
         }
         if (Session["aid"] != null)
         {
             xaid.Value = Session["aid"].ToString();
         }
         if (Session["vid"] != null)
         {
             xvid.Value = Session["vid"].ToString();
         }
         if (Session["amt"] != null)
         {
             xamt.Value = Session["amt"].ToString();
         }
         if (Session["gt"] != null)
         {
             xgt.Value = Session["gt"].ToString();
         }
         if (Session["pc"] != null)
         {
             pc = xpc.Value = Session["pc"].ToString();
             if (pc == "T002")
             {
                 pc = "1";
             }
             else
             {
                 pc = "2";
             }
         }
         if (Session["pwalletID"] != null)
         {
             xpwalletID.Value = Session["pwalletID"].ToString();
         }
         if (Session["agentemail"] != null)
         {
             xagentemail.Value = Session["agentemail"].ToString();
         }
         if (Session["cname"] != null)
         {
             xcname.Value = Session["cname"].ToString();
         }
         if (Session["agentpnumber"] != null)
         {
             xagentpnumber.Value = Session["agentpnumber"].ToString();
         }
         if (Session["applicantname"] != null)
         {
             xapplicantname.Value = Session["applicantname"].ToString();
         }
         if (Session["product_title"] != null)
         {
             xproduct_title.Value = Session["product_title"].ToString();
         }
     }
     else
     {
         transID         = Session["vid"].ToString();
         Session["xref"] = Convert.ToInt32(Session["xref"]) + 1;
         if (Session["xref"].ToString() != "1")
         {
             Response.Redirect("./violation.aspx");
         }
         if (((Session["xapplication"] != null) && (Session["xapplication"].ToString() != "")) && (transID != Session["xapplication"].ToString()))
         {
             Response.Redirect("./violation.aspx");
         }
         nationality.SelectedIndex     = 0x9f;
         rep_nationality.SelectedIndex = 0x9f;
         residence.SelectedIndex       = 0x9f;
         rep_residence.SelectedIndex   = 0x9f;
         rep_xname.Text          = xcname.Value.ToUpper();
         rep_xemail.Text         = xagentemail.Value.ToUpper();
         rep_xtelephone.Text     = xagentpnumber.Value.ToUpper();
         title_of_invention.Text = xproduct_title.Value.ToUpper();
     }
     if ((Session["description_doc"] == null) && description_doc.HasFile)
     {
         Session["description_doc"] = description_doc;
         lblDescription_doc.Text    = description_doc.FileName;
     }
     else if (!((Session["description_doc"] == null) || description_doc.HasFile))
     {
         description_doc         = (FileUpload)Session["description_doc"];
         lblDescription_doc.Text = description_doc.FileName;
     }
     else if (description_doc.HasFile)
     {
         Session["description_doc"] = description_doc;
         lblDescription_doc.Text    = description_doc.FileName;
     }
     if ((Session["claim_doc"] == null) && claim_doc.HasFile)
     {
         Session["claim_doc"] = claim_doc;
         lblClaim_doc.Text    = claim_doc.FileName;
     }
     else if (!((Session["claim_doc"] == null) || claim_doc.HasFile))
     {
         claim_doc         = (FileUpload)Session["claim_doc"];
         lblClaim_doc.Text = claim_doc.FileName;
     }
     else if (claim_doc.HasFile)
     {
         Session["claim_doc"] = claim_doc;
         lblClaim_doc.Text    = claim_doc.FileName;
     }
     if ((Session["abstract_doc"] == null) && abstract_doc.HasFile)
     {
         Session["abstract_doc"] = abstract_doc;
         lblAbstract_doc.Text    = abstract_doc.FileName;
     }
     else if (!((Session["abstract_doc"] == null) || abstract_doc.HasFile))
     {
         abstract_doc         = (FileUpload)Session["abstract_doc"];
         lblAbstract_doc.Text = abstract_doc.FileName;
     }
     else if (abstract_doc.HasFile)
     {
         Session["abstract_doc"] = abstract_doc;
         lblAbstract_doc.Text    = abstract_doc.FileName;
     }
     if ((Session["drawing_doc"] == null) && drawing_doc.HasFile)
     {
         Session["drawing_doc"] = drawing_doc;
         lblDrawing_doc.Text    = drawing_doc.FileName;
     }
     else if (!((Session["drawing_doc"] == null) || drawing_doc.HasFile))
     {
         drawing_doc         = (FileUpload)Session["drawing_doc"];
         lblDrawing_doc.Text = drawing_doc.FileName;
     }
     else if (drawing_doc.HasFile)
     {
         Session["drawing_doc"] = drawing_doc;
         lblDrawing_doc.Text    = drawing_doc.FileName;
     }
 }