Ejemplo n.º 1
0
        private Employee ReadFields( )
        {
            Employee eDM = new Employee()
            {
                ID            = -1,
                Age           = Basic.ToInt(txtAge.Text.Trim()),
                AddressLine1  = txtAddress.Text,
                Gender        = Gender.GetGenderId(cbGender.Text),
                MobileNo      = txtMobileNo.Text,
                City          = CBCity.Text,
                Country       = CBCountry.Text,
                Status        = "Normal",
                LastName      = TXTLastName.Text,
                FirstName     = TXTFirstName.Text,
                State         = cbState.Text,
                AttendenceId  = Basic.ToInt(TXTAttendenceID.Text.Trim()),
                DateOfBirth   = DTPBirthDate.Value,
                DateOfJoining = DTPJoiningDate.Value,
                EmpType       = EmpCode.GetCategory(CBEmpType.Text),
                DateOfLeaving = DTPJoiningDate.Value,
                EMPCode       = EmpCode.GenerateEmpCode(EmpCode.GetCategory(CBEmpType.Text))
            };

            return(eDM);
        }
Ejemplo n.º 2
0
        public bool VerifyHeader(out string ErrorMsg)
        {
            //if (data == null)
            //{
            //    return BadRequest();
            //}

            //string ipaddress = _accessor.HttpContext.Connection.RemoteIpAddress.ToString();
            string       ipaddress = "5555555";
            StringValues api_key;
            StringValues EmpCode;

            var isValidHeader = false;

            //APIITVendor //VendorData = new APIITVendor();
            if (Request.Headers.TryGetValue("api_Accesskey", out api_key) && Request.Headers.TryGetValue("EmpCode", out EmpCode))
            {
                string AccessKey  = api_key.First();
                string EmpCodeKey = EmpCode.First();

                if (!string.IsNullOrEmpty(AccessKey) && !string.IsNullOrEmpty(EmpCodeKey))
                {
                    //bool CanAccess = _authorizeService.AccessKeyAuthentication(AccessKey, EmpCodeKey);
                    //if (CanAccess == true)
                    //{
                    //    ErrorMsg = "";
                    //    return true;
                    //}
                }
            }
            else
            {
                if (!isValidHeader)
                {
                    //_log.LogDebug(ipaddress + " :: Missing Authorization Header.");
                    ErrorMsg = ipaddress + " :: Missing Authorization Header.";
                    //VendorData = new APIITVendor();
                    return(false);
                    //  return BadRequest("Missing Authorization Header.");
                }
            }
            //VendorData = new APIITVendor();
            ErrorMsg = "SomeThing Wrong with Header Contact Developer ASAP";
            return(false);
        }
Ejemplo n.º 3
0
 private void DisplayEmployeeData( )
 {
     if (emp != null)
     {
         TXTFirstName.Text    = emp.FirstName;
         TXTLastName.Text     = emp.LastName;
         txtMobileNo.Text     = emp.MobileNo;
         CBCity.Text          = emp.City;
         CBCountry.Text       = emp.Country;
         cbState.Text         = emp.State;
         CBEmpCode.Text       = emp.EMPCode;
         txtAddress.Text      = emp.AddressLine1;
         txtAge.Text          = "" + emp.Age;
         TXTAttendenceID.Text = "" + emp.AttendenceId;
         DTPBirthDate.Value   = emp.DateOfBirth;
         DTPJoiningDate.Value = emp.DateOfJoining;
         cbGender.Text        = Gender.GetGender(emp.Gender);
         CBEmpType.Text       = EmpCode.EmpTypeToCategory(emp.EmpType);
     }
 }
Ejemplo n.º 4
0
        public bool VerifyHeader(out string ErrorMsg)
        {
            string       ipaddress = "5555555";
            StringValues api_key;
            StringValues EmpCode;

            var isValidHeader = false;

            //APIITVendor //VendorData = new APIITVendor();
            if (Request.Headers.TryGetValue("api_Accesskey", out api_key))
            {
                string AccessKey  = api_key.First();
                string EmpCodeKey = EmpCode.First();

                if (!string.IsNullOrEmpty(AccessKey))
                {
                    bool CorrectACKey = SHAHelper.VerifyHash("APiCRMMobile", "SHA512", AccessKey);
                    if (CorrectACKey)
                    {
                        ErrorMsg = "";
                        return(true);
                    }
                }
            }
            else
            {
                if (!isValidHeader)
                {
                    //_log.LogDebug(ipaddress + " :: Missing Authorization Header.");
                    ErrorMsg = ipaddress + " :: Missing Authorization Header.";
                    //VendorData = new APIITVendor();
                    return(false);
                    //  return BadRequest("Missing Authorization Header.");
                }
            }
            //VendorData = new APIITVendor();
            ErrorMsg = "SomeThing Wrong with Header Contact Developer ASAP";
            return(false);
        }