Exemplo n.º 1
0
        public ActionResult T_CMS_InterfaceLacviet_WorkingHoursEvt(int[] WorkingId, string Action)
        {
            // You have your books IDs on the deleteInputs array
            switch (Action.ToLower())
            {
            case "delete":

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


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

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