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


            return(View("PostFrm"));
        }
Esempio n. 2
0
        public ContentResult Save(string objdata, string value)
        {
            JsonObject js = new JsonObject();

            js.StatusCode = 200;
            js.Message    = "Upload Success";
            try
            {
                T_CMS_Static_ContractTerm obj = JsonConvert.DeserializeObject <T_CMS_Static_ContractTerm>(objdata);
                obj = T_CMS_Static_ContractTermManager.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"));
        }
Esempio n. 3
0
        public ContentResult Search(SearchFilter SearchKey)
        {
            SearchKey.OrderBy = string.IsNullOrEmpty(SearchKey.OrderBy) ? "ID" : SearchKey.OrderBy;
            T_CMS_Static_ContractTermCollection collection = T_CMS_Static_ContractTermManager.Search(SearchKey);

            return(Content(JsonConvert.SerializeObject(collection), "application/json"));
        }
Esempio n. 4
0
 public ActionResult Create(T_CMS_Static_ContractTerm model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             //  model.CreatedUser = CurrentUser.UserName;
             if (model.ID != 0)
             {
                 //get default value
                 //	T_CMS_Static_ContractTerm b = T_CMS_Static_ContractTermManager.GetById(model.ID);
                 T_CMS_Static_ContractTermManager.Update(model);
             }
             else
             {
                 // TODO: Add insert logic here
                 //	 model.CreatedDate = SystemConfig.CurrentDate;
                 T_CMS_Static_ContractTermManager.Add(model);
             }
             return(View(ViewFolder + "list.cshtml", T_CMS_Static_ContractTermManager.GetAll()));
         }
     }
     catch
     {
         return(View(model));
     }
     return(View(model));
 }
Esempio n. 5
0
        /// <summary>
        /// use for setting up default value
        /// </summary>
        /// <returns></returns>
        public ActionResult Update(int ID, string TargetID = "T_CMS_Static_ContractTermlist")
        {
            T_CMS_Static_ContractTerm objItem = T_CMS_Static_ContractTermManager.GetById(ID);

            objItem.TargetDisplayID = TargetID;
            return(View(ViewFolder + "Create.cshtml", objItem));
        }
Esempio n. 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_CMS_Static_ContractTermCollection objItem = T_CMS_Static_ContractTermManager.Search(SearchKey);

            return(Content(JsonConvert.SerializeObject(objItem), "application/json"));
        }
Esempio n. 7
0
        public JsonResult GetGata([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel)
        {
            SearchFilter SearchKey = SearchFilter.SearchData(1, requestModel, "ID", "ID");
            T_CMS_Static_ContractTermCollection collection = T_CMS_Static_ContractTermManager.Search(SearchKey);
            int TotalRecord = 0;

            if (collection.Count > 0)
            {
                TotalRecord = collection[0].TotalRecord;
            }
            return(Json(new DataTablesResponse(requestModel.Draw, collection, TotalRecord, TotalRecord), JsonRequestBehavior.AllowGet));
        }
Esempio n. 8
0
 public ActionResult Update(T_CMS_Static_ContractTerm model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             // TODO: Add insert logic here
             T_CMS_Static_ContractTermManager.Update(model);
             //return RedirectToAction("Index");
         }
         return(View(model));
     }
     catch
     {
         return(View(model));
     }
 }
Esempio n. 9
0
        /// <summary>
        /// ExportExcel File
        /// </summary>
        /// <returns></returns>
        public string ExportExcel()
        {
            T_CMS_Static_ContractTermCollection collection = T_CMS_Static_ContractTermManager.GetAll();
            DataTable dt       = collection.ToDataTable <T_CMS_Static_ContractTerm>();
            string    fileName = "T_CMS_Static_ContractTerm_" + 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_Static_ContractTerm List", false);
            return(fileName);
        }
Esempio n. 10
0
        public ContentResult SaveExcel(string item)
        {
            //string b = Request["item"];
            IEnumerable <T_CMS_Static_ContractTerm> objItemList = JsonConvert.DeserializeObject <IEnumerable <T_CMS_Static_ContractTerm> >(item);

            JsonObject obj = new JsonObject();

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

                T_CMS_Static_ContractTermManager.Add(objitem);
            }

            return(Content(JsonConvert.SerializeObject(obj), "application/json"));
        }
