/// <summary>
        /// use for setting up default value
        /// </summary>
        /// <returns></returns>
        public ActionResult Update(int Id, string TargetID = "QueuedEmaillist")
        {
            QueuedEmail objItem = QueuedEmailManager.GetById(Id, CurrentUser.CompanyID);

            objItem.TargetDisplayID = TargetID;
            return(View(ViewFolder + "Create.cshtml", objItem));
        }
        public ActionResult QueuedEmailEvt(int[] Id, string Action)
        {
            // You have your books IDs on the deleteInputs array
            switch (Action.ToLower())
            {
            case "delete":

                if (Id != null && Id.Length > 0)
                {
                    int         length = Id.Length;
                    QueuedEmail objItem;
                    for (int i = 0; i <= length - 1; i++)
                    {
                        objItem = QueuedEmailManager.GetById(Id[i], CurrentUser.CompanyID);
                        if (objItem != null)
                        {
                            QueuedEmailManager.Delete(objItem);
                        }
                    }
                    return(View(ViewFolder + "list.cshtml", QueuedEmailManager.GetAll(CurrentUser.CompanyID)));
                }
                break;
            }


            return(View("PostFrm"));
        }
        public ActionResult Create(QueuedEmail model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    model.CompanyID = CurrentUser.CompanyID;

                    if (model.Id != 0)
                    {
                        //get default value
                        QueuedEmail objOldQueuedEmail = QueuedEmailManager.GetById(model.Id, CurrentUser.CompanyID);
                        if (objOldQueuedEmail != null)
                        {
                            model.CreatedDate = objOldQueuedEmail.CreatedDate;
                            model.CreatedUser = objOldQueuedEmail.CreatedUser;
                        }

                        QueuedEmailManager.Update(model);
                    }
                    else
                    {
                        // TODO: Add insert logic here
                        //   model.CreatedUser = CurrentUser.UserName;
                        model.CreatedDate = SystemConfig.CurrentDate;
                        QueuedEmailManager.Add(model);
                    }
                    return(View(ViewFolder + "list.cshtml", QueuedEmailManager.GetAll(CurrentUser.CompanyID)));
                }
            }
            catch (Exception ObjEx)
            {
                //LogHelper.AddLog(new IfindLog() { LinkUrl = Request.Url.AbsoluteUri, Exception = ObjEx.Message, Message = ObjEx.StackTrace });
                return(View(model));
            }
            return(View(model));
        }
        public ActionResult Get(int Id, string action)
        {
            QueuedEmail objItem = QueuedEmailManager.GetById(Id, CurrentUser.CompanyID);

            return(Content(JsonConvert.SerializeObject(objItem), "application/json"));
        }
        public ActionResult Get(int Id)
        {
            QueuedEmail objItem = QueuedEmailManager.GetById(Id, CurrentUser.CompanyID);

            return(View(objItem));
        }