Example #1
0
        /// <summary>
        /// Created By :: Sakthivel.R
        /// Created On :: 2-6-2015
        /// Comments :: Delete function of ScheduleMailDetails details.
        /// </summary>
        #region Delete_ScheduleMailDetailsCreation
        public void ScheduleMailDetailsDelete(int ScheduleMailDetailsid)
        {
            try
            {
                objEmailCampDataContext = new EmailCampDataContext();

                var Delete = (from cde in objEmailCampDataContext.spScheduleMailDetails_AllActions(ScheduleMailDetailsid, null, null, null, null, null, null, null, null, null, "d")
                              select cde).ToList();

                Delete = null;
                objScheduleMailDetails  = null;
                objEmailCampDataContext = null;
            }
            catch (Exception ex)
            {
                ex.ToString();
            }
        }
Example #2
0
        /// <summary>
        /// Created By :: Sakthivel.R
        /// Created On :: 2-6-2015
        /// Comments :: Updation function of ScheduleMailDetails details.
        /// </summary>
        #region Update_ScheduleMailDetailsCreation
        public void ScheduleMailDetailsUpdate(ScheduleMailDetails objScheduleMailDetails)
        {
            try
            {
                objEmailCampDataContext = new EmailCampDataContext();

                var Update = (from cde in objEmailCampDataContext.spScheduleMailDetails_AllActions(objScheduleMailDetails.PK_ScheduleID, objScheduleMailDetails.FK_ContactID, objScheduleMailDetails.Scheduledatetime, objScheduleMailDetails.FK_Scheduleby, objScheduleMailDetails.QueueStatus, objScheduleMailDetails.CreatedBy, objScheduleMailDetails.CreatedOn, objScheduleMailDetails.UpdatedBy, objScheduleMailDetails.UpdatedOn, objScheduleMailDetails.FK_CampaignID, "u")
                              select cde).ToList();

                Update = null;
                objScheduleMailDetails  = null;
                objEmailCampDataContext = null;
            }
            catch (Exception ex)
            {
                ex.ToString();
            }
        }