Esempio n. 11
0
 // DELETE api/<controller>/5
 /// <summary>
 /// Deletes the specified identifier.
 /// </summary>
 /// <param name="id">The identifier.</param>
 public void Delete(int id)
 {
     T_CMS_Static_ContractTermManager.DeleteItem(id);
 }
Esempio n. 12
0
 // GET api/<controller>
 /// <summary>
 /// Gets this instance.
 /// </summary>
 /// <returns></returns>
 public T_CMS_Static_ContractTermCollection Post(string method, [FromBody] SearchFilter value)
 {
     return(T_CMS_Static_ContractTermManager.Search(value));
 }
Esempio n. 13
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_CMS_Static_ContractTerm Put(string id, [FromBody] T_CMS_Static_ContractTerm value)
 {
     return(T_CMS_Static_ContractTermManager.UpdateItem(value));
 }
Esempio n. 14
0
 // POST api/<controller>
 /// <summary>
 /// Posts the specified value.
 /// </summary>
 /// <param name="value">The value.</param>
 /// <returns></returns>
 public T_CMS_Static_ContractTerm Post([FromBody] T_CMS_Static_ContractTerm value)
 {
     return(T_CMS_Static_ContractTermManager.AddItem(value));
 }
Esempio n. 15
0
 // GET api/<controller>/5
 /// <summary>
 /// Gets the specified COM group identifier.
 /// </summary>
 /// <param name="T_CMS_Static_ContractTermId">The COM group identifier.</param>
 /// <returns></returns>
 public T_CMS_Static_ContractTerm Get(int ID)
 {
     return(T_CMS_Static_ContractTermManager.GetItemByID(ID));
 }
Esempio n. 16
0
 public T_CMS_Static_ContractTermCollection GetbyUser(string usr)
 {
     return(T_CMS_Static_ContractTermManager.GetbyUser(usr));
 }
Esempio n. 17
0
 // GET api/<controller>
 /// <summary>
 /// Gets this instance.
 /// </summary>
 /// <returns></returns>
 public T_CMS_Static_ContractTermCollection Get()
 {
     return(T_CMS_Static_ContractTermManager.GetAllItem());
 }
