Exemple #1
0
    protected void SaveExit_Click(object sender, EventArgs e)
    {
        int num;

        SetLatestRowsFromGrid_App_gv();
        SetLatestRowsFromGrid_Inv_gv();
        SetLatestRowsFromGrid_Pri_gv();
        pt.PtInfo               info           = new pt.PtInfo();
        pt.Assignment_info      _info          = new pt.Assignment_info();
        pt.Representative       representative = new pt.Representative();
        List <pt.Applicant>     list           = new List <pt.Applicant>();
        List <pt.Inventor>      list2          = new List <pt.Inventor>();
        List <pt.Priority_info> list3          = new List <pt.Priority_info>();

        info.reg_number         = "";
        info.xtype              = lbl_type.Text;
        info.title_of_invention = txt_title_of_invention.Text;
        info.pt_desc            = txt_pt_desc.Text;
        if (Session["pwalletID"] != null)
        {
            info.log_staff = Session["pwalletID"].ToString();
        }
        info.reg_date              = xreg_date;
        info.xvisible              = xvisible;
        info.claim_no              = "0";
        info.loa_no                = "0";
        info.pct_no                = "0";
        info.doa_no                = "0";
        _info.date_of_assignment   = txt_assignment_date.Text;
        _info.assignee_name        = txt_assignee_name.Text;
        _info.assignee_address     = txt_assignee_address.Text;
        _info.assignee_nationality = select_assignee_nationality.SelectedValue;
        _info.assignor_name        = txt_assignor_name.Text;
        _info.assignor_address     = txt_assignor_address.Text;
        _info.assignor_nationality = select_assignor_nationality.SelectedValue;
        if (Session["pwalletID"] != null)
        {
            _info.log_staff = Session["pwalletID"].ToString();
        }
        _info.visible              = xvisible;
        representative.agent_code  = rep_code.Text;
        representative.xname       = rep_xname.Text;
        representative.nationality = "160";
        representative.country     = "160";
        representative.state       = select_rep_state.SelectedValue;
        representative.address     = txt_rep_address.Text;
        representative.xmobile     = txt_rep_telephone.Text;
        representative.xemail      = txt_rep_email.Text;
        representative.reg_date    = xreg_date;
        representative.visible     = xvisible;
        if (Session["pwalletID"] != null)
        {
            representative.log_staff = Session["pwalletID"].ToString();
        }
        lt_app = (List <SortedList <string, string> >)Session["lt_app"];
        lt_inv = (List <SortedList <string, string> >)Session["lt_inv"];
        lt_pri = (List <SortedList <string, string> >)Session["lt_pri"];
        if (lt_app.Count > 0)
        {
            for (num = 0; num < lt_app.Count; num++)
            {
                pt.Applicant item = new pt.Applicant {
                    xname       = lt_app[num]["txt_name_app"],
                    address     = lt_app[num]["txt_address_app"],
                    xemail      = lt_app[num]["txt_email_app"],
                    xmobile     = lt_app[num]["txt_mobile_app"],
                    nationality = lt_app[num]["select_app_nationality"]
                };
                if (Session["pwalletID"] != null)
                {
                    item.log_staff = Session["pwalletID"].ToString();
                }
                item.visible = xvisible;
                list.Add(item);
            }
        }
        if (lt_inv.Count > 0)
        {
            for (num = 0; num < lt_inv.Count; num++)
            {
                pt.Inventor inventor = new pt.Inventor {
                    xname       = lt_inv[num]["txt_name_inv"],
                    address     = lt_inv[num]["txt_address_inv"],
                    xemail      = lt_inv[num]["txt_email_inv"],
                    xmobile     = lt_inv[num]["txt_mobile_inv"],
                    nationality = lt_inv[num]["select_inv_nationality"]
                };
                if (Session["pwalletID"] != null)
                {
                    inventor.log_staff = Session["pwalletID"].ToString();
                }
                inventor.visible = xvisible;
                list2.Add(inventor);
            }
        }
        if (lt_pri.Count > 0)
        {
            for (num = 0; num < lt_pri.Count; num++)
            {
                pt.Priority_info _info2 = new pt.Priority_info {
                    countryID = lt_pri[num]["select_country_pri"],
                    app_no    = lt_pri[num]["txt_application_no_pri"],
                    xdate     = lt_pri[num]["txt_date_pri"]
                };
                if (Session["pwalletID"] != null)
                {
                    _info2.log_staff = Session["pwalletID"].ToString();
                }
                _info2.xvisible = xvisible;
                list3.Add(_info2);
            }
        }
        string str = t.addNewPatent(list, list3, list2, info, _info, representative);

        if ((str != "") && (str != null))
        {
            Session["new_ptID"] = str;
            if (Session["aid"] != null)
            {
                aid = Session["aid"].ToString();
            }
            Response.Redirect("appstatus.aspx?agt=" + aid);
        }
    }
