/// <summary>
        /// use for setting up default value
        /// </summary>
        /// <returns></returns>
        public ActionResult Update(int Id, string TargetID = "T_LMS_Trans_LeaveStorylist")
        {
            T_LMS_Trans_LeaveStory objItem = T_LMS_Trans_LeaveStoryManager.GetById(Id);

            objItem.TargetDisplayID = TargetID;
            return(View(ViewFolder + "Create.cshtml", objItem));
        }
        public ContentResult Save(string objdata, string value)
        {
            JsonObject js = new JsonObject();

            js.StatusCode = 200;
            js.Message    = "Upload Success";
            try
            {
                T_LMS_Trans_LeaveStory obj = JsonConvert.DeserializeObject <T_LMS_Trans_LeaveStory>(objdata);
                obj = T_LMS_Trans_LeaveStoryManager.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"));
        }
        public ActionResult T_LMS_Trans_LeaveStoryEvt(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_LMS_Trans_LeaveStory objItem;
                    for (int i = 0; i <= length - 1; i++)
                    {
                        objItem = T_LMS_Trans_LeaveStoryManager.GetById(Id[i]);
                        if (objItem != null)
                        {
                            T_LMS_Trans_LeaveStoryManager.Delete(objItem);
                        }
                    }
                    return(View(ViewFolder + "list.cshtml", T_LMS_Trans_LeaveStoryManager.GetAll()));
                }
                break;
            }


            return(View("PostFrm"));
        }
 public ActionResult Create(T_LMS_Trans_LeaveStory model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             //  model.CreatedUser = CurrentUser.UserName;
             if (model.Id != 0)
             {
                 //get default value
                 //	T_LMS_Trans_LeaveStory b = T_LMS_Trans_LeaveStoryManager.GetById(model.Id);
                 T_LMS_Trans_LeaveStoryManager.Update(model);
             }
             else
             {
                 // TODO: Add insert logic here
                 //	 model.CreatedDate = SystemConfig.CurrentDate;
                 T_LMS_Trans_LeaveStoryManager.Add(model);
             }
             return(View(ViewFolder + "list.cshtml", T_LMS_Trans_LeaveStoryManager.GetAll()));
         }
     }
     catch
     {
         return(View(model));
     }
     return(View(model));
 }
        public ContentResult Lms(string EmployeeNo, string WD)
        {
            LeaveWFCollection collection = T_LMS_Trans_LeaveStoryManager.GetEmployeeLeaveReason(10001, EmployeeNo, WD);

            return(Content(JsonConvert.SerializeObject(collection), "application/json"));
            //return View(ViewFolder + "EmpTms.cshtml");
        }
        public string ExportExMonthTMS(int UserID, string MonthID, string FilterBy, string FilterValue)
        {
            External_TimesCollection collection = T_LMS_Trans_LeaveStoryManager.GetExMonthlyReport(UserID, MonthID, FilterBy, FilterValue);
            DataSet   ds       = new DataSet();
            DataTable dt       = collection.ToDataTable <External_Times>();
            string    fileName = UserID + "_Monthly_TimeSheet_" + SystemConfig.CurrentDate.ToString("MM-dd-yyyy");

            string[] sheetName    = { "Daily_TMS" };
            string[] RemoveColumn = { "CompanyID", "TargetDisplayID", "ReturnDisplay", "TotalRecord", "CreatedUser", "CreatedDate", "ErrorMesssage" };
            for (int i = 0; i < RemoveColumn.Length; i++)
            {
                if (dt.Columns.Contains(RemoveColumn[i]))
                {
                    dt.Columns.Remove(RemoveColumn[i]);
                }
            }
            ds.Tables.Add(dt);
            //set Column Date Format
            //int[] DateColumn = { 5, 6 };
            //ExcelPara mypara = new ExcelPara()
            //{
            //    ds = ds,
            //    sheetName = sheetName,
            //    fileName = fileName,
            //    DateColumns = DateColumn,
            //    DateFormat = "h:mm:ss tt"
            //};
            //FileInputHelper.ExportMultiSheetExcelExtend(mypara);
            FileInputHelper.ExportExcel(dt, fileName, "Monthly_TimeSheet", false);
            return(fileName);
        }
        public ContentResult Search(SearchFilter SearchKey)
        {
            SearchKey.OrderBy = string.IsNullOrEmpty(SearchKey.OrderBy) ? "Id" : SearchKey.OrderBy;
            T_LMS_Trans_LeaveStoryCollection collection = T_LMS_Trans_LeaveStoryManager.Search(SearchKey);

            return(Content(JsonConvert.SerializeObject(collection), "application/json"));
        }
        /// <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_LMS_Trans_LeaveStoryCollection objItem = T_LMS_Trans_LeaveStoryManager.Search(SearchKey);

            return(Content(JsonConvert.SerializeObject(objItem), "application/json"));
        }
