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

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


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

            js.StatusCode = 200;
            js.Message    = "Upload Success";
            try
            {
                T_COM_Master_Degree obj = JsonConvert.DeserializeObject <T_COM_Master_Degree>(objdata);
                obj = T_COM_Master_DegreeManager.Update(obj);
                if (obj.DegreeID == 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"));
        }
Beispiel #3
0
        public ContentResult Search(SearchFilter SearchKey)
        {
            SearchKey.OrderBy = string.IsNullOrEmpty(SearchKey.OrderBy) ? "DegreeID" : SearchKey.OrderBy;
            T_COM_Master_DegreeCollection collection = T_COM_Master_DegreeManager.Search(SearchKey);

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

            objItem.TargetDisplayID = TargetID;
            return(View(ViewFolder + "Create.cshtml", objItem));
        }
Beispiel #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, "DegreeID", "DegreeID", "Desc", condition);
            T_COM_Master_DegreeCollection objItem = T_COM_Master_DegreeManager.Search(SearchKey);

            return(Content(JsonConvert.SerializeObject(objItem), "application/json"));
        }
Beispiel #7
0
        public JsonResult GetGata([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel)
        {
            SearchFilter SearchKey = SearchFilter.SearchData(1, requestModel, "DegreeID", "DegreeID");

            T_COM_Master_DegreeCollection collection = T_COM_Master_DegreeManager.Search(SearchKey);
            int TotalRecord = 0;

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

            JsonObject obj = new JsonObject();

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

                T_COM_Master_DegreeManager.Add(objitem);
            }

            return(Content(JsonConvert.SerializeObject(obj), "application/json"));
        }
 // DELETE api/<controller>/5
 /// <summary>
 /// Deletes the specified identifier.
 /// </summary>
 /// <param name="id">The identifier.</param>
 public void Delete(int id)
 {
     T_COM_Master_DegreeManager.DeleteItem(id);
 }
 // GET api/<controller>
 /// <summary>
 /// Gets this instance.
 /// </summary>
 /// <returns></returns>
 public T_COM_Master_DegreeCollection Post(string method, [FromBody] SearchFilter value)
 {
     return(T_COM_Master_DegreeManager.Search(value));
 }
 // 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_COM_Master_Degree Put(string id, [FromBody] T_COM_Master_Degree value)
 {
     return(T_COM_Master_DegreeManager.UpdateItem(value));
 }
 // POST api/<controller>
 /// <summary>
 /// Posts the specified value.
 /// </summary>
 /// <param name="value">The value.</param>
 /// <returns></returns>
 public T_COM_Master_Degree Post([FromBody] T_COM_Master_Degree value)
 {
     return(T_COM_Master_DegreeManager.AddItem(value));
 }
 // GET api/<controller>/5
 /// <summary>
 /// Gets the specified COM group identifier.
 /// </summary>
 /// <param name="T_COM_Master_DegreeId">The COM group identifier.</param>
 /// <returns></returns>
 public T_COM_Master_Degree Get(int DegreeID)
 {
     return(T_COM_Master_DegreeManager.GetItemByID(DegreeID));
 }
 public T_COM_Master_DegreeCollection GetbyUser(string usr)
 {
     return(T_COM_Master_DegreeManager.GetbyUser(usr));
 }
 // GET api/<controller>
 /// <summary>
 /// Gets this instance.
 /// </summary>
 /// <returns></returns>
 public T_COM_Master_DegreeCollection Get()
 {
     return(T_COM_Master_DegreeManager.GetAllItem());
 }
Beispiel #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;
        }
Beispiel #19
0
        public ActionResult Get(int DegreeID, string action)
        {
            T_COM_Master_Degree objItem = T_COM_Master_DegreeManager.GetById(DegreeID);

            return(Content(JsonConvert.SerializeObject(objItem), "application/json"));
        }
Beispiel #20
0
        public ActionResult Get(int DegreeID)
        {
            T_COM_Master_Degree objItem = T_COM_Master_DegreeManager.GetById(DegreeID);

            return(View(objItem));
        }
Beispiel #21
0
        public ActionResult list()
        {
            T_COM_Master_DegreeCollection collection = T_COM_Master_DegreeManager.GetAll();

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