Ejemplo n.º 1
0
        public Showuserdetails getUserDetails(string token)
        {
            sp = new List <System.Data.SqlClient.SqlParameter>();
            sp.Add(new SqlParameter("@token", token));
            SqlDataReader   dr = this.executeread("select vu.uid, vt.token, vt.os from VSM_UserDetail vu join VSM_UserToken vt on vu.uid = vt.uid where vt.token=@token");
            Showuserdetails u  = new Showuserdetails();

            if (dr.Read())
            {
                UserDetail ud = new UserDetail();
                UserToken  ut = new UserToken();

                ud.uid = Convert.ToInt32(dr["uid"]);
                //ud.uname = (dr["uname"]).ToString();
                //ud.mobileno = (dr["mobileno"]).ToString();
                //ud.profilepic = (dr["profilepic"]).ToString();
                //ut.lastudate = Convert.ToDateTime(dr["lastudate"]);
                //ut.token = (dr["token"]).ToString();
                ut.os = (dr["os"]).ToString();
                //ut.osversion = (dr["osversion"]).ToString();
                //ut.appversion = (dr["appversion"]).ToString();
                ut.token = token;

                u.ud = ud;
                u.ut = ut;
            }
            return(u);
        }
Ejemplo n.º 2
0
        public List <Showuserdetails> getAllUsers()
        {
            SqlDataReader          dr = this.executeread("select vu.uid, vu.uname, vu.mobileno, vt.lastudate, vt.token, vt.os, vt.osversion, vt.appversion from VSM_UserDetail vu join VSM_UserToken vt on vu.uid = vt.uid");
            List <Showuserdetails> ls = new List <Showuserdetails>();

            while (dr.Read())
            {
                Showuserdetails u  = new Showuserdetails();
                UserDetail      ud = new UserDetail();
                UserToken       ut = new UserToken();

                int i = dr.FieldCount;

                ud.uid        = Convert.ToInt32(dr["uid"]);
                ud.uname      = (dr["uname"]).ToString();
                ud.mobileno   = (dr["mobileno"]).ToString();
                ut.token      = (dr["token"]).ToString();
                ut.os         = (dr["os"]).ToString();
                ut.osversion  = (dr["osversion"]).ToString();
                ut.appversion = (dr["appversion"]).ToString();
                ut.lastudate  = Convert.ToDateTime(dr["lastudate"]);

                u.ud = ud;
                u.ut = ut;

                ls.Add(u);
            }
            return(ls);
        }
Ejemplo n.º 3
0
        public ActionResult Radio_check(Showuserdetails c1, String tokenlist, string title, string description, string link)
        {
            List <string> tokens = tokenlist.Split(',').ToList <string>();

            tokens.Reverse();

            dataConnect dc = new dataConnect();

            int i = 0;

            //SENXEX and NIFTY both are  down for the first time

            for (i = 0; i < tokens.Count(); i++)
            {
                AddNotificationData obj1 = new AddNotificationData();
                obj1.startTransaction();

                Showuserdetails u = new Showuserdetails();
                u = dc.getUserDetails(tokens[i]);
                Responce             res = new Responce();
                Req_NotificationData req = new Req_NotificationData();

                //req.baseobject.notificationcode = Constants.Notification_CUSTOM_GENERAL;

                //title = "SENXEX and NIFTY both are  down for the first time";
                //description = "Read More....";
                //link = "http://www.cantechletter.com/wp-content/uploads/2013/05/charging-bull-new-york-400x314.jpg";


                req.userid           = (u.ud.uid).ToString();
                req.insertDT         = CustomDate.getTodayDate();
                req.notificationcode = Constants.Notification_CUSTOM_GENERAL;
                req.message          = title;


                CustomNotificationModel model = new CustomNotificationModel();
                model.title            = title;
                model.notificationcode = Constants.Notification_CUSTOM_GENERAL;
                model.description      = description;
                model.link             = link;
                model.parent           = "marketview";

                string json = new JavaScriptSerializer().Serialize(model);

                req.custom = json;
                req.os     = u.ut.os;
                req.token  = tokens[i];

                VSMService1 service1 = new VSMService1();
                obj1.execute(req, res);

                int r = res.result;

                if (r == 0)
                {
                    obj1.rollbackTransaction();
                }
                else
                {
                    obj1.commitTransaction();
                }
            }

            return(RedirectToAction("AllUsers"));
        }