Example #1
0
        static string getFilterCond(string cond, string sessionKey)
        {
            AuthInfo auth = AuthModel.GetAuthInfo(sessionKey);

            if (auth != null)
            {
                cond += cond == string.Empty ? "" : " AND ";
                cond += " ProductTypeID in (" + string.Join(",", auth.StaffProductTypeIds.ToArray()) + ")";
            }
            else
            {
                cond = " 0=1 ";
            }
            return(cond);
        }
Example #2
0
        public HttpResponseMessage StaffInfo(string sessionKey)
        {
            CatSalestaffDT staffDT   = new CatSalestaffDT();
            DataTable      dtSession = sessionDT.GetByCond("SessionID='" + sessionKey + "'", " ID DESC");

            if (dtSession != null && dtSession.Rows.Count > 0)
            {
                // DataTable dtStaff = staffDT.GetByCond("UserID=" + dtSession.Rows[0][LoginSessionContract.Columns[(int)LoginSessionColumns.UserID]].ToString());
                return(Request.CreateResponse <string>(HttpStatusCode.OK, JsonConvert.SerializeObject(AuthModel.GetAuthInfo(sessionKey))));
            }
            return(Request.CreateResponse <string>(HttpStatusCode.OK, "{}"));
        }