Esempio n. 1
0
        /// <summary>
        /// use for setting up default value
        /// </summary>
        /// <returns></returns>
        public ActionResult Update(int OrgId, string TargetID = "T_COm_Master_Orglist")
        {
            T_COm_Master_Org objItem = T_COm_Master_OrgManager.GetById(OrgId);

            objItem.TargetDisplayID = TargetID;
            return(View(ViewFolder + "Create.cshtml", objItem));
        }
Esempio n. 2
0
        public ActionResult T_COm_Master_OrgEvt(int[] OrgId, string Action)
        {
            // You have your books IDs on the deleteInputs array
            switch (Action.ToLower())
            {
            case "delete":

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


            return(View("PostFrm"));
        }
Esempio n. 3
0
        public ActionResult Create(T_CMS_Master_Contract model)
        {
            try
            {
                //  ModelState.Remove("dateEffetPosition");
                if (ModelState.IsValid)
                {
                    //model.CompanyID= CurrentUser.CompanyID;
                    // model.CompanyID = CurrentUser.CompanyID;
                    // model.CreatedUser = CurrentUser.UserName;
                    if (model.ID != 0)
                    {
                        //get default value
                        T_CMS_Master_Contract          b = T_CMS_Master_ContractManager.GetById(model.ID);
                        T_CMS_Master_EmploymentType    objEmpType;
                        T_CMS_Master_EmploymentSubType objEmpSubType;
                        T_COm_Master_Org objOrg;
                        b.ModifiedDate = SystemConfig.CurrentDate;

                        b.FirstName_EN  = model.FirstName_EN.ToUpper();
                        b.LastName_EN   = model.LastName_EN.ToUpper();
                        b.MiddleName_EN = model.MiddleName_EN.ToUpper();
                        b.FirstName_VN  = model.FirstName_VN.ToUpper();
                        b.LastName_VN   = model.LastName_VN.ToUpper();
                        b.MiddleName_VN = model.MiddleName_VN.ToUpper();

                        b.IDCardNo      = model.IDCardNo;
                        b.IDPOI         = model.IDPOI;
                        b.DOB           = model.DOB;
                        b.PassportNo    = model.PassportNo;
                        b.PassportPOI   = model.PassportPOI;
                        b.LabourDOI     = model.LabourDOI;
                        b.PerAddress    = model.PerAddress;
                        b.IDDOI         = model.IDDOI;
                        b.HighestDegree = model.HighestDegree;
                        b.POB           = model.POB;
                        b.PassportDOI   = model.PassportDOI;
                        b.LabourBookNo  = model.LabourBookNo;
                        b.LabourPOI     = model.LabourPOI;
                        b.Remarks       = model.Remarks;


                        b.DeptID       = model.DeptID;
                        b.LocationID   = model.LocationID;
                        b.ContractTerm = model.ContractTerm;
                        b.PositionID   = model.PositionID;
                        b.AnnualLeave  = model.AnnualLeave;
                        b.WorkHoursID  = model.WorkHoursID;

                        //duoble check to get AnuualLeave
                        b.GradeID      = model.GradeID;
                        b.AnnualLeave  = model.AnnualLeave;
                        b.ContractTerm = model.ContractTerm;
                        b.EmpSubTypeID = model.EmpSubTypeID;
                        b.SalutationID = model.SalutationID;

                        objOrg = T_COm_Master_OrgManager.GetById(model.DeptID);
                        if (objOrg != null)
                        {
                            objEmpType    = T_CMS_Master_EmploymentTypeManager.GetAllByEntityID(objOrg.Entity_Id, "C");
                            objEmpSubType = T_CMS_Master_EmploymentSubTypeManager.GetById(objEmpType.EmpTypeID);
                        }
                        int ProbationID = 0;

                        if (model.ContractTerm == 0)
                        {
                            //b.EmpSubTypeID = 101;//seasonable Sub-Type
                            b.ProbationsPeriod = 0;
                        }
                        else
                        {
                            b.ProbationsPeriod = model.ContractTerm / 12;
                        }
                        //else if (model.ContractTerm < 12)
                        //{
                        //  //  b.EmpSubTypeID = 103;//seasonable Sub-Type
                        //    b.ProbationsPeriod = null;
                        //}
                        //else
                        //{
                        //    //b.EmpSubTypeID = 102;//seasonable Sub-Type
                        //    b.ProbationsPeriod = 2;
                        //}


                        b.Grossoffer = model.Grossoffer;
                        //model.CreatedDate = b.CreatedDate;
                        //  model.CreatedUser = b.CreatedUser;
                        b.Joiningdate  = model.Joiningdate;
                        b.Enddate      = model.Enddate;
                        b.ModifiedBy   = CurrentUser.EmployeeCode;
                        b.OriginalDate = SystemConfig.CurrentDate;

                        ///set default value only
                        b.HomeGrossOfferEffectiveFrom = SystemConfig.CurrentDate;
                        b.HostGrossOfferEffectiveFrom = SystemConfig.CurrentDate;
                        b.HomeGrossOfferEffectiveTo   = SystemConfig.CurrentDate;
                        b.HostGrossOfferEffectiveTo   = SystemConfig.CurrentDate;
                        b.WorkPermitTo   = model.Enddate;
                        b.OriginalDate   = SystemConfig.CurrentDate;
                        b.WorkPermitFrom = SystemConfig.CurrentDate;

                        //if (model.LabourDOI.ToString().IndexOf("01/01/0001") == -1)
                        //{
                        //    b.LabourDOI =null;
                        //}
                        //if (model.PassportDOI.ToString().IndexOf("01/01/0001") == -1)
                        //{
                        //    model.PassportDOI = null;
                        //}
                        T_CMS_Master_ContractManager.Update(b);
                    }
                    else
                    {
                        // TODO: Add insert logic here
                        model.CreatedDate = SystemConfig.CurrentDate;
                        T_CMS_Master_ContractManager.Add(model);
                    }
                    return(View(ViewFolder + "list.cshtml"));
                }
            }
            catch
            {
                return(View(ViewFolder + "Create.cshtml", model));
            }
            return(View(ViewFolder + "Create.cshtml", model));
        }
Esempio n. 4
0
        public ActionResult Get(int OrgId)
        {
            T_COm_Master_Org objItem = T_COm_Master_OrgManager.GetById(OrgId);

            return(View(objItem));
        }
Esempio n. 5
0
        public ActionResult Get(int OrgId, string action)
        {
            T_COm_Master_Org objItem = T_COm_Master_OrgManager.GetById(OrgId);

            return(Content(JsonConvert.SerializeObject(objItem), "application/json"));
        }