public ADUsersInfo GetEmployeeUserByIDNumber(string sNumber)
        {
            DataSet ds = SqlDatabaseHelper.RunStoredProcedure("spl_GetEmployeeUserByIDNumber", sNumber);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                return(new ADUsersController().GetObjectFromDataRow(ds.Tables[0].Rows[0]) as ADUsersInfo);
            }
            return(null);
        }
Beispiel #2
0
        public DataTable GetAllDataByEmployeeOffWorkID(int iObjectID)
        {
            DataSet ds = SqlDatabaseHelper.RunStoredProcedure("spl_GetAllDataByEmployeeOffWorkID", iObjectID);

            if (ds != null && ds.Tables.Count > 0)
            {
                return(ds.Tables[0]);
            }
            return(null);
        }
Beispiel #3
0
 private DataSet GetScreenByModuleNameAndUserGroupName(string sModuleName, string sUserGroupName)
 {
     if (GMCDbUtil.StoredProcedureIsExist("STScreenWebApps_SelectBySTModuleNameAndADUserGroupName"))
     {
         return(SqlDatabaseHelper.RunStoredProcedure("STScreenWebApps_SelectBySTModuleNameAndADUserGroupName", sModuleName, sUserGroupName));
     }
     else
     {
         return(new STScreensController().GetScreenByModuleNameAndUserGroupName(sModuleName, sUserGroupName));
     }
 }
        public ActionResult RegisterOffWork(string oEmplOffWork)
        {
            string[] arr = oEmplOffWork.Split('&');
            HREmployeeOffWorksInfo       objEmplOffWork      = new HREmployeeOffWorksInfo();
            HREmployeeOffWorksController EmployeeOffWorkCtrl = new HREmployeeOffWorksController();

            arr.ToList().ForEach(x =>
            {
                string[] arrItem = x.Split('=');
                GMCDbUtil.SetPropertyValue(objEmplOffWork, arrItem.FirstOrDefault(), Convert.ChangeType(arrItem.LastOrDefault(), GMCDbUtil.GetCSharpVariableType("HREmployeeOffWorks", arrItem.FirstOrDefault())));
            });
            int iLeaveTypeID = new HREmployeeLeaveTypesController().GetObjectIDByNo("PN");

            if (objEmplOffWork.FK_HREmployeeLeaveTypeID == iLeaveTypeID && objEmplOffWork.HREmployeeOffWorkRegDays > Convert.ToDouble(AuthConfig.GetSession("TongNgayPhep")))
            {
                return(Content("Số ngày nghỉ phép vượt quá tổng số ngày nghỉ phép còn lại! Kiểm tra lại"));
            }
            HREmployeesInfo objEmpl = ExpertERP.Controller.EmployeeCtrl.GetObjectByID(objEmplOffWork.FK_HREmployeeID) as HREmployeesInfo;

            if (objEmpl == null)
            {
                objEmpl = GMCWebApp.GetEmployeeByUserName(Convert.ToString(AuthConfig.GetSession("CurrentUser")));
            }
            if (objEmpl != null)
            {
                DataSet ds = SqlDatabaseHelper.RunStoredProcedure("spl_GetAllDataEmployeeOffWorkByEmployeeIDAndDate", objEmpl.HREmployeeID, objEmplOffWork.HREmployeeOffWorkFromDate.Value, objEmplOffWork.HREmployeeOffWorkToDate.Value);
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    return(Content(string.Format("Bạn đã đăng ký phép trong thời gian {0} - {1}! Vui lòng kiểm tra lại!", objEmplOffWork.HREmployeeOffWorkFromDate.Value.ToShortDateString(), objEmplOffWork.HREmployeeOffWorkToDate.Value.ToShortDateString())));
                }
                if (objEmplOffWork.FK_HREmployeeID == 0)
                {
                    objEmplOffWork.FK_HREmployeeID = objEmpl.HREmployeeID;
                }
                objEmplOffWork.AACreatedUser              = Convert.ToString(AuthConfig.GetSession("CurrentUser"));
                objEmplOffWork.ApprovalStatusCombo        = "New";
                objEmplOffWork.HREmployeeOffWorkTypeCombo = "Permision";
                EmployeeOffWorkCtrl.SaveObject(objEmplOffWork);
                return(Content("OK"));
            }
            else
            {
                return(Content("User hiện chưa cấu hình nhân viên! Không thể đăng ký!"));
            }
        }
Beispiel #5
0
 public DataSet GetEmployeeOffWorkByApprovalStatus(int iEmployeeID, string sApprovalStatus, string sStatus = "Alive")
 {
     return(SqlDatabaseHelper.RunStoredProcedure("spl_GetDataEmployeeOffWorkByEmployeeID", iEmployeeID, sApprovalStatus, sStatus));
 }