コード例 #1
0
 private void upload_Clicked(object sender, EventArgs e)
 {
     if (Session["new_miID"] != null)
     {
         doc_path = base.Server.MapPath("~/") + "admin/tm/gf/docz/" + Session["new_miID"].ToString() + "/";
         if (!Directory.Exists(doc_path))
         {
             Directory.CreateDirectory(doc_path);
         }
         if (app_type == "cert")
         {
             if (base.IsValid && fu_cert_doc.HasFile)
             {
                 cert_doc_newfilename = Path.Combine(doc_path, fu_cert_doc.FileName.Replace(" ", "_"));
                 fu_cert_doc.MoveTo(Path.Combine(doc_path, fu_cert_doc.FileName.Replace(" ", "_")), MoveToOptions.Overwrite);
                 cert_doc_newfilename            = cert_doc_newfilename.Replace(base.Server.MapPath("~/") + "admin/tm/gf/", "");
                 Session["cert_doc_newfilename"] = cert_doc_newfilename;
             }
             if (base.IsValid && fu_pub_doc.HasFile)
             {
                 pub_doc_newfilename = Path.Combine(doc_path, fu_pub_doc.FileName.Replace(" ", "_"));
                 fu_pub_doc.MoveTo(pub_doc_newfilename, MoveToOptions.Overwrite);
                 pub_doc_newfilename            = pub_doc_newfilename.Replace(base.Server.MapPath("~/") + "admin/tm/gf/", "");
                 Session["pub_doc_newfilename"] = pub_doc_newfilename;
             }
             if (Session["certID"] != null)
             {
                 t.updateGeneral_G_TmDocz(cert_doc_newfilename, pub_doc_newfilename, "cert", Session["certID"].ToString());
             }
             app_type = "";
         }
         if (app_type == "ass")
         {
             if (base.IsValid && fu_ass_doc.HasFile)
             {
                 ass_doc_newfilename = Path.Combine(doc_path, fu_ass_doc.FileName.Replace(" ", "_"));
                 fu_ass_doc.MoveTo(ass_doc_newfilename, MoveToOptions.Overwrite);
                 ass_doc_newfilename            = ass_doc_newfilename.Replace(base.Server.MapPath("~/") + "admin/tm/gf/", "");
                 Session["ass_doc_newfilename"] = ass_doc_newfilename;
                 if (Session["assID"] != null)
                 {
                     t.updateGeneral_G_TmDocz(ass_doc_newfilename, "", "ass", Session["assID"].ToString());
                 }
             }
             app_type = "";
         }
         if (app_type == "merger")
         {
             if (base.IsValid && fu_merger_doc.HasFile)
             {
                 merger_doc_newfilename = Path.Combine(doc_path, fu_merger_doc.FileName.Replace(" ", "_"));
                 fu_merger_doc.MoveTo(merger_doc_newfilename, MoveToOptions.Overwrite);
                 merger_doc_newfilename            = merger_doc_newfilename.Replace(base.Server.MapPath("~/") + "admin/tm/gf/", "");
                 Session["merger_doc_newfilename"] = merger_doc_newfilename;
                 if (Session["mergerID"] != null)
                 {
                     t.updateGeneral_G_TmDocz(cert_doc_newfilename, "", "merger", Session["mergerID"].ToString());
                 }
             }
             app_type = "";
         }
         if (((Session["logo_desc"] != null) && (Session["logo_desc"].ToString() == "yes")) && (base.IsValid && fu_logo_pic.HasFile))
         {
             logo_pic_newfilename = Path.Combine(doc_path, fu_logo_pic.FileName.Replace(" ", "_"));
             fu_logo_pic.MoveTo(logo_pic_newfilename, MoveToOptions.Overwrite);
             logo_pic_newfilename            = logo_pic_newfilename.Replace(base.Server.MapPath("~/") + "admin/tm/gf/", "");
             Session["logo_pic_newfilename"] = logo_pic_newfilename;
         }
         if (base.IsValid && fu_app_doc.HasFile)
         {
             app_doc_newfilename = Path.Combine(doc_path, fu_app_doc.FileName.Replace(" ", "_"));
             fu_app_doc.MoveTo(app_doc_newfilename, MoveToOptions.Overwrite);
             app_doc_newfilename            = app_doc_newfilename.Replace(base.Server.MapPath("~/") + "admin/tm/gf/", "");
             Session["app_doc_newfilename"] = app_doc_newfilename;
         }
         if (base.IsValid && fu_sup_doc.HasFile)
         {
             sup_doc_newfilename = Path.Combine(doc_path, fu_sup_doc.FileName.Replace(" ", "_"));
             fu_sup_doc.MoveTo(sup_doc_newfilename, MoveToOptions.Overwrite);
             sup_doc_newfilename            = sup_doc_newfilename.Replace(base.Server.MapPath("~/") + "admin/tm/gf/", "");
             Session["sup_doc_newfilename"] = sup_doc_newfilename;
         }
         if (((Session["new_miID"] != null) && (Session["new_miID"].ToString() != "")) && ((Session["pwalletID"] != null) && (Session["pwalletID"].ToString() != "")))
         {
             if (Convert.ToInt16(t.updateG_TmDocz(app_doc_newfilename, logo_pic_newfilename, sup_doc_newfilename, Session["new_miID"].ToString())) > 0)
             {
                 string str = t.updateGPwalletStage(Session["pwalletID"].ToString(), "5");
                 if ((str != "") && (str != "0"))
                 {
                     ack_status = "1";
                 }
                 else
                 {
                     base.Response.Redirect(ConfigurationManager.AppSettings["ipo_profile_page"]);
                 }
             }
             else
             {
                 base.Response.Redirect(ConfigurationManager.AppSettings["ipo_profile_page"]);
             }
         }
         else
         {
             base.Response.Redirect(ConfigurationManager.AppSettings["ipo_profile_page"]);
         }
     }
 }