예제 #1
0
    void AsyncFileUpload1_UploadedComplete(object sender, AsyncFileUploadEventArgs e)
    {
        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "size", "top.$get(\"" + uploadResult.ClientID + "\").innerHTML = 'Uploaded size: " + AsyncFileUpload1.FileBytes.Length.ToString() + "';", true);

        // Uncomment to save to AsyncFileUpload\Uploads folder.
        // ASP.NET must have the necessary permissions to write to the file system.
        string extension = Path.GetExtension(AsyncFileUpload1.PostedFile.FileName);
        string filename  = "Applicant-" + applicantID + "-Letter Of Entitlement" + extension;
        string path      = Server.MapPath("/Applicant_Data/applicant-" + applicantID);

        if (!Directory.Exists(path))
        {
            Directory.CreateDirectory(path);
        }
        if (loe != null)
        {
            File.Delete(Server.MapPath(loe));
        }
        AsyncFileUpload1.SaveAs(path + "/" + filename);
        ApplicantReg obj = new ApplicantReg();

        obj.ApplicantID = applicantID;
        obj.saveLOE("Applicant_Data/applicant-" + applicantID + "/" + filename);
        DataSet dset = obj.retrieveData(applicantID);

        loadData(dset);
        //string savePath = MapPath("Uploads/" + Path.GetFileName(e.filename));
        //AsyncFileUpload1.SaveAs(savePath);
    }
예제 #2
0
    protected bool phase1(ApplicantReg obj)
    {
        obj.ApplicantID = applicantID;
        DataSet dset = obj.applicationComplete();

        if (dset.Tables[0].Rows.Count > 0)
        {
            return(Convert.ToBoolean(dset.Tables[0].Rows[0]["Complete"].ToString()));
        }
        return(false);
    }
예제 #3
0
    protected void ButtonSave_Click(object sender, EventArgs e)
    {
        string oilCompany    = TextBoxOliCompany.Text.Trim();
        string applicantName = TextBoxApplicant_Name.Text.Trim();
        string temp          = null;

        if (RadioButtonSO.Checked == true)
        {
            temp = "S/o";
        }
        else if (RadioButtonWO.Checked == true)
        {
            temp = "W/o";
        }
        else
        {
            temp = "D/o";
        }
        string swd;

        if (TextBoxSWD.Text.Trim().Contains("S/o") || TextBoxSWD.Text.Trim().Contains("W/o") || TextBoxSWD.Text.Trim().Contains("D/o"))
        {
            swd = TextBoxSWD.Text.Trim();
        }
        else
        {
            swd = temp + " " + TextBoxSWD.Text.Trim();
        }
        string       address     = TextBoxAddress.Text.Trim();
        string       subdivision = DropDownListSubDivision.SelectedItem.ToString();
        string       district    = DropDownListDistrict.SelectedItem.ToString();
        string       loc         = TextBoxLOCPetrolPump.Text.Trim();
        ApplicantReg obj         = new ApplicantReg();
        string       result      = obj.saveData(oilCompany, applicantName, swd, address, subdivision, district, loc, applicantID);

        if (result == "Exception Occured")
        {
            Response.Write("<script>alert(" + result + ")</script>");
        }
        else if (Convert.ToInt32(result) > 0)
        {
            //result = obj.addAppIDtoNOC_View(applicantID);
            //if (result.Contains("Occured"))
            //{
            //    Response.Write("<script>alert(" + result + ")</script>");
            //}
            //else
            MultiView1.ActiveViewIndex = 1;
        }
        else
        {
            Response.Write("<script>alert('error occured!')</script>");
        }
    }
