Exemplo n.º 1
0
        public static dynamic GetUserData()
        {
            if (HttpContext.Current.Session["Hr_UserDL"] != null)
            {
                DataUserCurrentLogin objDataUserName = new DataUserCurrentLogin();

                // AspNetUserDL CurrentUser = (AspNetUserDL)HttpContext.Current.Session["Hr_UserDL"];
                AspNetUserDL CurrentUser = (AspNetUserDL)HttpContext.Current.Session["Hr_UserDL"];

                string strcomp    = HttpContext.Current.Session["CompanyName"].ToString().Trim();
                string strBrnch   = HttpContext.Current.Session["BranchName"].ToString().Trim();
                string strcompEN  = HttpContext.Current.Session["CompanyNameEN"].ToString().Trim();
                string strBrnchEN = HttpContext.Current.Session["BranchNameEN"].ToString().Trim();


                objDataUserName.CompanyNameProp   = String.Join("", strcomp.Where(c => c != '\n' && c != '\r' && c != '\t'));
                objDataUserName.BranchNameProp    = String.Join("", strBrnch.Where(c => c != '\n' && c != '\r' && c != '\t'));
                objDataUserName.CompanyNameENProp = String.Join("", strcompEN.Where(c => c != '\n' && c != '\r' && c != '\t'));
                objDataUserName.BranchNameENProp  = String.Join("", strBrnchEN.Where(c => c != '\n' && c != '\r' && c != '\t'));



                objDataUserName.BranchIdProp    = CurrentUser.Branch_Id;
                objDataUserName.CompanyIdProp   = CurrentUser.Company_Id;
                objDataUserName.UserIdProp      = CurrentUser.Id;
                objDataUserName.UserNameProp    = CurrentUser.UserName;
                objDataUserName.EmpSerialNoProp = CurrentUser.Emp_Serial_No;
                return(objDataUserName);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
 public static dynamic ChkShowAllEmp(string EmpId)
 {
     if (HttpContext.Current.Session["Hr_UserDL"] != null)
     {
         AspNetUserDL CurrentUser = (AspNetUserDL)HttpContext.Current.Session["Hr_UserDL"];
         ObjBL.UserNameProperty = CurrentUser.UserName;
         return(ObjBL.ChkShowAllEmp(EmpId));
     }
     else
     {
         return(null);
     }
 }
Exemplo n.º 3
0
        public static dynamic GetBranchAndCompanyName(string Company_Id, string Branch_Id)
        {
            if (HttpContext.Current.Session["Hr_UserDL"] != null)
            {
                AspNetUserDL CurrentUser = (AspNetUserDL)HttpContext.Current.Session["Hr_UserDL"];

                ObjBL.UserNameProperty = CurrentUser.UserName;
                return(ObjBL.GetBranchAndCompanyName(Company_Id, Branch_Id));
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 4
0
        public static dynamic GetCalcWithGrade(string strCompany, string strBranch)
        {
            if (HttpContext.Current.Session["Hr_UserDL"] != null)
            {
                // AspNetUserDL CurrentUser = (AspNetUserDL)HttpContext.Current.Session["Hr_UserDL"];
                AspNetUserDL CurrentUser = (AspNetUserDL)HttpContext.Current.Session["Hr_UserDL"];

                AppSettingBL.GetObject().UserNameProperty = CurrentUser.UserName;
                return(AppSettingBL.GetObject().GetCalcWithGrade(strCompany, strBranch));
            }
            else
            {
                return(0);
            }
        }
Exemplo n.º 5
0
        public static dynamic setUserData(AspNetUserDL objUser)
        {
            bool result = true;

            if (objUser != null && objUser.Id != null)
            {
                HttpContext.Current.Session["Hr_UserDL"] = objUser;
            }
            else
            {
                result = false;
            }

            return(result);

            // return Ok(result);
        }
Exemplo n.º 6
0
        public static dynamic ChekUserIsCommissioner(decimal empSerialNo, string strCompany, string strBranch)
        {
            if (HttpContext.Current.Session["Hr_UserDL"] != null)
            {
                //AspNetUserDL CurrentUser = (AspNetUserDL)HttpContext.Current.Session["Hr_UserDL"];
                AspNetUserDL CurrentUser = (AspNetUserDL)HttpContext.Current.Session["Hr_UserDL"];
                ObjBL.UserNameProperty = CurrentUser.UserName;
                bool result;
                result = ObjBL.ChekUserIsCommissioner(empSerialNo, strCompany, strBranch);

                return(result);
            }
            else
            {
                return(false);
            }
        }