Exemple #2
0
    protected void SaveAll_Click(object sender, EventArgs e)
    {
        int num;

        if (Session["lt_pwx"] != null)
        {
            lt_pwx.Clear();
            lt_pwx = (List <pt.Stage>)Session["lt_pwx"];
        }
        if (Session["lt_mix"] != null)
        {
            lt_mix.Clear();
            lt_mix       = (List <pt.PtInfo>)Session["lt_mix"];
            c_ptinfo.xID = lt_mix[0].xID;
        }
        if (Session["lt_repx"] != null)
        {
            lt_repx.Clear();
            lt_repx  = (List <pt.Representative>)Session["lt_repx"];
            c_rep.ID = lt_repx[0].ID;
        }
        if (Session["lt_appx"] != null)
        {
            lt_appx.Clear();
            lt_appx  = (List <pt.Applicant>)Session["lt_appx"];
            c_app.ID = lt_appx[0].ID;
        }
        if (Session["lt_invx"] != null)
        {
            lt_invx.Clear();
            lt_invx  = (List <pt.Inventor>)Session["lt_invx"];
            c_inv.ID = lt_invx[0].ID;
        }
        if (Session["lt_assinfox"] != null)
        {
            lt_assinfox.Clear();
            lt_assinfox  = (List <pt.Assignment_info>)Session["lt_assinfox"];
            c_assinfo.ID = lt_assinfox[0].ID;
        }
        if (Session["lt_xprix"] != null)
        {
            lt_xprix.Clear();
            lt_xprix  = (List <pt.Priority_info>)Session["lt_xprix"];
            c_pri.xID = lt_xprix[0].xID;
        }
        SetLatestRowsFromGrid_App_gv();
        SetLatestRowsFromGrid_Inv_gv();
        c_ptinfo.reg_number         = "";
        c_ptinfo.xtype              = lbl_type.Text;
        c_ptinfo.title_of_invention = txt_title_of_invention.Text;
        c_ptinfo.pt_desc            = txt_pt_desc.Text;
        if (lt_pwx.Count > 0)
        {
            c_ptinfo.log_staff = lt_pwx[0].ID;
        }
        c_ptinfo.reg_date              = xreg_date;
        c_ptinfo.xvisible              = xvisible;
        c_ptinfo.claim_no              = "0";
        c_ptinfo.loa_no                = "0";
        c_ptinfo.pct_no                = "0";
        c_ptinfo.doa_no                = "0";
        c_assinfo.date_of_assignment   = txt_assignment_date.Text;
        c_assinfo.assignee_name        = txt_assignee_name.Text;
        c_assinfo.assignee_address     = txt_assignee_address.Text;
        c_assinfo.assignee_nationality = select_assignee_nationality.SelectedValue;
        c_assinfo.assignor_name        = txt_assignor_name.Text;
        c_assinfo.assignor_address     = txt_assignor_address.Text;
        c_assinfo.assignor_nationality = select_assignor_nationality.SelectedValue;
        if (lt_pwx.Count > 0)
        {
            c_assinfo.log_staff = lt_pwx[0].ID;
        }
        c_assinfo.visible = xvisible;
        c_rep.agent_code  = rep_code.Text;
        c_rep.xname       = rep_xname.Text;
        c_rep.nationality = "160";
        c_rep.country     = "160";
        c_rep.state       = select_rep_state.SelectedValue;
        c_rep.address     = txt_rep_address.Text;
        c_rep.xmobile     = txt_rep_telephone.Text;
        c_rep.xemail      = txt_rep_email.Text;
        c_rep.reg_date    = xreg_date;
        c_rep.visible     = xvisible;
        if (lt_pwx.Count > 0)
        {
            c_rep.log_staff = lt_pwx[0].ID;
        }
        if (Session["lt_app"] != null)
        {
            lt_app = (List <SortedList <string, string> >)Session["lt_app"];
        }
        if (Session["lt_inv"] != null)
        {
            lt_inv = (List <SortedList <string, string> >)Session["lt_inv"];
        }
        if (Session["lt_pri"] != null)
        {
            lt_pri = (List <SortedList <string, string> >)Session["lt_pri"];
        }
        if (lt_app.Count > 0)
        {
            for (num = 0; num < lt_app.Count; num++)
            {
                pt.Applicant applicant = new pt.Applicant {
                    xname       = lt_app[num]["txt_name_app"],
                    address     = lt_app[num]["txt_address_app"],
                    xemail      = lt_app[num]["txt_email_app"],
                    xmobile     = lt_app[num]["txt_mobile_app"],
                    nationality = lt_app[num]["select_app_nationality"]
                };
                if (lt_pwx.Count > 0)
                {
                    applicant.log_staff = lt_pwx[0].ID;
                }
                applicant.visible = xvisible;
                c_app             = null;
                c_app             = applicant;
                lt_xapp.Add(c_app);
            }
        }
        if (lt_inv.Count > 0)
        {
            for (num = 0; num < lt_inv.Count; num++)
            {
                pt.Inventor inventor = new pt.Inventor {
                    xname       = lt_inv[num]["txt_name_inv"],
                    address     = lt_inv[num]["txt_address_inv"],
                    xemail      = lt_inv[num]["txt_email_inv"],
                    xmobile     = lt_inv[num]["txt_mobile_inv"],
                    nationality = lt_inv[num]["select_inv_nationality"]
                };
                if (lt_pwx.Count > 0)
                {
                    inventor.log_staff = lt_pwx[0].ID;
                }
                inventor.visible = xvisible;
                c_inv            = null;
                c_inv            = inventor;
                lt_xinv.Add(c_inv);
            }
        }
        c_pri.countryID = select_country_pri.SelectedValue;
        c_pri.app_no    = txt_application_no_pri.Text;
        c_pri.xdate     = txt_date_pri.Text;
        if (lt_pwx.Count > 0)
        {
            c_pri.log_staff = lt_pwx[0].ID;
        }
        c_pri.xvisible = xvisible;
        lt_xpri.Add(c_pri);
        if (((((lt_mix.Count == 0) && (lt_repx.Count == 0)) && ((lt_appx.Count == 0) && (lt_invx.Count == 0))) && (lt_assinfox.Count == 0)) && (lt_xprix.Count == 0))
        {
            pt_succ = t.addNewPatent(lt_xapp, lt_xpri, lt_xinv, c_ptinfo, c_assinfo, c_rep);
            if (Convert.ToInt32(pt_succ) > 0)
            {
                Session["mix_updateID"] = pt_succ;
                if (Convert.ToInt32(pt_succ) > 0)
                {
                    Response.Redirect("./pt_refill_docs.aspx");
                }
            }
        }
        else
        {
            if (lt_repx.Count == 0)
            {
                rep_updateID = t.addRepresentative(c_rep);
            }
            else
            {
                rep_updateID = t.updateRepresentative(c_rep);
            }
            if (lt_assinfox.Count == 0)
            {
                assinfo_updateID = t.addAssignment_info(c_assinfo);
            }
            else
            {
                assinfo_updateID = t.updateAssignment_info(c_assinfo);
            }
            if (lt_xpri.Count == 0)
            {
                pri_updateID = t.addPriority_info(c_pri);
            }
            else
            {
                pri_updateID = t.updatePriority_info(c_pri);
            }
            if (lt_xapp.Count == 0)
            {
                foreach (pt.Applicant applicant2 in lt_xapp)
                {
                    if ((applicant2.xname != null) && (applicant2.xname != ""))
                    {
                        app_updateID = t.addApplicant(applicant2);
                    }
                }
            }
            else
            {
                t.deleteApplicant(lt_pwx[0].ID);
                foreach (pt.Applicant applicant2 in lt_xapp)
                {
                    if ((applicant2.xname != null) && (applicant2.xname != ""))
                    {
                        app_updateID = t.addApplicant(applicant2);
                    }
                }
            }
            if (lt_xinv.Count == 0)
            {
                foreach (pt.Inventor inventor2 in lt_xinv)
                {
                    if ((inventor2.xname != null) && (inventor2.xname != ""))
                    {
                        inv_updateID = t.addInventor(inventor2);
                    }
                }
            }
            else
            {
                t.deleteInventor(lt_pwx[0].ID);
                foreach (pt.Inventor inventor2 in lt_xinv)
                {
                    if ((inventor2.xname != null) && (inventor2.xname != ""))
                    {
                        inv_updateID = t.addInventor(inventor2);
                    }
                }
            }
            if (lt_mix.Count == 0)
            {
                mix_updateID = t.addPt(c_ptinfo);
                t.updatePtReg(mix_updateID, c_ptinfo.xtype);
                Session["mix_updateID"] = c_ptinfo.xID;
                if (Convert.ToInt32(mix_updateID) > 0)
                {
                    Response.Redirect("./pt_refill_docs.aspx");
                }
            }
            else
            {
                mix_updateID = t.updatePtInfo(c_ptinfo);
                t.updatePtReg(c_ptinfo.xID, c_ptinfo.xtype);
                Session["mix_updateID"] = c_ptinfo.xID;
                if (Convert.ToInt32(mix_updateID) > 0)
                {
                    Response.Redirect("./pt_refill_docs.aspx");
                }
            }
        }
    }
