Exemple #1
0
        public ActionResult T_COM_Master_Employee_PositionEvt(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;
                    T_COM_Master_Employee_Position objItem;
                    for (int i = 0; i <= length - 1; i++)
                    {
                        objItem = T_COM_Master_Employee_PositionManager.GetById(ID[i]);
                        if (objItem != null)
                        {
                            T_COM_Master_Employee_PositionManager.Delete(objItem);
                        }
                    }
                    return(View(ViewFolder + "list.cshtml", T_COM_Master_Employee_PositionManager.GetAll()));
                }
                break;
            }


            return(View("PostFrm"));
        }
Exemple #2
0
 public ActionResult Create(T_COM_Master_Employee_Position model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             //  model.CreatedUser = CurrentUser.UserName;
             if (model.ID != 0)
             {
                 //get default value
                 //	T_COM_Master_Employee_Position b = T_COM_Master_Employee_PositionManager.GetById(model.ID);
                 T_COM_Master_Employee_PositionManager.Update(model);
             }
             else
             {
                 // TODO: Add insert logic here
                 //	 model.CreatedDate = SystemConfig.CurrentDate;
                 T_COM_Master_Employee_PositionManager.Add(model);
             }
             return(View(ViewFolder + "list.cshtml", T_COM_Master_Employee_PositionManager.GetAll()));
         }
     }
     catch
     {
         return(View(model));
     }
     return(View(model));
 }
Exemple #3
0
        public ContentResult Search(SearchFilter SearchKey)
        {
            SearchKey.OrderBy = string.IsNullOrEmpty(SearchKey.OrderBy) ? "ID" : SearchKey.OrderBy;
            T_COM_Master_Employee_PositionCollection collection = T_COM_Master_Employee_PositionManager.Search(SearchKey);

            return(Content(JsonConvert.SerializeObject(collection), "application/json"));
        }
Exemple #4
0
        public ContentResult Save(string objdata, string value)
        {
            JsonObject js = new JsonObject();

            js.StatusCode = 200;
            js.Message    = "Upload Success";
            try
            {
                T_COM_Master_Employee_Position obj = JsonConvert.DeserializeObject <T_COM_Master_Employee_Position>(objdata);
                obj = T_COM_Master_Employee_PositionManager.Update(obj);
                if (obj.ID == 0)
                {
                    js.StatusCode = 400;
                    js.Message    = "Has Errors. Please contact Admin for more information";
                }
                else
                {
                    js.Data = obj;
                }
            }
            catch (Exception objEx)
            {
                js.StatusCode = 400;
                js.Message    = objEx.Message;
            }

            return(Content(JsonConvert.SerializeObject(js), "application/json"));
        }
Exemple #5
0
        /// <summary>
        /// use for setting up default value
        /// </summary>
        /// <returns></returns>
        public ActionResult Update(int ID, string TargetID = "T_COM_Master_Employee_Positionlist")
        {
            T_COM_Master_Employee_Position objItem = T_COM_Master_Employee_PositionManager.GetById(ID);

            objItem.TargetDisplayID = TargetID;
            return(View(ViewFolder + "Create.cshtml", objItem));
        }
Exemple #6
0
        /// <summary>
        /// use for scrolling page
        /// </summary>
        /// <returns></returns>
        public ContentResult GetPg(int page, int pagesize)
        {
            string       condition = "";
            SearchFilter SearchKey = SearchFilter.SearchPG(1, page, pagesize, "ID", "ID", "Desc", condition);
            T_COM_Master_Employee_PositionCollection objItem = T_COM_Master_Employee_PositionManager.Search(SearchKey);

            return(Content(JsonConvert.SerializeObject(objItem), "application/json"));
        }
Exemple #7
0
        public ActionResult EmpPosition(int EmployeeCode)
        {
            SearchFilter SearchKey = BindSearch("");

            SearchKey.Condition      = "  (EmployeeCode=" + EmployeeCode + ") ";
            SearchKey.OrderBy        = "EffectiveFrom";
            SearchKey.OrderDirection = "Desc";
            T_COM_Master_Employee_PositionCollection collection = T_COM_Master_Employee_PositionManager.Search(SearchKey);

            return(View(ViewFolder + "EmpPosition.cshtml", collection));
        }