예제 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["type"] == null)
     {
         Session["noti"] = "Session Timed out";
         Response.Redirect("Default.aspx");
     }
     //AsyncFileUpload1.UploaderStyle = AjaxControlToolkit.AsyncFileUpload.UploaderStyleEnum.Modern;
     AsyncFileUpload1.UploadedComplete     += new EventHandler <AsyncFileUploadEventArgs>(AsyncFileUpload1_UploadedComplete);
     AsyncFileUpload1.UploadedFileError    += new EventHandler <AsyncFileUploadEventArgs>(AsyncFileUpload1_UploadedFileError);
     AsyncFileUploadFard.UploadedComplete  += new EventHandler <AsyncFileUploadEventArgs>(AsyncFileUploadFard_UploadedComplete);
     AsyncFileUploadFard.UploadedFileError += new EventHandler <AsyncFileUploadEventArgs>(AsyncFileUpload1_UploadedFileError);
     AsyncFileUploadAks.UploadedComplete   += new EventHandler <AsyncFileUploadEventArgs>(AsyncFileUploadAks_UploadedComplete);
     AsyncFileUploadAks.UploadedFileError  += new EventHandler <AsyncFileUploadEventArgs>(AsyncFileUpload1_UploadedFileError);
     AsyncFileUploadSite.UploadedComplete  += new EventHandler <AsyncFileUploadEventArgs>(AsyncFileUploadSite_UploadedComplete);
     AsyncFileUploadSite.UploadedFileError += new EventHandler <AsyncFileUploadEventArgs>(AsyncFileUpload1_UploadedFileError);
     AsyncFileUploadAffi.UploadedComplete  += new EventHandler <AsyncFileUploadEventArgs>(AsyncFileUploadAffi_UploadedComplete);
     AsyncFileUploadAffi.UploadedFileError += new EventHandler <AsyncFileUploadEventArgs>(AsyncFileUpload1_UploadedFileError);
     if (!IsPostBack)
     {
         if (Session["type"] != null && Session["type"].ToString() == "1")
         {
             ApplicantReg obj = new ApplicantReg();
             obj.Username = Session["unm"].ToString();
             DataSet dset = obj.retrieveData();
             applicantID = obj.ApplicantID;
             if (!phase1(obj))
             {
                 loadData(dset);
             }
             else
             {
                 Session["appID"] = applicantID;
                 Response.Redirect("ApplicantNOC.aspx");
             }
         }
         else
         {
             Session["noti"] = "Session Timed out";
             Response.Redirect("Default.aspx");
         }
     }
 }
예제 #5
0
 //protected void LinkButtonLetterOfEnt_Click(object sender, EventArgs e)
 //{
 //    if (FileUploadLetterOfEnt.HasFile)
 //    {
 //        string extension = Path.GetExtension(FileUploadLetterOfEnt.PostedFile.FileName);
 //        string filename = "Applicant-" + applicantID + "-Letter Of Entitlement" + extension;
 //        string path = Server.MapPath("/Applicant_Data/applicant-" + applicantID);
 //        if (!Directory.Exists(path))
 //        {
 //            Directory.CreateDirectory(path);
 //        }
 //        if (loe != null)
 //            File.Delete(Server.MapPath(loe));
 //        FileUploadLetterOfEnt.SaveAs(path + "/" + filename);
 //        ApplicantReg obj = new ApplicantReg();
 //        obj.ApplicantID = applicantID;
 //        obj.saveLOE("Applicant_Data/applicant-" + applicantID + "/" + filename);
 //        DataSet dset = obj.retrieveData(applicantID);
 //        loadData(dset);
 //    }
 //}
 void AsyncFileUploadFard_UploadedComplete(object sender, AsyncFileUploadEventArgs e)
 {
     if (AsyncFileUploadFard.HasFile)
     {
         string extension = Path.GetExtension(AsyncFileUploadFard.PostedFile.FileName);
         string filename  = "Applicant-" + applicantID + "-Fard" + extension;
         string path      = Server.MapPath("/Applicant_Data/applicant-" + applicantID);
         if (!Directory.Exists(path))
         {
             Directory.CreateDirectory(path);
         }
         if (fard != null)
         {
             File.Delete(Server.MapPath(fard));
         }
         AsyncFileUploadFard.SaveAs(path + "/" + filename);
         ApplicantReg obj = new ApplicantReg();
         obj.ApplicantID = applicantID;
         obj.saveFard("Applicant_Data/applicant-" + applicantID + "/" + filename);
         DataSet dset = obj.retrieveData(applicantID);
         loadData(dset);
     }
 }
