Beispiel #1
0
        public ActionResult TimeLogEvt(int[] TimeLogId, string Action)
        {
            // You have your books IDs on the deleteInputs array
            switch (Action.ToLower())
            {
            case "delete":

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


            return(View("PostFrm"));
        }
Beispiel #2
0
 public ActionResult Create(TimeLog model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             //model.CreatedUser = CurrentUser.UserName;
             if (model.TimeLogId != 0)
             {
                 //get default value
                 //	TimeLog b = TimeLogManager.GetById(model.TimeLogId);
                 TimeLogManager.Update(model);
             }
             else
             {
                 // TODO: Add insert logic here
                 // model.CreatedDate = SystemConfig.CurrentDate;
                 TimeLogManager.Add(model);
             }
             return(View(ViewFolder + "list.cshtml", TimeLogManager.GetAll()));
         }
     }
     catch
     {
         return(View(model));
     }
     return(View(model));
 }
Beispiel #3
0
        /// <summary>
        /// ExportExcel File
        /// </summary>
        /// <returns></returns>
        public string ExportExcel()
        {
            TimeLogCollection collection = TimeLogManager.GetAll();
            DataTable         dt         = collection.ToDataTable <TimeLog>();
            string            fileName   = "TimeLog_" + 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, "TimeLog List", false);
            return(fileName);
        }
Beispiel #4
0
        public ActionResult list()
        {
            TimeLogCollection collection = TimeLogManager.GetAll();

            return(View(ViewFolder + "list.cshtml", collection));
        }