Ejemplo n.º 1
0
        public object EditPoll(int PollID, string PollTitle, int PollType, int CreatedBy, string EndTime, bool IsActive)
        {
            var     DC      = new DataClassesDataContext();
            tblPoll PollObj = (from ob in DC.tblPolls
                               where ob.PollID == PollID
                               select ob).Single();

            PollObj.PollTitle = PollTitle;
            PollObj.PollType  = PollType;
            PollObj.CreatedBy = CreatedBy;
            PollObj.EndTime   = Convert.ToDateTime(EndTime);
            PollObj.IsActive  = IsActive;
            DC.SubmitChanges();

            return(true);
        }
Ejemplo n.º 2
0
        /* FacilityBookings */

        /* Polls */

        public object AddPoll(string PollTitle, int PollType, int CreatedBy, string EndTime)
        {
            var     DC      = new DataClassesDataContext();
            tblPoll PollObj = new tblPoll();

            PollObj.PollTitle = PollTitle;
            PollObj.PollType  = PollType;
            PollObj.CreatedBy = CreatedBy;
            PollObj.CreatedOn = DateTime.Now;
            PollObj.EndTime   = DateTime.Now.AddDays(1).Date;
            PollObj.IsActive  = true;

            DC.tblPolls.InsertOnSubmit(PollObj);

            int PollID = (from ob in DC.tblPolls
                          orderby ob.PollID descending
                          select ob.PollID).FirstOrDefault();

            DC.SubmitChanges();

            return(PollID);
        }