Esempio n. 18
0
        public void ExportExcel(string searchprm)
        {
            DataSet   ds = new DataSet();
            DataTable mydata;
            int       RBVH = 10001;
            //T_CMS_Master_ContractCollection collection = T_CMS_Master_ContractManager.GetAll(false);
            SearchFilter mySearch = BindSearch(searchprm);

            T_CMS_Master_ContractCollection collection = T_CMS_Master_ContractManager.Search(mySearch);

            mydata = collection.ToDataTable <T_CMS_Master_Contract>();
            string fileName = "Contract_" + SystemConfig.CurrentDate.ToString("MM-dd-yyyy");

            string[] RemoveColumn = { "CompanyID",                   "TargetDisplayID",             "ReturnDisplay",            "TotalRecord",
                                      "CreatedUser",                 "CreatedDate",                 "StatusID",                 "ApproverLevel",   "ContractLevel",        "SalutationID", "PositionID",  "LocationID",
                                      "PassportNo",                  "PassportDOI",                 "PassportPOI",              "LabourBookNo",    "LabourDOI",
                                      "LabourPOI",                   "AnnualLeave",                 "EmpTypeID",
                                      "EmpSubTypeID",                "WorkPermitNo",                "WorkPermitFrom",           "WorkPermitTo",
                                      "HomeGrossOffer",              "HomeGrossOfferEffectiveFrom",
                                      "HomeGrossOfferEffectiveTo",   "RelocationallowanceCurrency", "Relocationallowance",
                                      "GoabroadallowanceCurrency",   "Goabroadallowance",           "WaivingallowanceCurrency", "Waivingallowance","HostCountryCurrency",
                                      "HostGrossOfferEffectiveFrom", "HostGrossOfferEffectiveTo",   "Remarks",                  "CreatedBy",       "ModifiedBy",
                                      "ModifiedDate",                "IsActive",                    "OriginalDate",             "WorkFlowStatus",  "HandPhone",            "TempAddress",  "WorkHoursID", "ContractTerm","ProbationsPeriod","IDPOI", "Fullname",
                                      //"FirstName_EN","MiddleName_EN","LastName_EN","ContractNo","EmployeeCode",
                                      "GradeID",                     "CMSOrg",                      "Mode",                     "DeptID",          "ErrorMesssage" };
            for (int i = 0; i < RemoveColumn.Length; i++)
            {
                if (mydata.Columns.Contains(RemoveColumn[i]))
                {
                    mydata.Columns.Remove(RemoveColumn[i]);
                }
            }
            ds.Tables.Add(mydata);

            //DNH Position
            T_COM_Master_PositionCollection deColection = T_COM_Master_PositionManager.GetAll();

            mydata = deColection.ToDataTable <T_COM_Master_Position>();
            ds.Tables.Add(mydata);

            //DNH Grade
            T_COM_Master_GradeCollection objGrades = T_COM_Master_GradeManager.GetAll();

            mydata = objGrades.ToDataTable <T_COM_Master_Grade>();
            ds.Tables.Add(mydata);

            //DN Saluation

            T_CMS_Master_SalutationCollection objSalutation = T_CMS_Master_SalutationManager.GetAll();

            mydata = objSalutation.ToDataTable <T_CMS_Master_Salutation>();
            ds.Tables.Add(mydata);

            //DN Working Hours
            T_CMS_Master_WorkHoursCollection objWK = T_CMS_Master_WorkHoursManager.GetAll();

            //T_CMS_InterfaceLacviet_WorkingHoursCollection objWK = T_CMS_InterfaceLacviet_WorkingHoursManager.GetAll();
            mydata = objWK.ToDataTable <T_CMS_Master_WorkHours>();
            ds.Tables.Add(mydata);

            //DN Working Contract Term
            T_CMS_Static_ContractTermCollection objCT = T_CMS_Static_ContractTermManager.GetAll();

            mydata = objCT.ToDataTable <T_CMS_Static_ContractTerm>();
            ds.Tables.Add(mydata);

            //DN Working Probation
            T_CMS_Static_PeriodOfProbationCollection objPr = T_CMS_Static_PeriodOfProbationManager.GetAll();

            objPr.Add(new T_CMS_Static_PeriodOfProbation()
            {
                ID     = 100,
                Period = 0,
            });
            mydata = objPr.ToDataTable <T_CMS_Static_PeriodOfProbation>();
            ds.Tables.Add(mydata);

            //DN  Degree
            T_COM_Master_DegreeCollection objDg = T_COM_Master_DegreeManager.GetAll();

            mydata = objDg.ToDataTable <T_COM_Master_Degree>();
            ds.Tables.Add(mydata);

            //DN Working Location
            T_COM_Master_LocationCollection objLocation = T_COM_Master_LocationManager.GetAllByEntityID(RBVH);

            mydata = objLocation.ToDataTable <T_COM_Master_Location>();
            ds.Tables.Add(mydata);

            //DN Place of Issues
            T_COM_Master_PlaceOfIssueCollection objPOI = T_COM_Master_PlaceOfIssueManager.GetAll();

            mydata = objPOI.ToDataTable <T_COM_Master_PlaceOfIssue>();
            ds.Tables.Add(mydata);

            //DN Place of Issues
            T_COm_Master_OrgCollection objDepartment = T_COm_Master_OrgManager.GetAll();

            mydata = objDepartment.ToDataTable <T_COm_Master_Org>();
            ds.Tables.Add(mydata);

            // ds.Tables.Add(dt2);
            //ds.Tables.Add(dt3);
            List <string> groupCodeList = new List <string>();

            string[] sheetName = { "Contract", "Position", "Grade", "Saluation", "Working Hours", "Contract Term", "Probation", "Degree", "Location", "Place Of Issue", "Department" };
            List <DropdownModelExcel> listDrop = new List <DropdownModelExcel>()
            {
                new DropdownModelExcel()
                {
                    SheetShowDrop       = 1,
                    SheetDataDrop       = 11,
                    ColumnShowDropData  = 2,
                    RangeSheetData      = "B2:B" + (objDepartment.Count + 1),
                    IsHideSheetDataDrop = true
                },
                new DropdownModelExcel()
                {
                    SheetShowDrop       = 1,
                    SheetDataDrop       = 4,
                    ColumnShowDropData  = 3,
                    RangeSheetData      = "B2:B" + (objSalutation.Count + 1),
                    IsHideSheetDataDrop = true
                },
                new DropdownModelExcel()
                {
                    SheetShowDrop       = 1,
                    SheetDataDrop       = 3,
                    ColumnShowDropData  = 10,
                    RangeSheetData      = "B2:B" + (objGrades.Count + 1),
                    IsHideSheetDataDrop = true
                },
                new DropdownModelExcel()
                {
                    SheetShowDrop       = 1,
                    SheetDataDrop       = 2,
                    ColumnShowDropData  = 11, //column 12
                    RangeSheetData      = "B2:B" + (deColection.Count + 1),
                    IsHideSheetDataDrop = true
                },//location
                new DropdownModelExcel()
                {
                    SheetShowDrop       = 1,
                    SheetDataDrop       = 9,
                    ColumnShowDropData  = 16, //column 16 -Location
                    RangeSheetData      = "B2:B" + (objLocation.Count + 1),
                    IsHideSheetDataDrop = true
                },
                new DropdownModelExcel()
                {
                    SheetShowDrop       = 1,
                    SheetDataDrop       = 5,
                    ColumnShowDropData  = 17, //column 16
                    RangeSheetData      = "B2:B" + (objWK.Count + 1),
                    IsHideSheetDataDrop = true
                },
                new DropdownModelExcel()
                {
                    SheetShowDrop       = 1,
                    SheetDataDrop       = 6,
                    ColumnShowDropData  = 18, //column 16
                    RangeSheetData      = "B2:B" + (objCT.Count + 1),
                    IsHideSheetDataDrop = true
                },
                //propration Period
                new DropdownModelExcel()
                {
                    SheetShowDrop       = 1,
                    SheetDataDrop       = 7,
                    ColumnShowDropData  = 19, //column 16
                    RangeSheetData      = "B2:B" + (objPr.Count + 1),
                    IsHideSheetDataDrop = true
                },
                new DropdownModelExcel()
                {
                    SheetShowDrop       = 1,
                    SheetDataDrop       = 8,
                    ColumnShowDropData  = 25, //column 16
                    RangeSheetData      = "B2:B" + (objDg.Count + 1),
                    IsHideSheetDataDrop = true
                },
                //ID Place of Birth
                new DropdownModelExcel()
                {
                    SheetShowDrop       = 1,
                    SheetDataDrop       = 10,
                    ColumnShowDropData  = 21, //column 16
                    RangeSheetData      = "D2:D" + (objPOI.Count + 1),
                    IsHideSheetDataDrop = true
                },
                //ID Place of issues
                new DropdownModelExcel()
                {
                    SheetShowDrop       = 1,
                    SheetDataDrop       = 10,
                    ColumnShowDropData  = 24, //column 16
                    RangeSheetData      = "B2:B" + (objPOI.Count + 1),
                    IsHideSheetDataDrop = true
                },
            };

            //set Column Date Format
            int[]     DateColumn = { 14, 15, 20, 23 };
            ExcelPara mypara     = new ExcelPara()
            {
                ds          = ds,
                sheetName   = sheetName,
                fileName    = fileName,
                list        = listDrop,
                DateColumns = DateColumn,
                DateFormat  = "dd-mmm-yyyy"
            };

            //FileInputHelper.ExportExcel(dt, fileName, "Contract List", false);
            FileInputHelper.ExportMultiSheetExcelExtend(mypara);
            //return fileName;
        }
Esempio n. 19
0
        public ActionResult Get(int ID, string action)
        {
            T_CMS_Static_ContractTerm objItem = T_CMS_Static_ContractTermManager.GetById(ID);

            return(Content(JsonConvert.SerializeObject(objItem), "application/json"));
        }
Esempio n. 20
0
        public ActionResult Get(int ID)
        {
            T_CMS_Static_ContractTerm objItem = T_CMS_Static_ContractTermManager.GetById(ID);

            return(View(objItem));
        }
Esempio n. 21
0
        public ActionResult list()
        {
            T_CMS_Static_ContractTermCollection collection = T_CMS_Static_ContractTermManager.GetAll();

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