Exemple #8
0
        public JsonResult GetGata([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel)
        {
            SearchFilter SearchKey = SearchFilter.SearchData(1, requestModel, "ID", "ID");
            T_COM_Master_Employee_PositionCollection collection = T_COM_Master_Employee_PositionManager.Search(SearchKey);
            int TotalRecord = 0;

            if (collection.Count > 0)
            {
                TotalRecord = collection[0].TotalRecord;
            }
            return(Json(new DataTablesResponse(requestModel.Draw, collection, TotalRecord, TotalRecord), JsonRequestBehavior.AllowGet));
        }
Exemple #9
0
        public JsonResult GetSearchData([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel, string searchprm)
        {
            SearchFilter SearchKey = BindSearch(searchprm);

            SearchKey = SearchFilter.SearchData(SearchKey, requestModel);
            T_COM_Master_Employee_PositionCollection collection = T_COM_Master_Employee_PositionManager.Search(SearchKey);
            int TotalRecord = 0;

            if (collection.Count > 0)
            {
                TotalRecord = collection[0].TotalRecord;
            }
            //{{Class}Collection data = {{Class}}Manager.GetAll(CurrentUser.CompanyID);
            return(Json(new DataTablesResponse(requestModel.Draw, collection, TotalRecord, TotalRecord), JsonRequestBehavior.AllowGet));
        }
Exemple #10
0
        /// <summary>
        /// ExportExcel File
        /// </summary>
        /// <returns></returns>
        public string ExportExcel()
        {
            T_COM_Master_Employee_PositionCollection collection = T_COM_Master_Employee_PositionManager.GetAll();
            DataTable dt       = collection.ToDataTable <T_COM_Master_Employee_Position>();
            string    fileName = "T_COM_Master_Employee_Position_" + SystemConfig.CurrentDate.ToString("MM-dd-yyyy");

            string[] RemoveColumn = { "CompanyID", "TargetDisplayID", "ReturnDisplay", "TotalRecord", "CreatedUser", "CreatedDate" };
            for (int i = 0; i < RemoveColumn.Length; i++)
            {
                if (dt.Columns.Contains(RemoveColumn[i]))
                {
                    dt.Columns.Remove(RemoveColumn[i]);
                }
            }
            FileInputHelper.ExportExcel(dt, fileName, "T_COM_Master_Employee_Position List", false);
            return(fileName);
        }
Exemple #11
0
 public ActionResult Update(T_COM_Master_Employee_Position model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             // TODO: Add insert logic here
             T_COM_Master_Employee_PositionManager.Update(model);
             //return RedirectToAction("Index");
         }
         return(View(model));
     }
     catch
     {
         return(View(model));
     }
 }
Exemple #12
0
        public ContentResult SaveExcel(string item)
        {
            //string b = Request["item"];
            IEnumerable <T_COM_Master_Employee_Position> objItemList = JsonConvert.DeserializeObject <IEnumerable <T_COM_Master_Employee_Position> >(item);

            JsonObject obj = new JsonObject();

            obj.StatusCode = 200;
            obj.Message    = "The process is sucessed";
            foreach (T_COM_Master_Employee_Position objitem in objItemList)
            {
                //default value
                //objitem.CreatedUser = CurrentUser.UserName;
                objitem.CreatedDate = SystemConfig.CurrentDate;

                T_COM_Master_Employee_PositionManager.Add(objitem);
            }

            return(Content(JsonConvert.SerializeObject(obj), "application/json"));
        }
Exemple #13
0
 // GET api/<controller>
 /// <summary>
 /// Gets this instance.
 /// </summary>
 /// <returns></returns>
 public T_COM_Master_Employee_PositionCollection Get()
 {
     return(T_COM_Master_Employee_PositionManager.GetAllItem());
 }
Exemple #14
0
 // GET api/<controller>/5
 /// <summary>
 /// Gets the specified COM group identifier.
 /// </summary>
 /// <param name="T_COM_Master_Employee_PositionId">The COM group identifier.</param>
 /// <returns></returns>
 public T_COM_Master_Employee_Position Get(int ID)
 {
     return(T_COM_Master_Employee_PositionManager.GetItemByID(ID));
 }
Exemple #15
0
 // POST api/<controller>
 /// <summary>
 /// Posts the specified value.
 /// </summary>
 /// <param name="value">The value.</param>
 /// <returns></returns>
 public T_COM_Master_Employee_Position Post([FromBody] T_COM_Master_Employee_Position value)
 {
     return(T_COM_Master_Employee_PositionManager.AddItem(value));
 }
Exemple #16
0
 // PUT api/<controller>/5
 /// <summary>
 /// Puts the specified identifier.
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <param name="value">The value.</param>
 /// <returns></returns>
 /// <exception cref="HttpResponseException"></exception>
 public T_COM_Master_Employee_Position Put(string id, [FromBody] T_COM_Master_Employee_Position value)
 {
     return(T_COM_Master_Employee_PositionManager.UpdateItem(value));
 }
Exemple #17
0
 // GET api/<controller>
 /// <summary>
 /// Gets this instance.
 /// </summary>
 /// <returns></returns>
 public T_COM_Master_Employee_PositionCollection Post(string method, [FromBody] SearchFilter value)
 {
     return(T_COM_Master_Employee_PositionManager.Search(value));
 }
Exemple #18
0
 // DELETE api/<controller>/5
 /// <summary>
 /// Deletes the specified identifier.
 /// </summary>
 /// <param name="id">The identifier.</param>
 public void Delete(int id)
 {
     T_COM_Master_Employee_PositionManager.DeleteItem(id);
 }
Exemple #19
0
        public ActionResult Get(int ID)
        {
            T_COM_Master_Employee_Position objItem = T_COM_Master_Employee_PositionManager.GetById(ID);

            return(View(objItem));
        }
Exemple #20
0
 public T_COM_Master_Employee_PositionCollection GetbyUser(string usr)
 {
     return(T_COM_Master_Employee_PositionManager.GetbyUser(usr));
 }
Exemple #21
0
        public ActionResult Get(int ID, string action)
        {
            T_COM_Master_Employee_Position objItem = T_COM_Master_Employee_PositionManager.GetById(ID);

            return(Content(JsonConvert.SerializeObject(objItem), "application/json"));
        }