Example #3
0
        /// <summary>
        /// Created By :: Sakthivel.R
        /// Created On :: 30-3-2015
        /// Comments :: Select all records for ScheduleMailDetails details based on uertype and companyid.
        /// </summary>
        //#region Select_All_Records_CreateScheduleMailDetails
        //public List<ScheduleMailDetails> ScheduleMailDetailsbasedoncampid(int campid)
        //{
        //    objEmailCampDataContext = new EmailCampDataContext();
        //    lstScheduleMailDetails = new List<ScheduleMailDetails>();

        //    var Select = (from cde in objEmailCampDataContext.spScheduleMailDetails_AllActions(null, campid, null, null, null, null, null, null, null, null, "a")
        //                  select cde).ToList();



        //    if (Select.Count > 0)
        //    {
        //        lstScheduleMailDetails = new List<ScheduleMailDetails>();
        //        foreach (var item in Select)
        //        {
        //            objScheduleMailDetails = new ScheduleMailDetails();
        //            objScheduleMailDetails.PK_ScheduleMailDetailsID = item.PK_ScheduleMailDetailsID;

        //            if (item.FK_CampaignID != null)
        //                objScheduleMailDetails.FK_CampaignID = Convert.ToInt32(item.FK_CampaignID);

        //            objScheduleMailDetails.SentOn = item.SentOn;
        //            objScheduleMailDetails.MailFailedContent = item.MailFailedContent;
        //            objScheduleMailDetails.IsMailSent = item.IsMailSent;
        //            objScheduleMailDetails.IsBounced = item.isBounced;
        //            objScheduleMailDetails.Isdelivered = item.Isdelivered;
        //            objScheduleMailDetails.IsHardBounce = item.IsHardBounce;
        //            objScheduleMailDetails.IsRead = item.IsRead;

        //            if (item.ReadCount != null)
        //                objScheduleMailDetails.ReadCount = Convert.ToByte(item.ReadCount.ToString());
        //            if (item.FK_ContactID != null)
        //                objScheduleMailDetails.FK_ContactID = Convert.ToInt32(item.FK_ContactID);

        //            objScheduleMailDetails.CreatedBy = item.CreatedBy;
        //            objScheduleMailDetails.CreatedOn = item.CreatedOn;
        //            objScheduleMailDetails.UpdatedBy = item.UpdatedBy;
        //            objScheduleMailDetails.UpdatedOn = item.UpdatedOn;
        //            lstScheduleMailDetails.Add(objScheduleMailDetails);
        //        }
        //    }
        //    objEmailCampDataContext = null;
        //    objScheduleMailDetails = null;
        //    return lstScheduleMailDetails;

        //}

        //#endregion

        /// <summary>
        /// Created By :: Sakthivel.R
        /// Created On :: 30-5-2015
        /// Comments :: Select all records for ScheduleMailDetails details based on contactid.
        /// </summary>
        #region Select_All_Records_CreateScheduleMailDetails
        //public List<ScheduleMailDetails> ScheduleMailDetailsbasedoncontactid(int contactid)
        //{
        //    objEmailCampDataContext = new EmailCampDataContext();
        //    lstScheduleMailDetails = new List<ScheduleMailDetails>();

        //    var Select = (from cde in objEmailCampDataContext.spScheduleMailDetails_AllActions(null, null, null, null, null, null, null, null, null, null, null, null, null, null, contactid, "c")
        //                  select cde).ToList();



        //    if (Select.Count > 0)
        //    {
        //        lstScheduleMailDetails = new List<ScheduleMailDetails>();
        //        foreach (var item in Select)
        //        {
        //            objScheduleMailDetails = new ScheduleMailDetails();
        //            objScheduleMailDetails.PK_ScheduleMailDetailsID = item.PK_ScheduleMailDetailsID;

        //            if (item.FK_CampaignID != null)
        //                objScheduleMailDetails.FK_CampaignID = Convert.ToInt32(item.FK_CampaignID);

        //            objScheduleMailDetails.SentOn = item.SentOn;
        //            objScheduleMailDetails.MailFailedContent = item.MailFailedContent;
        //            objScheduleMailDetails.IsMailSent = item.IsMailSent;
        //            objScheduleMailDetails.IsBounced = item.isBounced;
        //            objScheduleMailDetails.Isdelivered = item.Isdelivered;
        //            objScheduleMailDetails.IsHardBounce = item.IsHardBounce;
        //            objScheduleMailDetails.IsRead = item.IsRead;

        //            if (item.ReadCount != null)
        //                objScheduleMailDetails.ReadCount = Convert.ToByte(item.ReadCount.ToString());
        //            if (item.FK_ContactID != null)
        //                objScheduleMailDetails.FK_ContactID = Convert.ToInt32(item.FK_ContactID);

        //            objScheduleMailDetails.CreatedBy = item.CreatedBy;
        //            objScheduleMailDetails.CreatedOn = item.CreatedOn;
        //            objScheduleMailDetails.UpdatedBy = item.UpdatedBy;
        //            objScheduleMailDetails.UpdatedOn = item.UpdatedOn;
        //            lstScheduleMailDetails.Add(objScheduleMailDetails);
        //        }
        //    }
        //    objEmailCampDataContext = null;
        //    objScheduleMailDetails = null;
        //    return lstScheduleMailDetails;

        //}

        #endregion

        /// <summary>
        /// Created By :: Sakthivel.R
        /// Created On :: 30-3-2015
        /// Comments :: Select all records for ScheduleMailDetails details based on ScheduleMailDetailsid.
        /// </summary>
        public List <ScheduleMailDetails> ScheduleMailDetailsSelectbasedonid(int ScheduleMailDetailsid)
        {
            objEmailCampDataContext = new EmailCampDataContext();
            lstScheduleMailDetails  = new List <ScheduleMailDetails>();

            var Select = (from cde in objEmailCampDataContext.spScheduleMailDetails_AllActions(ScheduleMailDetailsid, null, null, null, null, null, null, null, null, null, "s")
                          select cde).ToList();

            if (Select.Count > 0)
            {
                lstScheduleMailDetails = new List <ScheduleMailDetails>();
                foreach (var item in Select)
                {
                    objScheduleMailDetails = new ScheduleMailDetails();
                    objScheduleMailDetails.PK_ScheduleID = item.PK_ScheduleID;

                    if (item.FK_CampaignID != null)
                    {
                        objScheduleMailDetails.FK_CampaignID = Convert.ToInt32(item.FK_CampaignID);
                    }
                    objScheduleMailDetails.Scheduledatetime = item.scheduledatetime;
                    if (item.FK_Scheduleby != null)
                    {
                        objScheduleMailDetails.FK_Scheduleby = Convert.ToInt32(item.FK_Scheduleby);
                    }
                    objScheduleMailDetails.QueueStatus = item.QueueStatus;
                    if (item.FK_ContactID != null)
                    {
                        objScheduleMailDetails.FK_ContactID = Convert.ToInt32(item.FK_ContactID);
                    }

                    objScheduleMailDetails.CreatedBy = item.CreatedBy;
                    objScheduleMailDetails.CreatedOn = item.CreatedOn;
                    objScheduleMailDetails.UpdatedBy = item.UpdatedBy;
                    objScheduleMailDetails.UpdatedOn = item.UpdatedOn;

                    lstScheduleMailDetails.Add(objScheduleMailDetails);
                }
            }
            objEmailCampDataContext = null;
            objScheduleMailDetails  = null;
            return(lstScheduleMailDetails);
        }
 public void AccessUpdateScheduleMailDetails(ScheduleMailDetails objScheduleMailDetails1)
 {
     objDL_ScheduleMailDetails.ScheduleMailDetailsUpdate(objScheduleMailDetails1);
 }
 public void AccessInsertScheduleMailDetails(ScheduleMailDetails objScheduleMailDetails1)
 {
     objDL_ScheduleMailDetails.ScheduleMailDetailsInsert(objScheduleMailDetails1);
 }
        protected void btngridsubmit_Click(object sender, EventArgs e)
        {
            Boolean AllowMail = ValidateAllowedMails();

            if (AllowMail == false)
                return;
            string CampTimezone = ddlTimeZone.SelectedValue;
            string dttime = dtScheduledatetime.Value;
            string[] dateString = dttime.Split('/');
            DateTime enter_date = Convert.ToDateTime
            (dateString[1] + "/" + dateString[0] + "/" + dateString[2]);
            DateTime indtime;
            DateTime utcTime = enter_date.ToUniversalTime();            

            if (ddlTimeZone.SelectedIndex > 0)
            {
                indtime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(Convert.ToDateTime(enter_date.ToString()), ddlTimeZone.SelectedValue, TimeZoneInfo.Local.Id);
                utcTime = new DateTime();
                utcTime = indtime.ToUniversalTime();
                objCampaign.Utctime = utcTime;
            }
            //else
            //    objCampaign.Utctime = utcTime;


            //objCampaign.SchduleDateTime = enter_date;
            string body = txta9.Value;

            if (body != "" && gvAddContacts.Rows.Count > 0)
            {
                objBL_Common = new BL_Common();

                objBL_Common.AccessUpdateAllCampaign("EC_Campaign", "Utctime = '" + utcTime + "', CampTimezone = '" + ddlTimeZone.SelectedValue + "', mailcontent = '" + body + "', CampaignStatus = " + 0 + ", SchduleDateTime = '" + enter_date + "' ", "PK_CampaignID =" + Convert.ToInt32(Session["CampgnID"].ToString()) + "");

                for (int i = 0; i < gvAddContacts.Rows.Count; i++)
                {
                    string tomailid = gvAddContacts.Rows[i].Cells[5].Text.ToString();
                    int contactid = 0;
                    Label lblEmpID = (Label)gvAddContacts.Rows[i].Cells[0].FindControl("lblThirdPartyId");

                    if (gvAddContacts.Rows[i].Cells[0].Text.ToString() != null)
                        contactid = Convert.ToInt32(lblEmpID.Text.ToString());
                    CampaignQueueInsert(false, contactid);
                }
                //objBL_Common = new BL_Common();
                //objBL_Common.AccessUpdateAllCampaign("EC_Campaign", "CampaignStatus = " + 0 + "", "PK_CampaignID =" + Convert.ToInt32(Session["CampgnID"].ToString()) + "");
                objBL_ScheduleMailDetails = new BL_ScheduleMailDetails();
                objScheduleMailDetails = new ScheduleMailDetails();
                Label lblEmpID1 = (Label)gvAddContacts.Rows[0].Cells[0].FindControl("lblThirdPartyId");
                objScheduleMailDetails.FK_ContactID = Convert.ToInt32(lblEmpID1.Text.ToString());
                objScheduleMailDetails.Scheduledatetime = utcTime;
                objScheduleMailDetails.FK_Scheduleby = Convert.ToInt32(Session["UserID"].ToString());
                objScheduleMailDetails.QueueStatus = false;
                objScheduleMailDetails.CreatedBy = Convert.ToInt32(Session["UserID"].ToString());
                objScheduleMailDetails.CreatedOn = DateTime.Now;
                objScheduleMailDetails.FK_CampaignID = Convert.ToInt32(Session["CampgnID"].ToString());
                objBL_ScheduleMailDetails.AccessInsertScheduleMailDetails(objScheduleMailDetails);
                objScheduleMailDetails = null;
                objBL_ScheduleMailDetails = null;
                Session["SelectContactID"] = null;
                Session.Remove("SelectContactID");
                Session["CampgnID"] = null;
                Session.Remove("CampgnID");
                //ClientScript.RegisterStartupScript(Page.GetType(), "mykey26", "alert('Your schedule mail content text message or Choose Recipients to send a mail!');", true);
                Response.Redirect("MailScheduleSuccess.aspx", false);
            }
            else
            {
                ClientScript.RegisterStartupScript(Page.GetType(), "mykey25", "alert('Enter your mail content text message or Choose time zone and Recipients to send a mail!');", true);
            }

        }