Example #1
0
        private void SendMail()
        {
            SendMailUtility objUtl = new SendMailUtility();

            objUtl.SenMailFeedback_NIC(txtUserID.Text, txt_desc.Text, txt_email.Text);
            //objUtl.SendAlertEmail_MC_NIC_NotAttachment(MCID, emailAlert, txtDocName.Text, txtSenderName.Text, "", "",
            //      ((UserDetails)Session[clsConstant.TOKEN]).Designation, ((UserDetails)Session[clsConstant.TOKEN]).Agency);
        }
Example #2
0
 public void ForgetPasswordReset(string loginid)
 {
     try
     {
         DataTable       dt      = new DataTable();
         SendMailUtility objmail = new SendMailUtility();
         dt = GetUserDetailsForget(HttpUtility.HtmlEncode(loginid));
         if (dt.Rows.Count > 0)
         {
             string      UniqueId = GetUniqueKey();
             MailUtility objm     = new MailUtility();
             OTPIdEmail.Value = dt.Rows[0]["vsEmailID"].ToString();
             objmail.SendRsetPasswordLinkMail(dt.Rows[0]["vsEmailID"].ToString(), UniqueId);
             int success = sendForgetOtpBL(HttpUtility.HtmlEncode(txtLoginId.Text), UniqueId);
             OTPId.Value = txtLoginId.Text;
             //string message = "OTP has been sent to your registered Email Address for validation for reset password, Please check your Email";
             //string url = "ResetPassword.aspx";
             //string script = "window.onload = function(){ alert('";
             //script += message;
             //script += "');";
             //script += "window.location = '";
             //script += url;
             //script += "'; }";
             //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Redirect", script, true);
             //Alert.show("OTP and Forget password link send to your mail Id");
             lblOTPInfo.Text = "<span style='padding-left:15px; color:green'>OTP has been sent on your registered Mail</span>";
             litInfo.Text    = "";
             txtotp.Text     = "";
             LoginPanel.Style.Add("display", "none");
             id01.Style.Add("display", "block");
         }
         else
         {
             lblOTPInfo.Text = "";
             litInfo.Text    = "UserName  is not exist, Please Enter correct UserName";
             // txtLoginId.Text = "";
             txtLoginId.Focus();
             Clear();
             LoginPanel.Style.Add("display", "block");
             id01.Style.Add("display", "none");
         }
     }
     catch (Exception ex)
     {
         LogError(ex);
     }
 }