Exemple #3
0
    protected void SaveAll_Click(object sender, EventArgs e)
    {
        TransactionOptions transactionOptions = new TransactionOptions {
            IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted,
            Timeout        = TimeSpan.FromMinutes(10.0)
        };
        TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, transactionOptions);

        try
        {
            int num;
            SetLatestRowsFromGrid_App_gv();
            SetLatestRowsFromGrid_Inv_gv();
            SetLatestRowsFromGrid_Pri_gv();
            pt.PtInfo               info           = new pt.PtInfo();
            pt.Assignment_info      _info          = new pt.Assignment_info();
            pt.Representative       representative = new pt.Representative();
            List <pt.Applicant>     list           = new List <pt.Applicant>();
            List <pt.Inventor>      list2          = new List <pt.Inventor>();
            List <pt.Priority_info> list3          = new List <pt.Priority_info>();
            info.reg_number         = "";
            info.xtype              = lbl_type.Text;
            info.title_of_invention = txt_title_of_invention.Text;
            info.pt_desc            = txt_pt_desc.Text;
            if (Session["pwalletID"] != null)
            {
                info.log_staff = Session["pwalletID"].ToString();
            }
            info.reg_date              = xreg_date;
            info.xvisible              = xvisible;
            info.claim_no              = "0";
            info.loa_no                = "0";
            info.pct_no                = "0";
            info.doa_no                = "0";
            _info.date_of_assignment   = txt_assignment_date.Text;
            _info.assignee_name        = txt_assignee_name.Text;
            _info.assignee_address     = txt_assignee_address.Text;
            _info.assignee_nationality = select_assignee_nationality.SelectedValue;
            _info.assignor_name        = txt_assignor_name.Text;
            _info.assignor_address     = txt_assignor_address.Text;
            _info.assignor_nationality = select_assignor_nationality.SelectedValue;
            if (Session["pwalletID"] != null)
            {
                _info.log_staff = Session["pwalletID"].ToString();
            }
            _info.visible              = xvisible;
            representative.agent_code  = rep_code.Text;
            representative.xname       = rep_xname.Text;
            representative.nationality = "160";
            representative.country     = "160";
            representative.state       = select_rep_state.SelectedValue;
            representative.address     = txt_rep_address.Text;
            representative.xmobile     = txt_rep_telephone.Text;
            representative.xemail      = txt_rep_email.Text;
            representative.reg_date    = xreg_date;
            representative.visible     = xvisible;
            if (Session["pwalletID"] != null)
            {
                representative.log_staff = Session["pwalletID"].ToString();
            }
            lt_app = (List <SortedList <string, string> >)Session["lt_app"];
            lt_inv = (List <SortedList <string, string> >)Session["lt_inv"];
            lt_pri = (List <SortedList <string, string> >)Session["lt_pri"];
            if (lt_app.Count > 0)
            {
                for (num = 0; num < lt_app.Count; num++)
                {
                    pt.Applicant item = new pt.Applicant {
                        xname       = lt_app[num]["txt_name_app"],
                        address     = lt_app[num]["txt_address_app"],
                        xemail      = lt_app[num]["txt_email_app"],
                        xmobile     = lt_app[num]["txt_mobile_app"],
                        nationality = lt_app[num]["select_app_nationality"]
                    };
                    if (Session["pwalletID"] != null)
                    {
                        item.log_staff = Session["pwalletID"].ToString();
                    }
                    item.visible = xvisible;
                    list.Add(item);
                }
            }
            if (lt_inv.Count > 0)
            {
                for (num = 0; num < lt_inv.Count; num++)
                {
                    pt.Inventor inventor = new pt.Inventor {
                        xname       = lt_inv[num]["txt_name_inv"],
                        address     = lt_inv[num]["txt_address_inv"],
                        xemail      = lt_inv[num]["txt_email_inv"],
                        xmobile     = lt_inv[num]["txt_mobile_inv"],
                        nationality = lt_inv[num]["select_inv_nationality"]
                    };
                    if (Session["pwalletID"] != null)
                    {
                        inventor.log_staff = Session["pwalletID"].ToString();
                    }
                    inventor.visible = xvisible;
                    list2.Add(inventor);
                }
            }
            if (lt_pri.Count > 0)
            {
                for (num = 0; num < lt_pri.Count; num++)
                {
                    pt.Priority_info _info2 = new pt.Priority_info {
                        countryID = lt_pri[num]["select_country_pri"],
                        app_no    = lt_pri[num]["txt_application_no_pri"],
                        xdate     = lt_pri[num]["txt_date_pri"]
                    };
                    if (Session["pwalletID"] != null)
                    {
                        _info2.log_staff = Session["pwalletID"].ToString();
                    }
                    _info2.xvisible = xvisible;
                    list3.Add(_info2);
                }
            }
            if (Session["hwalletID"] != null)
            {
                hwalletID = Session["hwalletID"].ToString();
                status    = t.updateHwallet(hwalletID, "Used", xreg_date, txt_title_of_invention.Text).ToString();
            }
            int num3 = t.addNewPatentX(list, list3, list2, info, _info, representative, transID, aid, amt, hwalletID);
            if (num3 > 0)
            {
                Session["new_ptID"] = null;
                Session["new_ptID"] = num3;
            }
            if (Session["new_ptID"] != null)
            {
                string str;
                string str2;
                doc_path = Server.MapPath("~/") + "admin/pt/docz/" + Session["new_ptID"].ToString() + "/";
                if (!Directory.Exists(doc_path))
                {
                    Directory.CreateDirectory(doc_path);
                }
                if (IsValid && fu_loa_doc.HasFile)
                {
                    loa_newfilename = Path.Combine(doc_path, fu_loa_doc.FileName.Replace(" ", "_"));
                    fu_loa_doc.MoveTo(Path.Combine(doc_path, fu_loa_doc.FileName.Replace(" ", "_")), MoveToOptions.Overwrite);
                    Session["txt_loa_no"] = txt_loa_no.Text;
                }
                if (IsValid && fu_claim_doc.HasFile)
                {
                    claim_newfilename = Path.Combine(doc_path, fu_claim_doc.FileName.Replace(" ", "_"));
                    fu_claim_doc.MoveTo(claim_newfilename, MoveToOptions.Overwrite);
                    Session["txt_claim_no"] = txt_claim_no.Text;
                }
                if (IsValid && fu_pct_doc.HasFile)
                {
                    pct_newfilename = Path.Combine(doc_path, fu_pct_doc.FileName.Replace(" ", "_"));
                    fu_pct_doc.MoveTo(pct_newfilename, MoveToOptions.Overwrite);
                    Session["txt_pct_no"] = txt_pct_no.Text;
                }
                if (IsValid && fu_doa_doc.HasFile)
                {
                    doa_newfilename = Path.Combine(doc_path, fu_doa_doc.FileName.Replace(" ", "_"));
                    fu_doa_doc.MoveTo(doa_newfilename, MoveToOptions.Overwrite);
                    Session["txt_doa_no"] = txt_doa_no.Text;
                }
                if (IsValid && fu_spec_doc.HasFile)
                {
                    spec_newfilename = Path.Combine(doc_path, fu_spec_doc.FileName.Replace(" ", "_"));
                    fu_spec_doc.MoveTo(spec_newfilename, MoveToOptions.Overwrite);
                }
                loa_newfilename              = loa_newfilename.Replace(Server.MapPath("~/") + "admin/pt/", "");
                claim_newfilename            = claim_newfilename.Replace(Server.MapPath("~/") + "admin/pt/", "");
                pct_newfilename              = pct_newfilename.Replace(Server.MapPath("~/") + "admin/pt/", "");
                doa_newfilename              = doa_newfilename.Replace(Server.MapPath("~/") + "admin/pt/", "");
                spec_newfilename             = spec_newfilename.Replace(Server.MapPath("~/") + "admin/pt/", "");
                Session["loa_newfilename"]   = loa_newfilename;
                Session["claim_newfilename"] = claim_newfilename;
                Session["pct_newfilename"]   = pct_newfilename;
                Session["doa_newfilename"]   = doa_newfilename;
                Session["spec_newfilename"]  = spec_newfilename;
                if (pc == "P001")
                {
                    if ((((loa_newfilename != "0") && (claim_newfilename != "0")) && ((pct_newfilename != "0") && (doa_newfilename != "0"))) && (spec_newfilename != "0"))
                    {
                        if (Session["txt_loa_no"] != null)
                        {
                            txt_loa_no.Text = Session["txt_loa_no"].ToString();
                        }
                        if (Session["txt_claim_no"] != null)
                        {
                            txt_claim_no.Text = Session["txt_claim_no"].ToString();
                        }
                        if (Session["txt_pct_no"] != null)
                        {
                            txt_pct_no.Text = Session["txt_pct_no"].ToString();
                        }
                        if (Session["txt_doa_no"] != null)
                        {
                            txt_doa_no.Text = Session["txt_doa_no"].ToString();
                        }
                        if (t.updatePtDocz(spec_newfilename, loa_newfilename, txt_loa_no.Text, claim_newfilename, txt_claim_no.Text, pct_newfilename, txt_pct_no.Text, doa_newfilename, txt_doa_no.Text, Session["new_ptID"].ToString()) != "0")
                        {
                            str  = "";
                            str2 = "";
                            if (Session["vid"] != null)
                            {
                                str = Session["vid"].ToString();
                            }
                            if (Session["gt"] != null)
                            {
                                str2 = Session["gt"].ToString();
                            }
                            status = ipo_gateway.UpdateTransaction(str, str2, "1");
                            scope.Complete();
                            status = "1";
                            if (status == "1")
                            {
                                ack_status = "1";
                                if (Session["vid"] != null)
                                {
                                    Response.Redirect("./tm_acknowledgement.aspx?0001234445XXX43943OPFDSMZXUHSJFDSKFGKSDKGFSDKFSKFDKFD=" + Session["vid"].ToString(), false);
                                }
                                else
                                {
                                    Response.Redirect("./appstatus.aspx", false);
                                }
                            }
                            else
                            {
                                Response.Redirect("./appstatus.aspx", false);
                            }
                        }
                        else
                        {
                            scope.Dispose();
                        }
                    }
                }
                else if (((loa_newfilename != "0") && (claim_newfilename != "0")) && (spec_newfilename != "0"))
                {
                    if (Session["txt_loa_no"] != null)
                    {
                        txt_loa_no.Text = Session["txt_loa_no"].ToString();
                    }
                    if (Session["txt_claim_no"] != null)
                    {
                        txt_claim_no.Text = Session["txt_claim_no"].ToString();
                    }
                    if (Session["txt_pct_no"] != null)
                    {
                        txt_pct_no.Text = Session["txt_pct_no"].ToString();
                    }
                    if (Session["txt_doa_no"] != null)
                    {
                        txt_doa_no.Text = Session["txt_doa_no"].ToString();
                    }
                    if (t.updatePtDocz(spec_newfilename, loa_newfilename, txt_loa_no.Text, claim_newfilename, txt_claim_no.Text, pct_newfilename, txt_pct_no.Text, doa_newfilename, txt_doa_no.Text, Session["new_ptID"].ToString()) != "0")
                    {
                        str  = "";
                        str2 = "";
                        if (Session["vid"] != null)
                        {
                            str = Session["vid"].ToString();
                        }
                        if (Session["gt"] != null)
                        {
                            str2 = Session["gt"].ToString();
                        }
                        status = ipo_gateway.UpdateTransaction(str, str2, "1");
                        scope.Complete();
                        status = "1";
                        if (status == "1")
                        {
                            ack_status = "1";
                            if (Session["vid"] != null)
                            {
                                Response.Redirect("./tm_acknowledgement.aspx?0001234445XXX43943OPFDSMZXUHSJFDSKFGKSDKGFSDKFSKFDKFD=" + Session["vid"].ToString(), false);
                            }
                            else
                            {
                                Response.Redirect("./appstatus.aspx", false);
                            }
                        }
                        else
                        {
                            Response.Redirect("./appstatus.aspx", false);
                        }
                    }
                    else
                    {
                        scope.Dispose();
                    }
                }
            }
            else
            {
                scope.Dispose();
            }
        }
        catch (Exception exception)
        {
            string str3 = exception.ToString();
            scope.Dispose();
        }
        finally
        {
            if (scope != null)
            {
                scope.Dispose();
            }
        }
    }
