示例#1
0
        public ActionResult DeleteAnnualEvent(int aEventID)
        {
            AnnualEvent deletedAnnualEvent = annualEventRepo.DeleteAnnualEvent(aEventID);

            if (deletedAnnualEvent != null)
            {
                TempData["message"] = "Delete success";
            }
            return(RedirectToAction("AnnualEventManaging"));
        }
        public AnnualEvent DeleteAnnualEvent(int aEventID)
        {
            AnnualEvent dbEntry = context.AnnualEvents.Find(aEventID);

            if (dbEntry != null)
            {
                context.AnnualEvents.Remove(dbEntry);
                context.SaveChanges();
            }
            return(dbEntry);
        }
示例#3
0
 public ActionResult AddAnnualEvent(AnnualEvent annualEvent)
 {
     if (ModelState.IsValid)
     {
         annualEventRepo.SaveAnnualEvent(annualEvent);
         return(RedirectToAction("AnnualEventManaging"));
     }
     else
     {
         // there is something wrong with the data values
         return(View(annualEvent));
     }
 }
示例#4
0
        protected void btnSaveEvent_Click(object sender, EventArgs e)
        {
            AnnualEvent a = new AnnualEvent();

            a.EventName = txtEventNameSR.Text;
            a.Eventdate = txtEventDate.Text;
            int userId = Convert.ToInt16(Session[JG_Prospect.Common.SessionKey.Key.UserId.ToString()]);

            a.EventAddedBy = userId;

            new_customerBLL.Instance.AddAnnualEvent(a);
            BindCalendar();
            ScriptManager.RegisterStartupScript(this.Page, GetType(), "al", "alert('Event Added Successfully');", true);
        }
        protected void btnsave_Click(object sender, EventArgs e)
        {
            AnnualEvent a = new AnnualEvent();

            a.EventName = txtEventName.Text;
            a.Eventdate = txtHolidayDate.Text;
            a.id        = Convert.ToInt32(lbtCustomerID.Text);
            new_customerBLL.Instance.UpdateAnnualEvent(a);
            BindCalendar();

            int userId = Convert.ToInt16(Session[JG_Prospect.Common.SessionKey.Key.UserId.ToString()]);

            ScriptManager.RegisterStartupScript(this.Page, GetType(), "al", "alert('Event Updated Successfully');", true);
            RadWindow2.VisibleOnPageLoad = false;

            /*
             *          try
             *          {
             *              //Adding Record to Database through Stored Procedure
             *              con = new SqlConnection(strcon);
             *              cmd = new SqlCommand("UpdateAnnualEvent", con);
             *              cmd.CommandType = CommandType.StoredProcedure;
             *
             *
             *              cmd.Parameters.AddWithValue("@Eventname", txtEventName.Text);
             *              cmd.Parameters.AddWithValue("@EventDate", txtHolidayDate.Text);
             *              cmd.Parameters.AddWithValue("@ID", lbtCustomerID.Text);
             *
             *              con.Open();
             *              cmd.ExecuteNonQuery();
             *              con.Close();
             *
             *              BindCalendar();
             *              //Clear All Data after submitting.....
             *              ScriptManager.RegisterStartupScript(this.Page, GetType(), "al", "alert('Event Updated Successfully');", true);
             *              RadWindow2.VisibleOnPageLoad = false;
             *          }
             *
             *          catch
             *          {
             *              //return 0;
             *              //LogManager.Instance.WriteToFlatFile(ex);
             *          }
             */
        }
 public void SaveAnnualEvent(AnnualEvent aev)
 {
     if (aev.aEventID == 0)
     {
         context.AnnualEvents.Add(aev);
     }
     else
     {
         AnnualEvent dbEntry = context.AnnualEvents.Find(aev.aEventID);
         if (dbEntry != null)
         {
             dbEntry.aEventTitle    = aev.aEventTitle;
             dbEntry.aEventDetail   = aev.aEventDetail;
             dbEntry.aEventDate     = aev.aEventDate;
             dbEntry.aEventTime     = aev.aEventTime;
             dbEntry.aEventLocation = aev.aEventLocation;
         }
     }
     context.SaveChanges();
 }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            AnnualEvent a = new AnnualEvent();

            a.EventName = txtEventName.Text;
            a.Eventdate = txtHolidayDate.Text;
            //For checking duplicate event....
            DataSet ds = new DataSet();

            ds = new_customerBLL.Instance.CheckDuplicateAnnualEvent(a);
            if (ds.Tables[0].Rows.Count == 0)
            {
                int userId = Convert.ToInt16(Session[JG_Prospect.Common.SessionKey.Key.UserId.ToString()]);
                a.EventAddedBy = userId;
                new_customerBLL.Instance.AddAnnualEvent(a);
                ScriptManager.RegisterStartupScript(this.Page, GetType(), "al", "alert('Event Added Successfully');", true);
            }
            else
            {
                //If duplicate Event......
                ScriptManager.RegisterStartupScript(this.Page, GetType(), "al", "alert('Event Name for paricular date is already exist');", true);
            }
        }
示例#8
0
        public ActionResult AnnualEventDetail(int aEventID)
        {
            AnnualEvent annualEvent = repository7.AnnualEvents.FirstOrDefault(p => p.aEventID == aEventID);

            return(View(annualEvent));
        }
示例#9
0
 public void DeleteAnnualEvent(AnnualEvent Event) //string CustomerName, string CustomerStreet, string Statename, string Cityname, string ZipCode, string BillAddress, DateTime EstDate, string EstTime, string cellphone, string HousePhone, string altphone, string Email, string CallTakenBy, string Service, string besttimetocontact, string primarycontact, string leadtype, string contactprefernece, string AddedBy, int customerid, string Map1, string Map2
 {
     new_customerDAL.Instance.DeleteAnnualEvent(Event);
 }
示例#10
0
 public DataSet CheckDuplicateAnnualEvent(AnnualEvent Event)
 {
     return(new_customerDAL.Instance.CheckDuplicateAnnualEvent(Event));
 }
示例#11
0
 public void AddAnnualEvent(AnnualEvent Event)
 {
     new_customerDAL.Instance.AddAnnualEvent(Event);
 }
示例#12
0
        public ViewResult EditAnnualEvent(int aEventID)
        {
            AnnualEvent annualEvent = annualEventRepo.AnnualEvents.FirstOrDefault(p => p.aEventID == aEventID);

            return(View(annualEvent));
        }