private void ShowViewAcknowledgementAcceptancedetails()
 {
     try
     {
         obj = new AcknowledgementAcceptanceBL();
         DataTable dt = obj.GetPosionActionBL(Session["UserId"].ToString());
         GrdAcknowledgementAcceptance.DataSource = dt;
         GrdAcknowledgementAcceptance.DataBind();
         ViewState["AcknowledgementAcceptanceData"] = dt;
     }
     catch (Exception ex)
     {
         LogError(ex);
     }
 }
Beispiel #2
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         obj = new AcknowledgementAcceptanceBL();
         string FileName   = string.Empty;
         string folderPath = Server.MapPath("~/writedata/AcknowledgementAcceptance/");
         //Check whether Directory (Folder) exists.
         if (!Directory.Exists(folderPath))
         {
             //If Directory (Folder) does not exists. Create it.
             Directory.CreateDirectory(folderPath);
         }
         if (fuAttachment.HasFile == true)
         {
             if (ValidatePDF(fuAttachment))
             {
                 FileName = "AcknowledgementAcceptance_" + HttpUtility.HtmlEncode(ddlPprid.SelectedValue) + "_" + CommonUtility.GetDate(DateTime.Now);
             }
             else
             {
                 return;
             }
         }
         int success = obj.SendAcknowledgementAcceptanceBL(ddlPprid.SelectedValue, ddlPosingAction.SelectedValue, FileName, HttpUtility.HtmlEncode(txtRemarks.Text), Session["UserId"].ToString());
         if (success > 0)
         {
             fuAttachment.SaveAs(folderPath + "\\" + FileName + ".pdf");
             SendToCC(success.ToString(), folderPath + FileName, ddlPprid.SelectedItem.Text, ddlPosingAction.SelectedItem.Text, HttpUtility.HtmlEncode(txtRemarks.Text));
             lblmesg.Text      = ddlPosingAction.SelectedItem.Text + " is Successfully Saved.";
             lblmesg.ForeColor = System.Drawing.Color.Green;
             ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Posing Action is Successfully Saved.');window.location ='AcknowledgementAcceptance.aspx';", true);
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Posing Action is not Successfully Saved.Please try again!');window.location ='AcknowledgementAcceptance.aspx';", true);
             lblmesg.Text      = ddlPosingAction.SelectedItem.Text + " is no Successfully Saved.Please try again!";
             lblmesg.ForeColor = System.Drawing.Color.Red;
         }
         //Response.Redirect(Request.Url.ToString());
     }
     catch (Exception ex)
     {
         LogError(ex);
     }
 }
Beispiel #3
0
    protected void SendToCC(string DocSendId, string FileName, string PprId, string PosingAction, string Remarks)
    {
        try
        {
            MailUtilityForDoc ojm = new MailUtilityForDoc();
            obj             = new AcknowledgementAcceptanceBL();
            lblMessage.Text = "";
            string[] sListToEmail = new string[lstToSelectedEmail.Items.Count];
            string   UserIdTo     = string.Empty;
            string   ToEmail      = string.Empty;
            for (int iloop = 0; iloop < lstToSelectedEmail.Items.Count; iloop++)
            {
                sListToEmail[iloop] = lstToSelectedEmail.Items[iloop].Value;
                string   email = lstToSelectedEmail.Items[iloop].Value;
                String[] parts = email.Split(new[] { ';' });
                ToEmail += parts[0] + ";";
                UserIdTo = parts[1];
                int success = obj.AddSendToCcBL(DocSendId, "1", UserIdTo);
            }

            string[] sListCCEmail = new string[lstCcSelectedEmail.Items.Count];
            string   CcEmail      = string.Empty;
            string   UserIdCc     = string.Empty;
            for (int iloop = 0; iloop < lstCcSelectedEmail.Items.Count; iloop++)
            {
                sListCCEmail[iloop] = lstCcSelectedEmail.Items[iloop].Value;

                string   email = lstCcSelectedEmail.Items[iloop].Value;
                String[] parts = email.Split(new[] { ';' });
                CcEmail += parts[0] + ";";
                UserIdCc = parts[1];
                int success = obj.AddSendToCcBL(DocSendId, "0", UserIdCc);
            }
            ojm.SendToCcAcknowledgementAcceptance(ToEmail, CcEmail, PprId, PosingAction, FileName + ".pdf", Remarks, ddlPosingAction.SelectedItem.Text, "");
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Beispiel #4
0
 protected void ddlEmailGroup_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         obj = new AcknowledgementAcceptanceBL();
         DataTable dt = obj.GetAgencyWiseEmailBL(ddlEmailGroup.SelectedValue);
         lstToEmail.DataSource     = dt;
         lstToEmail.DataTextField  = "Name";
         lstToEmail.DataValueField = "N_Email";
         lstToEmail.DataBind();
         if (ddlEmailGroup.SelectedIndex > 0)
         {
             lblUserCountST.Visible   = true;
             lblUserCountST.Text      = "All User " + lstToEmail.Items.Count.ToString();
             lblUserCountST.ForeColor = System.Drawing.Color.Black;
             lblUserCountST.Font.Bold = true;
             lblUserCountEG.Text      = "";
         }
         else
         {
             lblUserCountST.Text = "";
         }
         for (int iloop = 0; iloop < lstToSelectedEmail.Items.Count; iloop++)
         {
             lstToEmail.Items.Remove(lstToSelectedEmail.Items[iloop]);
         }
         for (int iloop = 0; iloop < lstCcSelectedEmail.Items.Count; iloop++)
         {
             lstToEmail.Items.Remove(lstCcSelectedEmail.Items[iloop]);
         }
         ddlAgency1.SelectedIndex     = -1;
         ddlEmailGroup1.SelectedIndex = -1;
         lstCcEmail.Items.Clear();
     }
     catch (Exception ex)
     {
         LogError(ex);
     }
 }