Ejemplo n.º 9
0
        public LeaveWFCollection Get(int EntityID, int EmployeeCode, DateTime WorkDate)
        {
            LeaveWFPara Filter = new LeaveWFPara()
            {
                EntityID     = EntityID,
                EmployeeCode = EmployeeCode,
                WorkDate     = WorkDate
            };

            return(T_LMS_Trans_LeaveStoryManager.GetLeaveReason(Filter));
        }
        public JsonResult GetGata([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel)
        {
            SearchFilter SearchKey = SearchFilter.SearchData(1, requestModel, "Id", "Id");
            T_LMS_Trans_LeaveStoryCollection collection = T_LMS_Trans_LeaveStoryManager.Search(SearchKey);
            int TotalRecord = 0;

            if (collection.Count > 0)
            {
                TotalRecord = collection[0].TotalRecord;
            }
            return(Json(new DataTablesResponse(requestModel.Draw, collection, TotalRecord, TotalRecord), JsonRequestBehavior.AllowGet));
        }
        /// <summary>
        /// ExportExcel File
        /// </summary>
        /// <returns></returns>
        public string ExportExcel()
        {
            T_LMS_Trans_LeaveStoryCollection collection = T_LMS_Trans_LeaveStoryManager.GetAll();
            DataTable dt       = collection.ToDataTable <T_LMS_Trans_LeaveStory>();
            string    fileName = "T_LMS_Trans_LeaveStory_" + 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_LMS_Trans_LeaveStory List", false);
            return(fileName);
        }
 public ActionResult Update(T_LMS_Trans_LeaveStory model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             // TODO: Add insert logic here
             T_LMS_Trans_LeaveStoryManager.Update(model);
             //return RedirectToAction("Index");
         }
         return(View(model));
     }
     catch
     {
         return(View(model));
     }
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="UserID">Manager/DirectManagerID</param>
        /// <param name="FD">FromDate</param>
        /// <param name="TD">ToDate</param>
        /// <param name="AID">Associate ID</param>
        /// <returns></returns>
        public string ExportExDailyTMS(int UserID, string FD, string TD, int AID)
        {
            DataSet ds = new DataSet();
            ExternalDailyCollection collection = T_LMS_Trans_LeaveStoryManager.ExportExDailyTMS(UserID, FD, TD, AID);
            DataTable dt       = collection.ToDataTable <ExternalDaily>();
            string    fileName = AID + "_Monthly_TimeSheet_" + SystemConfig.CurrentDate.ToString("MM-dd-yyyy");

            string[] RemoveColumn = { "CompanyID", "TargetDisplayID", "ReturnDisplay", "TotalRecord", "CreatedUser", "CreatedDate", "ErrorMesssage" };
            for (int i = 0; i < RemoveColumn.Length; i++)
            {
                if (dt.Columns.Contains(RemoveColumn[i]))
                {
                    dt.Columns.Remove(RemoveColumn[i]);
                }
            }

            if (collection.Count > 0)
            {
                ds.Tables.Add(dt);
                int[]     DateColumn = { 6, 7 };
                string[]  sheetName  = { "Daily_TMS" };
                ExcelPara mypara     = new ExcelPara()
                {
                    ds          = ds,
                    sheetName   = sheetName,
                    fileName    = fileName,
                    DateColumns = DateColumn,
                    DateFormat  = "h:mm:ss"
                };
                FileInputHelper.ExportMultiSheetExcelExtend(mypara);
            }
            else
            {
                FileInputHelper.ExportExcel(dt, fileName, "Monthly_TimeSheet", false);
            }
            //set Column Date Format

            //
            return(fileName);
        }
Ejemplo n.º 14
0
 public T_LMS_Trans_LeaveStoryCollection GetbyUser(string usr)
 {
     return(T_LMS_Trans_LeaveStoryManager.GetbyUser(usr));
 }
Ejemplo n.º 15
0
 // GET api/<controller>/5
 /// <summary>
 /// Gets the specified COM group identifier.
 /// </summary>
 /// <param name="T_LMS_Trans_LeaveStoryId">The COM group identifier.</param>
 /// <returns></returns>
 public T_LMS_Trans_LeaveStory Get(int Id)
 {
     return(T_LMS_Trans_LeaveStoryManager.GetItemByID(Id));
 }
Ejemplo n.º 16
0
 // POST api/<controller>
 /// <summary>
 /// Posts the specified value.
 /// </summary>
 /// <param name="value">The value.</param>
 /// <returns></returns>
 public T_LMS_Trans_LeaveStory Post([FromBody] T_LMS_Trans_LeaveStory value)
 {
     return(T_LMS_Trans_LeaveStoryManager.AddItem(value));
 }
Ejemplo n.º 17
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_LMS_Trans_LeaveStory Put(string id, [FromBody] T_LMS_Trans_LeaveStory value)
 {
     return(T_LMS_Trans_LeaveStoryManager.UpdateItem(value));
 }
Ejemplo n.º 18
0
 // GET api/<controller>
 /// <summary>
 /// Gets this instance.
 /// </summary>
 /// <returns></returns>
 public T_LMS_Trans_LeaveStoryCollection Post(string method, [FromBody] SearchFilter value)
 {
     return(T_LMS_Trans_LeaveStoryManager.Search(value));
 }
Ejemplo n.º 19
0
 // DELETE api/<controller>/5
 /// <summary>
 /// Deletes the specified identifier.
 /// </summary>
 /// <param name="id">The identifier.</param>
 public void Delete(int id)
 {
     T_LMS_Trans_LeaveStoryManager.DeleteItem(id);
 }
Ejemplo n.º 20
0
 public LeaveWFCollection Get(LeaveWFPara Filter)
 {
     return(T_LMS_Trans_LeaveStoryManager.GetLeaveReason(Filter));
 }
        public ActionResult Get(int Id, string action)
        {
            T_LMS_Trans_LeaveStory objItem = T_LMS_Trans_LeaveStoryManager.GetById(Id);

            return(Content(JsonConvert.SerializeObject(objItem), "application/json"));
        }
        public ActionResult Get(int Id)
        {
            T_LMS_Trans_LeaveStory objItem = T_LMS_Trans_LeaveStoryManager.GetById(Id);

            return(View(objItem));
        }
Ejemplo n.º 23
0
 // GET api/<controller>
 /// <summary>
 /// Gets this instance.
 /// </summary>
 /// <returns></returns>
 public T_LMS_Trans_LeaveStoryCollection Get()
 {
     return(T_LMS_Trans_LeaveStoryManager.GetAllItem());
 }