Пример #1
0
 //Check login
 public List <DL_LoginReturn> CheckLogin(DL_Login login)
 {
     this.SpName = DL_StoreProcedure.SP_DHS_API_Login; //Sp Name
     _IsSuccess  = true;
     try
     {
         SqlParameter[] param = new SqlParameter[4];
         param[0] = new SqlParameter("@UserName", login.Mobile);
         param[1] = new SqlParameter("@Password", login.Pass);
         param[2] = new SqlParameter("@Version", login.Version);
         param[3] = new SqlParameter("@Key", GenerateRandomSession());
         ds       = db.GetDataSet(this.SpName, param);
         if (ds != null && ds.Tables.Count > 0)
         {
             Logger.WriteLog(LogLevelL4N.INFO, "Got Data from Db.");
             loginReturn = new List <DL_LoginReturn>();
             //  var Json = JsonConvert.SerializeObject(ds);
             //loginReturn = JsonConvert.DeserializeObject<DL_LoginReturn>(Json);
             loginReturn = SerializeData.SerializeMultiValue <DL_LoginReturn>(ds.Tables[0]);
         }
     }
     catch (Exception ex)
     {
         Logger.WriteLog(LogLevelL4N.ERROR, "Exeception : " + ex.Message);
         _IsSuccess = false;
     }
     return(loginReturn);
 }
        public DataTable FillMonthYear(int Ind = 0, int CityCode = 0, int MonthCd = 0)
        {
            DL_Login  dlobj = new DL_Login();
            DataTable dt    = new DataTable();

            dt = dlobj.DL_FillMonthYear(Ind, CityCode, MonthCd);
            return(dt);
        }
        public DataTable LogOut(int Ind = 0, string UserName = "", string Password = "")
        {
            DL_Login  dlobj = new DL_Login();
            DataTable dt    = new DataTable();

            dt = dlobj.DL_LogOut(Ind, UserName, Password);
            return(dt);
        }
        public DataSet CheckLoginInfo(int Ind = 0, string UserName = "", string Password = "")
        {
            DL_Login dlobj = new DL_Login();
            DataSet  ds    = new DataSet();

            ds = dlobj.DL_CheckLoginInfo(Ind, UserName, Password);
            return(ds);
        }
Пример #5
0
 //Get Academic Year
 #region [Get Academic Year]
 public DataSet BL_GetAcademicYear(EWA_Login objEWA)
 {
     try
     {
         DL_Login objDL = new DL_Login();
         DataSet  ds    = objDL.DL_GetAcademicYear(objEWA);
         return(ds);
     }
     catch (Exception exp)
     {
         throw exp;
     }
 }
Пример #6
0
 //Insert Update Delete operaeion on User Information Table
 #region [Action Performed For Login]
 public int UserAction_BL(EWA_Login objEWA)
 {
     try
     {
         DL_Login objDL = new DL_Login();
         int      flag  = objDL.UserAction_DL(objEWA);
         return(flag);
     }
     catch (Exception exp)
     {
         throw exp;
     }
 }
Пример #7
0
        //To CheckValidUser_DL

        #region [Check Valid User]
        public DataSet CheckValidUser_BL(EWA_Login objEWA)
        {
            try
            {
                DL_Login objDL = new DL_Login();
                DataSet  ds    = objDL.CheckValidUser_DL(objEWA);
                return(ds);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public HttpResponseMessage Login(HttpRequestMessage req, DL_Login login)
        {
            if (!String.IsNullOrEmpty(login.Mobile) && !String.IsNullOrEmpty(login.Pass))
            {
                BL_Login blLogin = new BL_Login();
                List <DL_LoginReturn> dlLoginRet = blLogin.CheckLogin(login); //Validate Login
                if (blLogin._IsSuccess)
                {
                    return(req.CreateResponse <List <DL_LoginReturn> >(HttpStatusCode.OK, dlLoginRet));
                }
                else
                {
                    return(req.CreateErrorResponse(HttpStatusCode.InternalServerError, "ServerError"));
                }
            }

            return(req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request"));
        }