Example #1
0
        private void upload_Clicked(object sender, EventArgs e)
        {
            if (Session["g_officeID"] != null)
            {
                doc_path = base.Server.MapPath("~/") + "admin/tm/generic/G_Docz/" + Session["g_officeID"].ToString() + "/";
                if (!Directory.Exists(doc_path))
                {
                    Directory.CreateDirectory(doc_path);
                }

                if (IsValid && fu_sup_doc1.HasFile)
                {
                    sup_doc1_newfilename = Path.Combine(doc_path, fu_sup_doc1.FileName.Replace(" ", "_"));
                    fu_sup_doc1.MoveTo(sup_doc1_newfilename, MoveToOptions.Overwrite);
                }
                if (IsValid && fu_sup_doc2.HasFile)
                {
                    sup_doc2_newfilename = Path.Combine(doc_path, fu_sup_doc2.FileName.Replace(" ", "_"));
                    fu_sup_doc2.MoveTo(sup_doc2_newfilename, MoveToOptions.Overwrite);
                }
                if (IsValid && fu_sup_doc3.HasFile)
                {
                    sup_doc3_newfilename = Path.Combine(doc_path, fu_sup_doc3.FileName.Replace(" ", "_"));
                    fu_sup_doc3.MoveTo(sup_doc3_newfilename, MoveToOptions.Overwrite);
                }
                sup_doc1_newfilename = sup_doc1_newfilename.Replace(base.Server.MapPath("~/") + "admin/tm/", "");
                sup_doc2_newfilename = sup_doc2_newfilename.Replace(base.Server.MapPath("~/") + "admin/tm/", "");
                sup_doc3_newfilename = sup_doc3_newfilename.Replace(base.Server.MapPath("~/") + "admin/tm/", "");


                Session["sup_doc1_newfilename"] = sup_doc1_newfilename;
                Session["sup_doc2_newfilename"] = sup_doc2_newfilename;
                Session["sup_doc3_newfilename"] = sup_doc3_newfilename;

                if (Session["g_officeID"] != null)
                {
                    if (t.UpdateG_TmOfficeDocz(sup_doc1_newfilename, sup_doc2_newfilename, sup_doc3_newfilename, Session["g_officeID"].ToString()) > 0)
                    {
                        logo_text   = "1";
                        this.status = "1";
                        if (this.status == "1")
                        {
                            ack_status = "1";
                        }
                        else
                        {
                            // base.Response.Redirect("http://www.iponigeria.com/userarea/dashboard");
                        }
                    }
                }
            }
        }