Exemple #4
0
    protected void SaveAll_Click(object sender, EventArgs e)
    {
        int num;

        if (Session["lt_pwx"] != null)
        {
            lt_pwx.Clear();
            lt_pwx = (List <pt.Stage>)Session["lt_pwx"];
        }
        if (Session["lt_mix"] != null)
        {
            lt_mix.Clear();
            lt_mix       = (List <pt.PtInfo>)Session["lt_mix"];
            c_ptinfo.xID = lt_mix[0].xID;
        }
        if (Session["lt_repx"] != null)
        {
            lt_repx.Clear();
            lt_repx  = (List <pt.Representative>)Session["lt_repx"];
            c_rep.ID = lt_repx[0].ID;
        }
        if (Session["lt_appx"] != null)
        {
            lt_appx.Clear();
            lt_appx = (List <pt.Applicant>)Session["lt_appx"];
        }
        if (Session["lt_invx"] != null)
        {
            lt_invx.Clear();
            lt_invx = (List <pt.Inventor>)Session["lt_invx"];
        }
        if (Session["lt_assinfox"] != null)
        {
            lt_assinfox.Clear();
            lt_assinfox  = (List <pt.Assignment_info>)Session["lt_assinfox"];
            c_assinfo.ID = lt_assinfox[0].ID;
        }
        if (Session["lt_xprix"] != null)
        {
            lt_xprix.Clear();
            lt_xprix  = (List <pt.Priority_info>)Session["lt_xprix"];
            c_pri.xID = lt_xprix[0].xID;
        }
        SetLatestRowsFromGrid_App_gv();
        SetLatestRowsFromGrid_Inv_gv();
        c_ptinfo.reg_number         = "";
        c_ptinfo.xtype              = lbl_type.Text;
        c_ptinfo.title_of_invention = txt_title_of_invention.Text;
        c_ptinfo.pt_desc            = txt_pt_desc.Text;
        if (lt_pwx.Count > 0)
        {
            t.updatePwalletDate(lt_pwx[0].ID, TextBox1.Text);
            c_ptinfo.log_staff = lt_pwx[0].ID;
        }
        c_ptinfo.reg_date = TextBox1.Text;
        try
        {
            lt_mix[0].reg_date = TextBox1.Text;



            if ((lt_mix[0].reg_date == null) || (c_ptinfo.reg_date == ""))
            {
                c_ptinfo.reg_date = xreg_date;
            }
            else
            {
                c_ptinfo.reg_date = lt_mix[0].reg_date;
            }
        }

        catch (Exception ee)
        {
        }
        c_ptinfo.xvisible              = xvisible;
        c_ptinfo.claim_no              = "0";
        c_ptinfo.loa_no                = "0";
        c_ptinfo.pct_no                = "0";
        c_ptinfo.doa_no                = "0";
        c_assinfo.date_of_assignment   = txt_assignment_date.Text;
        c_assinfo.assignee_name        = txt_assignee_name.Text;
        c_assinfo.assignee_address     = txt_assignee_address.Text;
        c_assinfo.assignee_nationality = select_assignee_nationality.SelectedValue;
        c_assinfo.assignor_name        = txt_assignor_name.Text;
        c_assinfo.assignor_address     = txt_assignor_address.Text;
        c_assinfo.assignor_nationality = select_assignor_nationality.SelectedValue;
        if (lt_pwx.Count > 0)
        {
            c_assinfo.log_staff = lt_pwx[0].ID;
        }
        c_assinfo.visible = xvisible;
        c_rep.agent_code  = rep_code.Text;
        c_rep.xname       = rep_xname.Text;
        c_rep.nationality = "160";
        c_rep.country     = "160";
        c_rep.state       = select_rep_state.SelectedValue;
        c_rep.address     = txt_rep_address.Text;
        c_rep.xmobile     = txt_rep_telephone.Text;
        c_rep.xemail      = txt_rep_email.Text;
        c_rep.reg_date    = TextBox1.Text;
        if ((c_rep.reg_date == null) || (c_rep.reg_date == ""))
        {
            c_rep.reg_date = xreg_date;
        }
        c_rep.visible = xvisible;
        if (lt_pwx.Count > 0)
        {
            c_rep.log_staff = lt_pwx[0].ID;
        }
        if (Session["lt_app"] != null)
        {
            lt_app = (List <SortedList <string, string> >)Session["lt_app"];
        }
        if (Session["lt_inv"] != null)
        {
            lt_inv = (List <SortedList <string, string> >)Session["lt_inv"];
        }
        if (Session["lt_pri"] != null)
        {
            lt_pri = (List <SortedList <string, string> >)Session["lt_pri"];
        }
        if (lt_app.Count > 0)
        {
            for (num = 0; num < lt_app.Count; num++)
            {
                pt.Applicant applicant = new pt.Applicant
                {
                    xname       = lt_app[num]["txt_name_app"],
                    address     = lt_app[num]["txt_address_app"],
                    xemail      = lt_app[num]["txt_email_app"],
                    xmobile     = lt_app[num]["txt_mobile_app"],
                    nationality = lt_app[num]["select_app_nationality"]
                };
                if (Session["log_staff"] != null)
                {
                    applicant.log_staff = Session["log_staff"].ToString();
                }
                applicant.visible = xvisible;
                c_app             = null;
                c_app             = applicant;
                lt_xapp.Add(c_app);
            }
        }
        if (lt_inv.Count > 0)
        {
            for (num = 0; num < lt_inv.Count; num++)
            {
                pt.Inventor inventor = new pt.Inventor
                {
                    xname       = lt_inv[num]["txt_name_inv"],
                    address     = lt_inv[num]["txt_address_inv"],
                    xemail      = lt_inv[num]["txt_email_inv"],
                    xmobile     = lt_inv[num]["txt_mobile_inv"],
                    nationality = lt_inv[num]["select_inv_nationality"]
                };
                if (Session["log_staff"] != null)
                {
                    inventor.log_staff = Session["log_staff"].ToString();
                }
                inventor.visible = xvisible;
                c_inv            = null;
                c_inv            = inventor;
                lt_xinv.Add(c_inv);
            }
        }
        c_pri.countryID = select_country_pri.SelectedValue;
        c_pri.app_no    = txt_application_no_pri.Text;
        c_pri.xdate     = txt_date_pri.Text;
        if (Session["log_staff"] != null)
        {
            c_pri.log_staff = Session["log_staff"].ToString();
        }
        c_pri.xvisible = xvisible;
        lt_xpri.Add(c_pri);
        if (((((lt_mix.Count == 0) && (lt_repx.Count == 0)) && ((lt_appx.Count == 0) && (lt_invx.Count == 0))) && (lt_assinfox.Count == 0)) && (lt_xprix.Count == 0))
        {
            pt_succ = t.addNewPatent(lt_xapp, lt_xpri, lt_xinv, c_ptinfo, c_assinfo, c_rep);
        }
        else
        {
            if (lt_repx.Count == 0)
            {
                rep_updateID = t.addRepresentative(c_rep);
            }
            else
            {
                rep_updateID = t.updateRepresentative(c_rep);
            }
            if (lt_assinfox.Count == 0)
            {
                if (((((c_assinfo.assignee_name != null) && (c_assinfo.assignee_name != "")) && ((c_assinfo.date_of_assignment != null) && (c_assinfo.date_of_assignment != ""))) && (c_assinfo.ID != null)) && (c_assinfo.ID != ""))
                {
                    assinfo_updateID = t.addAssignment_info(c_assinfo);
                }
            }
            else if (((c_assinfo.ID != null)) && (c_assinfo.ID != ""))
            {
                assinfo_updateID = t.updateAssignment_info(c_assinfo);
            }
            if (lt_xprix.Count == 0)
            {
                //   pri_updateID = t.addPriority_info(c_pri);
            }
            else
            {
                foreach (GridViewRow row in Gridview1.Rows)
                {
                    String box  = ((TextBox)row.FindControl("txt_name_pri")).Text;
                    String box2 = ((TextBox)row.FindControl("txt_pri_date")).Text;

                    String box3 = ((TextBox)row.FindControl("vid")).Text;

                    String box4 = ((DropDownList)row.FindControl("select_inv_nationality2")).SelectedValue;
                    var    dd   = "";
                    c_pri.app_no    = box;
                    c_pri.countryID = box4;
                    c_pri.xdate     = box2;

                    c_pri.xID = box3;
                    if (box3 != "")
                    {
                        pri_updateID = t.updatePriority_info(c_pri);
                    }
                    // TextBox box = ((TextBox)row.FindControl("txt_name_pri");
                }


                for (num = 0; num < lt_pri.Count; num++)
                {
                    //  pri_updateID = t.updatePriority_info(c_pri);
                }
            }
            if (lt_xapp.Count == 0)
            {
                foreach (pt.Applicant applicant2 in lt_xapp)
                {
                    if ((applicant2.xname != null) && (applicant2.xname != ""))
                    {
                        app_updateID = t.addApplicant(applicant2);
                    }
                }
            }
            else
            {
                t.deleteApplicant(lt_pwx[0].ID);
                foreach (pt.Applicant applicant2 in lt_xapp)
                {
                    if ((applicant2.xname != null) && (applicant2.xname != ""))
                    {
                        app_updateID = t.addApplicant(applicant2);
                    }
                }
            }
            if (lt_xinv.Count == 0)
            {
                foreach (pt.Inventor inventor2 in lt_xinv)
                {
                    if ((inventor2.xname != null) && (inventor2.xname != ""))
                    {
                        inv_updateID = t.addInventor(inventor2);
                    }

                    else
                    {
                        t.deleteInventor(inventor2.log_staff);
                    }
                }
            }
            else
            {
                t.deleteInventor(lt_pwx[0].ID);
                foreach (pt.Inventor inventor2 in lt_xinv)
                {
                    if ((inventor2.xname != null) && (inventor2.xname != ""))
                    {
                        inv_updateID = t.addInventor(inventor2);
                    }

                    else
                    {
                        t.deleteInventor(inventor2.log_staff);
                    }
                }
            }
            if (lt_mix.Count == 0)
            {
                mix_updateID = t.addPt(c_ptinfo);
                t.updatePtReg(mix_updateID, c_ptinfo.xtype);
                Session["mix_updateID"] = c_ptinfo.xID;
                if (Convert.ToInt32(mix_updateID) > 0)
                {
                    Response.Redirect("./edit_form_docs.aspx");
                }
            }
            else
            {
                mix_updateID = t.updatePtInfo(c_ptinfo);
                // t.updatePtReg(c_ptinfo.xID, c_ptinfo.xtype);
                Session["mix_updateID"] = c_ptinfo.xID;
                if (Convert.ToInt32(mix_updateID) > 0)
                {
                    Response.Redirect("./edit_form_docs.aspx");
                }
            }

            t.activity_log(admin, "Edit Application", "Update", lt_pwx[0].ID, lt_pwx[0].data_status, oldproduct_title, txt_title_of_invention.Text, oldname, lt_app[0]["txt_name_app"], "", "");
        }
    }