예제 #6
0
 protected void ButtonSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         user obj = new user();
         obj.Name = TextBoxName.Text.Trim();
         obj.Username = TextBoxEmail.Text.Trim();
         string password = TextBoxPassword.Text;
         obj.Password = FormsAuthentication.HashPasswordForStoringInConfigFile(password, "MD5");
         obj.Contact = Convert.ToInt64(TextBoxContact.Text);
         string result = obj.registerApplicant();
         if (result == "Exception Occured")
         {
             Response.Write("<script>alert('Exception Occured')</script>");
         }
         else if(result =="Unique Key")
             Response.Write("<script>alert('Email Id already exists')</script>");
         else if (Convert.ToInt32(result) > 0)
         {
             int appId = Convert.ToInt32(obj.getApplicantID());
             ApplicantReg ap = new ApplicantReg();
             ap.ApplicantID = appId;
             ap.insertApplicantId();
             Email em = new Email();
             em.SendEmail(obj.Username,"Registration Successful","Dear Applicant,\r\n you have been successfully registered with us. Kindly login with your credentials at http://www.noconlinepunjab.com/login.aspx");
             Response.Redirect("Success.aspx",true);
         }
         else
             Response.Write("<script>alert('Registeration Failed')</script>");
     }
     catch (Exception ex)
     {
         writeException obj = new writeException();
         obj.WriteExceptionToFile(ex, "Register-ButtonSubmit");
         Response.Write("<script>alert('Exception Occured')</script>");
     }
 }
예제 #7
0
    protected void ButtonSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            ApplicantReg obj  = new ApplicantReg();
            DataSet      dset = obj.retrieveData(applicantID);
            if (dset.Tables[0].Rows[0]["Affidavit"].ToString().Length > 1 && dset.Tables[0].Rows[0]["Aks_Sajra"].ToString().Length > 1 && dset.Tables[0].Rows[0]["Letter_of_Entitlement"].ToString().Length > 1 && dset.Tables[0].Rows[0]["Site_Plan"].ToString().Length > 1 && dset.Tables[0].Rows[0]["Fard"].ToString().Length > 1)
            {
                //string oilCompany = TextBoxOliCompany.Text.Trim();
                //string applicantName = TextBoxApplicant_Name.Text.Trim();
                //string temp = null;
                //if (RadioButtonSO.Checked == true)
                //    temp = "S/o";
                //else if (RadioButtonWO.Checked == true)
                //    temp = "W/o";
                //else
                //    temp = "D/o";
                //string swd = temp + " " + TextBoxSWD.Text.Trim();
                //string address = TextBoxAddress.Text.Trim();
                //string subdivision = DropDownListSubDivision.SelectedItem.ToString();
                //string district = DropDownListDistrict.SelectedItem.ToString();
                //string loc = TextBoxLOCPetrolPump.Text.Trim();
                //ApplicantReg obj = new ApplicantReg();
                //string result = obj.saveData(oilCompany, applicantName, swd, address, subdivision, district, loc,applicantID);
                //if (result == "Exception Occured")
                //    Response.Write("<script>alert(" + result + ")</script>");
                //else if (Convert.ToInt32(result) > 0)
                //{
                //    result = obj.addAppIDtoNOC_View(applicantID);
                //    if (result.Contains("Occured"))
                //    {
                //        Response.Write("<script>alert(" + result + ")</script>");
                //    }
                //    else
                //        Response.Redirect("Receipt.aspx?r=" + applicantID);
                //}
                //else
                //    Response.Write("<script>alert('error occured!')</script>");

                string    query  = "update Applicant set Complete=1 where Applicant_ID=" + applicantID;
                dbConnect d      = new dbConnect();
                string    result = d.executeNonQuery(query);
                if (result.Contains("Occured"))
                {
                    Response.Write("<script>alert(" + result + ")</script>");
                }
                else if (Convert.ToInt32(result) > 0)
                {
                    result = obj.addAppIDtoNOC_View(applicantID);
                    if (result.Contains("Occured"))
                    {
                        Response.Write("<script>alert(" + result + ")</script>");
                    }
                    else
                    {
                        Email em = new Email();
                        em.SendEmail(Session["unm"].ToString(), "Success", "Dear Applicant, \r\n We have successfully received your application. Your reference number is " + applicantID + " You may submit your application in Suwidha Centre along with all original documents mentioned at the time of registration within one week after the generation of this receipt.");
                        Response.Redirect("Receipt.aspx?r=" + applicantID, false);
                    }
                }
            }
            else
            {
                Response.Write("<script>alert(\"Please upload all the documents\")</script>");
            }
        }
        catch (Exception ex)
        {
            writeException obj = new writeException();
            obj.WriteExceptionToFile(ex, "Applicant.aspx.cs=ButtonSubmit_Click");
        }
    }