Beispiel #1
0
        public IHttpActionResult PatchRandom()
        {
            Random random    = new System.Random();
            var    count     = new Business.UnitOfWork.GenericRequest <Messages>(new Business.UnitOfWork.Transaction <Messages> .ExecuteDb()).GetEntryCount();
            int    interator = 0;

            interator = random.Next(1, count + 1);
            return(Ok(new Business.UnitOfWork.GenericRequest <Messages>(new Business.UnitOfWork.Transaction <Messages> .ExecuteDb()).GetById(interator)));
        }
Beispiel #2
0
        // GET: Fortunes/Edit/{Id}
        // For finding data to edit
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var data = new Business.UnitOfWork.GenericRequest <Messages>(new Business.UnitOfWork.Transaction <Messages> .ExecuteDb()).GetById(id);

            SetCurrentPage(id);
            if (data == null)
            {
                return(HttpNotFound());
            }
            return(PartialView(data));
        }
Beispiel #3
0
        // CONSTRUCTOR
        public FortunesController()
        {
            //System.Web.HttpContext.Current.Session["pageId"] = 0;

            var temp     = new Business.UnitOfWork.GenericRequest <Messages>(new Business.UnitOfWork.Transaction <Messages> .ExecuteDb()).GetEntryCount() / Convert.ToDouble(ConfigurationManager.AppSettings["ItemsPerPage"]);
            var intValue = (int)temp;

            if (intValue == temp)
            {
                System.Web.HttpContext.Current.Session["pageTotal"] = intValue;
            }
            else
            {
                System.Web.HttpContext.Current.Session["pageTotal"] = intValue + 1;
            }
            itemsPerPage = Convert.ToInt32(ConfigurationManager.AppSettings["ItemsPerPage"]);
        }
Beispiel #4
0
        public IHttpActionResult Insert([FromBody] UnitOfWork.Data.Database.Properties model)
        {
            // Create new request insert
            var requestData = new Request
            {
                Id            = 0,
                Type          = "Properties",
                DateCreated   = DateTime.UtcNow,
                MemberId      = model.MemberId,
                AccountNumber = model.AccountNumber,
                Success       = true,
                Message       = string.Empty
            };
            var request = new Business.UnitOfWork.GenericRequest <Request>(new Business.UnitOfWork.Transaction <Request> .ExecuteDb()).Insert(requestData);

            model.RequestId = request.Id;

            // Create new insert for change
            var properties = new Business.UnitOfWorkResponse.GenericRequest <Properties>(new Business.UnitOfWorkResponse.Transaction <Properties> .ExecuteRequest()).Insert(model);

            return(Ok(properties));
        }
Beispiel #5
0
        public IHttpActionResult Query([FromBody] object id)
        {
            var data = new Business.UnitOfWork.GenericRequest <Properties>(new Business.UnitOfWork.Transaction <Properties> .ExecuteDb()).ExecuteQuery(id.ToString());

            return(Ok(data));
        }