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

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


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

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