public ActionResult BulkUpdate([Bind(Include = "Id,ConcurrencyKey,T_Name,T_Description")] T_RecurringScheduleDetailstype t_recurringscheduledetailstype, FormCollection collection, string UrlReferrer)
        {
            var bulkIds   = collection["BulkUpdate"].Split(',').ToList();
            var chkUpdate = collection["chkUpdate"];

            if (!string.IsNullOrEmpty(chkUpdate))
            {
                foreach (var id in bulkIds.Where(p => p != string.Empty))
                {
                    long objId = long.Parse(id);
                    T_RecurringScheduleDetailstype target = db.T_RecurringScheduleDetailstypes.Find(objId);
                    EntityCopy.CopyValuesForSameObjectType(t_recurringscheduledetailstype, target, chkUpdate);
                    db.Entry(target).State = EntityState.Modified;
                    try
                    {
                        db.SaveChanges();
                    }
                    catch { }
                }
            }
            if (!string.IsNullOrEmpty(UrlReferrer))
            {
                return(Redirect(UrlReferrer));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }
 public ActionResult DeleteConfirmed(T_RecurringScheduleDetailstype t_recurringscheduledetailstype, string UrlReferrer)
 {
     if (!User.CanDelete("T_RecurringScheduleDetailstype"))
     {
         return(RedirectToAction("Index", "Error"));
     }
     if (CheckBeforeDelete(t_recurringscheduledetailstype))
     {
         //Delete Document
         db.Entry(t_recurringscheduledetailstype).State = EntityState.Deleted;
         db.T_RecurringScheduleDetailstypes.Remove(t_recurringscheduledetailstype);
         db.SaveChanges();
         if (!string.IsNullOrEmpty(UrlReferrer))
         {
             return(Redirect(UrlReferrer));
         }
         if (ViewData["T_RecurringScheduleDetailstypeParentUrl"] != null)
         {
             string parentUrl = ViewData["T_RecurringScheduleDetailstypeParentUrl"].ToString();
             ViewData["T_RecurringScheduleDetailstypeParentUrl"] = null;
             return(Redirect(parentUrl));
         }
         else
         {
             return(RedirectToAction("Index"));
         }
     }
     return(View(t_recurringscheduledetailstype));
 }
 public ActionResult EditWizard([Bind(Include = "Id,ConcurrencyKey,T_Name,T_Description")] T_RecurringScheduleDetailstype t_recurringscheduledetailstype, string UrlReferrer)
 {
     CheckBeforeSave(t_recurringscheduledetailstype);
     if (ModelState.IsValid)
     {
         db.Entry(t_recurringscheduledetailstype).State = EntityState.Modified;
         db.SaveChanges();
         if (!string.IsNullOrEmpty(UrlReferrer))
         {
             var uri   = new Uri(UrlReferrer);
             var query = HttpUtility.ParseQueryString(uri.Query);
             if (Convert.ToBoolean(query.Get("IsFilter")) == true)
             {
                 return(RedirectToAction("Index"));
             }
             else
             {
                 return(Redirect(UrlReferrer));
             }
         }
         else
         {
             return(RedirectToAction("Index"));
         }
     }
     LoadViewDataAfterOnEdit(t_recurringscheduledetailstype);
     return(View(t_recurringscheduledetailstype));
 }
        public ActionResult EditQuick([Bind(Include = "Id,ConcurrencyKey,T_Name,T_Description")] T_RecurringScheduleDetailstype t_recurringscheduledetailstype, string UrlReferrer, bool?IsAddPop, string AssociatedEntity)
        {
            CheckBeforeSave(t_recurringscheduledetailstype);
            if (ModelState.IsValid)
            {
                string command = Request.Form["hdncommand"];
                db.Entry(t_recurringscheduledetailstype).State = EntityState.Modified;
                db.SaveChanges();

                return(Json(UrlReferrer, "application/json", System.Text.Encoding.UTF8, JsonRequestBehavior.AllowGet));
            }
            else
            {
                var errors = "";
                foreach (ModelState modelState in ViewData.ModelState.Values)
                {
                    foreach (ModelError error in modelState.Errors)
                    {
                        errors += error.ErrorMessage + ".  ";
                    }
                }
                return(Json(errors, "application/json", System.Text.Encoding.UTF8, JsonRequestBehavior.AllowGet));
            }

            LoadViewDataAfterOnEdit(t_recurringscheduledetailstype);
            return(View(t_recurringscheduledetailstype));
        }
        // GET: /T_RecurringScheduleDetailstype/EditWizard/5
        public ActionResult EditWizard(int?id, string UrlReferrer)
        {
            if (!User.CanEdit("T_RecurringScheduleDetailstype"))
            {
                return(RedirectToAction("Index", "Error"));
            }
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            T_RecurringScheduleDetailstype t_recurringscheduledetailstype = db.T_RecurringScheduleDetailstypes.Find(id);

            if (t_recurringscheduledetailstype == null)
            {
                return(HttpNotFound());
            }

            if (UrlReferrer != null)
            {
                ViewData["T_RecurringScheduleDetailstypeParentUrl"] = UrlReferrer;
            }
            if (ViewData["T_RecurringScheduleDetailstypeParentUrl"] == null && Request.UrlReferrer != null && !Request.UrlReferrer.AbsolutePath.EndsWith("/T_RecurringScheduleDetailstype"))
            {
                ViewData["T_RecurringScheduleDetailstypeParentUrl"] = Request.UrlReferrer;
            }
            LoadViewDataBeforeOnEdit(t_recurringscheduledetailstype);
            ViewBag.T_RecurringScheduleDetailstypeIsHiddenRule = checkHidden("T_RecurringScheduleDetailstype", "OnEdit");
            return(View(t_recurringscheduledetailstype));
        }
        // GET: /T_RecurringScheduleDetailstype/Edit/5
        public ActionResult EditQuick(int?id, string UrlReferrer, string HostingEntityName, string AssociatedType)
        {
            if (!User.CanEdit("T_RecurringScheduleDetailstype"))
            {
                return(RedirectToAction("Index", "Error"));
            }
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            T_RecurringScheduleDetailstype t_recurringscheduledetailstype = db.T_RecurringScheduleDetailstypes.Find(id);

            if (t_recurringscheduledetailstype == null)
            {
                return(HttpNotFound());
            }
            if (UrlReferrer != null)
            {
                ViewData["T_RecurringScheduleDetailstypeParentUrl"] = UrlReferrer;
            }
            if (ViewData["T_RecurringScheduleDetailstypeParentUrl"] == null && Request.UrlReferrer != null && !Request.UrlReferrer.AbsolutePath.EndsWith("/T_RecurringScheduleDetailstype") && !Request.UrlReferrer.AbsolutePath.EndsWith("/T_RecurringScheduleDetailstype/Edit/" + t_recurringscheduledetailstype.Id + "") && !Request.UrlReferrer.AbsolutePath.EndsWith("/T_RecurringScheduleDetailstype/Create"))
            {
                ViewData["T_RecurringScheduleDetailstypeParentUrl"] = Request.UrlReferrer;
            }
            ViewData["HostingEntityName"] = HostingEntityName;
            ViewData["AssociatedType"]    = AssociatedType;
            LoadViewDataBeforeOnEdit(t_recurringscheduledetailstype);
            ViewBag.T_RecurringScheduleDetailstypeIsHiddenRule = checkHidden("T_RecurringScheduleDetailstype", "OnEdit");
            return(View(t_recurringscheduledetailstype));
        }
        public ActionResult Create([Bind(Include = "Id,ConcurrencyKey,T_Name,T_Description")] T_RecurringScheduleDetailstype t_recurringscheduledetailstype, string UrlReferrer, bool?IsDDAdd)
        {
            CheckBeforeSave(t_recurringscheduledetailstype);
            if (ModelState.IsValid)
            {
                string command = Request.Form["hdncommand"];
                db.T_RecurringScheduleDetailstypes.Add(t_recurringscheduledetailstype);
                db.SaveChanges();
                if (command == "Create & Continue")
                {
                    return(RedirectToAction("Edit", new { Id = t_recurringscheduledetailstype.Id, UrlReferrer = UrlReferrer }));
                }
                if (!string.IsNullOrEmpty(UrlReferrer))
                {
                    return(Redirect(UrlReferrer));
                }
                else
                {
                    return(RedirectToAction("Index"));
                }
            }

            if (IsDDAdd != null)
            {
                ViewBag.IsDDAdd = Convert.ToBoolean(IsDDAdd);
            }
            LoadViewDataAfterOnCreate(t_recurringscheduledetailstype);
            return(View(t_recurringscheduledetailstype));
        }
 public ActionResult CreateQuick([Bind(Include = "Id,ConcurrencyKey,T_Name,T_Description")] T_RecurringScheduleDetailstype t_recurringscheduledetailstype, string UrlReferrer, bool?IsAddPop, string AssociatedEntity)
 {
     CheckBeforeSave(t_recurringscheduledetailstype);
     if (ModelState.IsValid)
     {
         db.T_RecurringScheduleDetailstypes.Add(t_recurringscheduledetailstype);
         db.SaveChanges();
         return(Json("FROMPOPUP", "application/json", System.Text.Encoding.UTF8, JsonRequestBehavior.AllowGet));
     }
     else
     {
         var errors = "";
         foreach (ModelState modelState in ViewData.ModelState.Values)
         {
             foreach (ModelError error in modelState.Errors)
             {
                 errors += error.ErrorMessage + ".  ";
             }
         }
         return(Json(errors, "application/json", System.Text.Encoding.UTF8, JsonRequestBehavior.AllowGet));
     }
     LoadViewDataAfterOnCreate(t_recurringscheduledetailstype);
     if (!string.IsNullOrEmpty(AssociatedEntity))
     {
         LoadViewDataForCount(t_recurringscheduledetailstype, AssociatedEntity);
     }
     return(View(t_recurringscheduledetailstype));
 }
 public ActionResult DeleteBulk(long[] ids, string UrlReferrer)
 {
     foreach (var id in ids.Where(p => p > 0))
     {
         T_RecurringScheduleDetailstype t_recurringscheduledetailstype = db.T_RecurringScheduleDetailstypes.Find(id);
         db.Entry(t_recurringscheduledetailstype).State = EntityState.Deleted;
         db.T_RecurringScheduleDetailstypes.Remove(t_recurringscheduledetailstype);
         try
         {
             db.SaveChanges();
         }
         catch { }
     }
     return(Json("Success", "application/json", System.Text.Encoding.UTF8, JsonRequestBehavior.AllowGet));
 }
        public ActionResult CreateWizard([Bind(Include = "Id,ConcurrencyKey,T_Name,T_Description")] T_RecurringScheduleDetailstype t_recurringscheduledetailstype, string UrlReferrer)
        {
            CheckBeforeSave(t_recurringscheduledetailstype);
            if (ModelState.IsValid)
            {
                db.T_RecurringScheduleDetailstypes.Add(t_recurringscheduledetailstype);
                db.SaveChanges();

                if (!string.IsNullOrEmpty(UrlReferrer))
                {
                    return(Redirect(UrlReferrer));
                }
                else
                {
                    return(RedirectToAction("Index"));
                }
            }

            LoadViewDataAfterOnCreate(t_recurringscheduledetailstype);
            return(View(t_recurringscheduledetailstype));
        }
        // GET: /T_RecurringScheduleDetailstype/Delete/5
        public ActionResult Delete(int id)
        {
            if (!User.CanDelete("T_RecurringScheduleDetailstype"))
            {
                return(RedirectToAction("Index", "Error"));
            }
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            T_RecurringScheduleDetailstype t_recurringscheduledetailstype = db.T_RecurringScheduleDetailstypes.Find(id);

            if (t_recurringscheduledetailstype == null)
            {
                throw(new Exception("Deleted"));
            }
            if (ViewData["T_RecurringScheduleDetailstypeParentUrl"] == null && Request.UrlReferrer != null && !Request.UrlReferrer.AbsolutePath.EndsWith("/T_RecurringScheduleDetailstype"))
            {
                ViewData["T_RecurringScheduleDetailstypeParentUrl"] = Request.UrlReferrer;
            }
            return(View(t_recurringscheduledetailstype));
        }
        // GET: /T_RecurringScheduleDetailstype/Details/5
        public ActionResult Details(int?id, string HostingEntityName, string AssociatedType)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            T_RecurringScheduleDetailstype t_recurringscheduledetailstype = db.T_RecurringScheduleDetailstypes.Find(id);

            if (t_recurringscheduledetailstype == null)
            {
                return(HttpNotFound());
            }
            GetTemplatesForDetails();
            ViewData["AssociatedType"]    = AssociatedType;
            ViewData["HostingEntityName"] = HostingEntityName;
            LoadViewDataBeforeOnEdit(t_recurringscheduledetailstype);
            if (!string.IsNullOrEmpty(AssociatedType))
            {
                LoadViewDataForCount(t_recurringscheduledetailstype, AssociatedType);
            }
            ViewBag.T_RecurringScheduleDetailstypeIsHiddenRule = checkHidden("T_RecurringScheduleDetailstype", "OnDetails");
            return(View(ViewBag.TemplatesName, t_recurringscheduledetailstype));
        }