Example #3
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                HttpFileCollection hfc = Request.Files;
                FileUpload(hfc);

                lblMessage.Text = "";
                string sTAorLoan = "T";
                if (ddlFundType.SelectedIndex == 1)
                {
                    sTAorLoan = "P";
                }

                if (ddlFundType.SelectedIndex == 2)
                {
                    sTAorLoan = "L";
                }

                Byte[]   readByteFile = null;
                string   fileName     = string.Empty;
                string   contentType  = string.Empty;
                string[] filePath     = Directory.GetFiles(Server.MapPath(@"/writereaddata/" + MCID + "/"), "*", SearchOption.AllDirectories);


                string[] sListToEmail = new string[lstToSelectedEmail.Items.Count + 1];  // before hre two

                string         emailAlert = string.Empty;
                string         sql        = "select * from tblUserMaster where iUserID=" + Session["toUserid"].ToString();
                SqlConnection  cn         = new SqlConnection(ConfigurationManager.ConnectionStrings["TA7511DBConnString"].ConnectionString);
                SqlDataAdapter ad         = new SqlDataAdapter(sql, cn);
                DataSet        ds         = new DataSet();
                ad.Fill(ds);

                emailAlert = "";
                int iloop;

                for (iloop = 0; iloop < lstToSelectedEmail.Items.Count; iloop++)
                {
                    sListToEmail[iloop] = lstToSelectedEmail.Items[iloop].Value;

                    string email  = lstToSelectedEmail.Items[iloop].Text;
                    int    getPos = email.IndexOf("),");
                    emailAlert += email.Substring(getPos + 2) + ';';
                }
                if (ds.Tables[0].Rows.Count > 0)
                {
                    emailAlert         += ds.Tables[0].Rows[0]["vsEmailID"].ToString() + ';';
                    sListToEmail[iloop] = Session["toUserid"].ToString();
                }

                iloop++;
                emailAlert += (((UserDetails)Session[clsConstant.TOKEN]).EmailID).ToString() + ';';


                string[] sListCCEmail = new string[lstCCSelected.Items.Count];
                for (iloop = 0; iloop < lstCCSelected.Items.Count; iloop++)
                {
                    sListCCEmail[iloop] = lstCCSelected.Items[iloop].Value;

                    //// mailalert
                    string email  = lstCCSelected.Items[iloop].Text;
                    int    getPos = email.IndexOf("),");
                    emailAlert += email.Substring(getPos + 2) + ';';
                }
                objSendNewDoc = new clsSendNewDocument();

                int iDocID = -1;
                if (lblMCFOR.Text == "Loan")
                {
                    LoanID    = ddlLoanOrTA.SelectedValue;
                    TAID      = "0";
                    sTAorLoan = "L";
                }
                else if (lblMCFOR.Text == "TA")
                {
                    TAID      = ddlLoanOrTA.SelectedValue;
                    LoanID    = "0";
                    sTAorLoan = "T";
                }

                else if (lblMCFOR.Text == "Project")
                {
                    PROJID    = ddlLoanOrTA.SelectedValue;
                    LoanID    = "0";
                    sTAorLoan = "P";
                }
                else if (lblMCFOR.Text == "Reta")
                {
                    sTAorLoan         = "R";
                    hdnSectorID.Value = "10";
                }
                else
                {
                    sTAorLoan         = "S";
                    hdnSectorID.Value = "10";
                }
                // Comment on 25 Nov 2013
                if (btnSubmit.Visible && (lstToSelectedEmail.Text != "" || ds.Tables[0].Rows.Count > 0)) // && Request.QueryString["MCID"] == null
                {
                    iDocID = objSendNewDoc.addSendNewDocument_WB(
                        PROJID == "" ? 0 : int.Parse(PROJID),

                        sTAorLoan,
                        ddlLoanOrTA.SelectedValue == "" ? 0 : int.Parse(ddlLoanOrTA.SelectedValue),
                        int.Parse(hdnDocumentTypeId.Value),
                        int.Parse(hdnSectorID.Value),

                        "",
                        txtDocName.Text,
                        Convert.ToDateTime(txtDueDate.Text), 0,
                        ((UserDetails)Session[clsConstant.TOKEN]).UserID,
                        sListToEmail,
                        sListCCEmail,
                        fileName, contentType,
                        readByteFile,
                        txtMultiLine.Text, null, int.Parse(MCID), 0, 0, 0, ((UserDetails)Session[clsConstant.TOKEN]).EAP);
                }


                else
                {
                    lblMessage.Text = "Please select at-least one user";
                }


                if (iDocID != 0 && iDocID != -1 && (lstToSelectedEmail.Text != "" || ds.Tables[0].Rows.Count > 0))

                {
                    SendMailUtility objUtl    = new SendMailUtility();
                    string[]        Fileatach = Directory.GetFiles(Server.MapPath(@"/writereaddata/" + MCID), "*", SearchOption.AllDirectories);
                    int             size      = Fileatach.Length;
                    string[]        attach    = new string[size];

                    if (Fileatach.Length > 1)
                    {
                        for (int i = 0; i < size; i++)
                        {
                            attach[i] = Fileatach[i];
                        }
                    }



                    if (!string.IsNullOrEmpty(Request.QueryString["MCID"]))
                    {
                        try
                        {
                            iDraftID = Request.QueryString["MCID"].ToString() + "_ADB";
                            (new UserSaveDraft()).deleteDraft(iDraftID);
                        }
                        catch (Exception ex)
                        {
                        }
                    }

                    urlWrapper = new UrlParameterPasser("Dashboard.aspx");

                    Session["userMsg"] = "Document has been sent successfully . Your Document Sent ID is " + iDocID;
                    urlWrapper.PassParameters();

                    sql = string.Empty;
                    string isector = string.Empty;
                    if (int.Parse(hdnSectorID.Value) != null)
                    {
                        isector = hdnSectorID.Value;
                    }

                    else

                    {
                        isector = "10";
                    }

                    sql = "Update tblMC set DOCID =" + iDocID + " , iSectorID = " + int.Parse(isector) + " , iUserId = " + ((UserDetails)Session[clsConstant.TOKEN]).UserID + "   where iMissionClearanceId =" + MCID + " ";

                    cn = new SqlConnection(ConfigurationManager.ConnectionStrings["TA7511DBConnString"].ConnectionString);
                    SqlCommand cmd = new SqlCommand(sql, cn);

                    cn.Close();
                    cn.Open();
                    cmd.ExecuteNonQuery();
                    //SendAlertEmail_MC_NIC_WithAttachment
                    //objUtl.SendAlertEmail_MC_NIC_WithAttachment(MCID, emailAlert, txtDocName.Text, txtSenderName.Text, "", "",
                    //                   ((UserDetails)Session[clsConstant.TOKEN]).Designation, ((UserDetails)Session[clsConstant.TOKEN]).Agency);

                    //hide by pramod on 31/05/2018
                    objUtl.SendAlertEmail_MC_NIC_NotAttachment(MCID, emailAlert, txtDocName.Text, txtSenderName.Text, "", "",
                                                               ((UserDetails)Session[clsConstant.TOKEN]).Designation, ((UserDetails)Session[clsConstant.TOKEN]).Agency);



                    Session["userMsg"] = "Mission clearance request number : " + MCID + "  has been successfully sent.";
                }
                else
                {
                    lblMessage.ForeColor = System.Drawing.Color.Red;
                    lblMessage.Text      = "Sorry Unable to sent document";
                }
            }
            catch (Exception ex)
            {
                lblMessage.Text = ex.ToString();
            }
        }