Пример #1
0
 public IHttpActionResult getperfil([FromBody] getdata data)
 {
     try
     {
         MultigymEntities1 context = new MultigymEntities1();
         var user = (from x in context.MG_Persona
                     where x.Id == data.idusuario
                     select x).First();
         if (user != null)
         {
             var per = new EPersona();
             per.id           = user.Id;
             per.nombre       = user.Nombre;
             per.apellido     = user.Apellido;
             per.email        = user.Email;
             per.celular      = user.Celular;
             per.fechaingreso = user.FecIngreso;
             per.creditos     = user.CredDisponible;
             per.token        = user.Token;
             return(Ok(RespuestaApi <EPersona> .createRespuestaSuccess(per)));
         }
         else
         {
             return(Ok(RespuestaApi <string> .createRespuestaError("no se enontro un Usuario con este item")));
         }
     }
     catch (Exception ex)
     {
         return(Ok(RespuestaApi <string> .createRespuestaError(ex.Message)));
     }
 }
        public HttpResponseMessage Gethalfhour(parm reparm)
        {
            string result = string.Empty;

            try
            {
                int count = 0;
                string where = parwhere(reparm);



                //查询分页的数据
                DataTable dt = rule.getpaging("vwtblAgentPay", "*", "1=1" + where, reparm.page, reparm.limit, reparm.sort, out count);

                getdata getdata = new getdata();
                getdata.Table = dt;
                getdata.total = count;
                result        = rule.JsonStr("ok", "成功", getdata);
            }
            catch (Exception e)
            {
                result = rule.JsonStr("error", e.Message, "");
            }
            return(new HttpResponseMessage {
                Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json")
            });
        }
Пример #3
0
 public IHttpActionResult register([FromBody] getdata data)
 {
     try
     {
         MultigymEntities1 context = new MultigymEntities1();
         var user = (from x in context.MG_Persona
                     where x.Email == data.email &&
                     x.Passw == data.password
                     select x).ToList();
         if (user.Count() == 0)
         {
             var per = new MG_Persona();
             per.Nombre        = data.nombres;
             per.Apellido      = data.apellidos;
             per.Celular       = data.celular;
             per.FecNacimiento = Convert.ToDateTime(data.fechanacimiento);
             per.Email         = data.email;
             per.Passw         = data.password;
             per.Activo        = true;
             per.Id_Plan       = data.idplan;
             context.MG_Persona.Add(per);
             context.SaveChanges();
             return(Ok(RespuestaApi <MG_Persona> .createRespuestaSuccess(per)));
         }
         else
         {
             return(Ok(RespuestaApi <string> .createRespuestaError("Ya existe un usuario registrado con este correo.")));
         }
     }
     catch (Exception ex)
     {
         return(Ok(RespuestaApi <string> .createRespuestaError(ex.Message)));
     }
 }
Пример #4
0
 public IHttpActionResult registrodispositivo([FromBody] getdata data)
 {
     try
     {
         MultigymEntities1 context = new MultigymEntities1();
         var gym = (from x in context.MG_Gym
                    where x.ID == data.idgym
                    select x).ToList();
         if (gym.Count() != 0)
         {
             gym.First().IMEI      = data.imei;
             gym.First().PushID    = data.pushid;
             gym.First().CelTypeID = data.tipoapp == 1?"Android":"Ios";
             context.SaveChanges();
             return(Ok(RespuestaApi <string> .createRespuestaSuccess("ok")));
         }
         else
         {
             return(Ok(RespuestaApi <string> .createRespuestaError("no se pudo encontrar un gym con este id")));
         }
     }
     catch (Exception ex)
     {
         return(Ok(RespuestaApi <string> .createRespuestaError(ex.Message)));
     }
 }
        public HttpResponseMessage GetAccountflowlist(parm reparm)
        {
            string result = string.Empty;

            try
            {
                int count = 0;
                string where = parwhere(reparm);

                DataTable dt = rule.getpaging("vwAccountflow", "*", "1=1" + where, reparm.page, reparm.limit, reparm.sort, out count);

                getdata getdata = new getdata();
                getdata.Table = dt;
                getdata.total = count;
                result        = rule.JsonStr("ok", "成功", getdata);
            }
            catch (Exception e)
            {
                //错误保存日志
                throw new InsertException(e.Message, " Accountflow", "GetAccountflowlist", reparm.ToString());
            }
            return(new HttpResponseMessage {
                Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json")
            });
        }
Пример #6
0
        public HttpResponseMessage GetMerchantAllList()
        {
            string result = string.Empty;

            try
            {
                using (YYPlayContext db = new YYPlayContext())
                {
                    getdata getdatas = new getdata();

                    //查询所有的数据
                    var tbleMerchants = db.tbleMerchant.Select(x => new { x.fldMerchName, x.fldMerchID }).ToList();

                    if (getdatas != null)
                    {
                        result = rule.JsonStr("ok", "", tbleMerchants);
                    }
                    else
                    {
                        result = rule.JsonStr("nodata", "无数据!", getdatas);
                    }
                }
            }
            catch (Exception e)
            {
                result = rule.JsonStr("error", e.Message, "");
            }
            return(new HttpResponseMessage {
                Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json")
            });
        }
Пример #7
0
 public IHttpActionResult checkinscantaxis2([FromBody] getdata data)
 {
     try
     {
         MultigymEntities1 context = new MultigymEntities1();
         string            res     = "";
         res = check_gym(data.idgym);
         MG_Gym gym = new MG_Gym();
         if (res == "ok")
         {
             gym = (from x in context.MG_Gym
                    where x.ID == data.idgym &&
                    x.Id_TipoEntidad == (int)tipoEntidad.taxi &&
                    x.Activo == true
                    select x).First();
             res = check_persona(data.idusuario, data.montoapagar, gym.Nombre, true);
         }
         if (res != "ok")
         {
             return(Ok(RespuestaApi <string> .createRespuestaError(res)));
         }
         else
         {
             res = "Desea pagar " + data.montoapagar + " creditos a " + gym.Nombre;
             return(Ok(RespuestaApi <string> .createRespuestaSuccess(res)));
         }
     }
     catch (Exception ex)
     {
         return(Ok(RespuestaApi <string> .createRespuestaError(ex.Message)));
     }
 }
Пример #8
0
 public IHttpActionResult checkinscanother([FromBody] getdata data)
 {
     try
     {
         MultigymEntities1 context = new MultigymEntities1();
         string            res     = "";
         res = check_gym(data.idgym);
         MG_Gym gym = new MG_Gym();
         if (res == "ok")
         {
             gym = (from x in context.MG_Gym
                    where x.ID == data.idgym &&
                    x.Id_TipoEntidad == (int)tipoEntidad.comercio &&
                    x.Activo == true
                    select x).First();
         }
         if (res != "ok")
         {
             return(Ok(RespuestaApi <string> .createRespuestaError(res)));
         }
         else
         {
             res = "Ingrese el monto a pagar en " + gym.Nombre;
             return(Ok(RespuestaApi <string> .createRespuestaSuccess(res)));
         }
     }
     catch (Exception ex)
     {
         return(Ok(RespuestaApi <string> .createRespuestaError(ex.Message)));
     }
 }
Пример #9
0
        public IHttpActionResult getplanes([FromBody] getdata data)
        {
            try
            {
                MultigymEntities1 context = new MultigymEntities1();
                List <MG_Planes>  plans   = new List <MG_Planes>();
                plans = (from x in context.MG_Planes
                         where x.Activo == true
                         select x).ToList();

                List <EPlan> lista = new List <EPlan>();
                foreach (var p in plans)
                {
                    var pl = new EPlan();
                    pl.idplan      = p.Id;
                    pl.plan        = p.Nombre;
                    pl.descripcion = p.Descripcion;
                    pl.precio      = p.Creditos;
                    pl.creditos    = p.Creditos;
                    pl.activo      = p.Activo;
                    lista.Add(pl);
                }
                return(Ok(RespuestaApi <List <EPlan> > .createRespuestaSuccess(lista)));
            }
            catch (Exception ex)
            {
                return(Ok(RespuestaApi <string> .createRespuestaError(ex.Message)));
            }
        }
        public HttpResponseMessage GetChannelinformation(parm reparm)
        {
            string result = string.Empty;

            try
            {
                int count = 0;
                string where = "";

                //查询分页的数据
                DataTable dt = rule.getpaging("tblChannelinformation", "*", "1=1" + where, reparm.page, reparm.limit, "fldUpstreamMerchantID desc", out count);

                getdata getdata = new getdata();
                getdata.Table = dt;
                getdata.total = count;

                if (dt.Rows.Count > 0)
                {
                    result = rule.JsonStr("ok", "成功", getdata);
                }
                else
                {
                    result = rule.JsonStr("error", "失败", getdata);
                }
            }
            catch (Exception e)
            {
                //错误保存日志
                throw new InsertException(e.Message, "tblChannelinformation", "GetChannelinformation", "");
            }
            return(new HttpResponseMessage {
                Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json")
            });
        }
Пример #11
0
 public IHttpActionResult checkin2020taxis([FromBody] getdata data)
 {
     try
     {
         MultigymEntities1 context = new MultigymEntities1();
         var g = (from x in context.MG_Gym
                  where x.ID == data.idgym &&
                  x.Id_TipoEntidad == (int)tipoEntidad.taxi &&
                  x.Activo == true
                  select x).First();
         var u = (from x in context.MG_Persona
                  where x.Id == data.idusuario
                  select x).First();
         u.CredDisponible = Convert.ToInt16(u.CredDisponible - g.Creditos);
         context.SaveChanges();
         var v = new MG_Visitas();
         v.Id_Gym     = g.ID;
         v.Id_Persona = u.Id;
         v.FecVisita  = Now1;
         v.CredUsado  = Convert.ToInt16(data.montoapagar);
         context.MG_Visitas.Add(v);
         context.SaveChanges();
         var res = new ERandomResponse();
         res.mensaje  = "Transaccion exitosa " + u.Nombre + " te restan " + u.CredDisponible + " creditos|" + g.ImgLogo + "|" + u.Nombre + " " + u.Apellido + "|" + Now1.ToString("dd/MM/yyyy HH:mm");
         res.creditos = u.CredDisponible.ToString();
         notificationonesignal(g.PushID, "Nuevo Pago Registrado", u.Nombre + " ha pagado " + v.CredUsado + " Creditos", v.Id, u.Nombre, v.CredUsado, Convert.ToDateTime(v.FecVisita));
         return(Ok(RespuestaApi <ERandomResponse> .createRespuestaSuccess(res)));
     }
     catch (Exception ex)
     {
         return(Ok(RespuestaApi <string> .createRespuestaError(ex.Message)));
     }
 }
Пример #12
0
        public HttpResponseMessage GetDataList(parm reparm)
        {
            string result = string.Empty;

            try
            {
                int count = 0;
                string where = "";
                if (!string.IsNullOrEmpty(reparm.Accountingnum))
                {
                    where += " and fldAccountingnum='" + reparm.Accountingnum + "'";
                }
                if (!string.IsNullOrEmpty(reparm.MerchID))
                {
                    where += " and fldMerchID='" + reparm.MerchID + "'";
                }
                //查询分页的数据
                DataTable dt      = rule.getpaging("vwtblAccounting", "*", "1=1" + where, reparm.page, reparm.limit, reparm.sort, out count);
                getdata   getdata = new getdata();
                getdata.Table = dt;
                getdata.total = count;
                result        = rule.JsonStr("ok", "成功", getdata);
            }
            catch (Exception e)
            {
                result = rule.JsonStr("error", e.Message, "");
            }
            return(new HttpResponseMessage {
                Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json")
            });
        }
        public HttpResponseMessage GetOrdertableSystem(parm reparm)
        {
            string result = string.Empty;

            try
            {
                int count = 0;
                string where = parwhere(reparm);

                //查询分页的数据
                DataSet dt = rule.getpaging("vwOrdertableSystem", "*", "1=1" + where, reparm.page, reparm.limit, reparm.sort, out count, "SUM(fldOrderAmount) as fldOrderAmount,SUM(fldSettlement) as fldSettlement,SUM(fldServiceCharge) as fldServiceCharge");

                getdata getdata = new getdata();
                getdata.Table    = dt.Tables[0];
                getdata.SUMTable = dt.Tables[1];
                getdata.total    = count;
                result           = rule.JsonStr("ok", "成功", getdata);
            }
            catch (Exception e)
            {
                result = rule.JsonStr("error", e.Message, "");
            }
            return(new HttpResponseMessage {
                Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json")
            });
        }
Пример #14
0
 public IHttpActionResult checkin([FromBody] getdata data)
 {
     try
     {
         MultigymEntities1 context = new MultigymEntities1();
         var g = (from x in context.MG_Gym
                  where x.ID == data.idgym
                  select x).First();
         var u = (from x in context.MG_Persona
                  where x.Id == data.idusuario
                  select x).First();
         u.CredDisponible = Convert.ToInt16(u.CredDisponible - g.Creditos);
         context.SaveChanges();
         var v = new MG_Visitas();
         v.Id_Gym     = g.ID;
         v.Id_Persona = u.Id;
         v.FecVisita  = Now1;
         v.CredUsado  = g.Creditos;
         context.MG_Visitas.Add(v);
         context.SaveChanges();
         return(Ok(RespuestaApi <string> .createRespuestaSuccess("Transaccion exitosa " + u.Nombre + " te restan " + u.CredDisponible + " creditos|" + g.ImgLogo + "|" + u.Nombre + " " + u.Apellido + "|" + Now1.ToString("dd/MM/yyyy HH:mm"))));
     }
     catch (Exception ex)
     {
         return(Ok(RespuestaApi <string> .createRespuestaError(ex.Message)));
     }
 }
Пример #15
0
        public HttpResponseMessage GetMerchantList(int page, int limit, string where, string sort)
        {
            string result = string.Empty;

            try
            {
                using (YYPlayContext db = new YYPlayContext())
                {
                    int count = 0;
                    //查询分页的数据
                    DataTable dt       = rule.getpaging("tbleMerchant", "[fldAutoID],[fldMerchID],[fldMerchName],[fldContacts],[fldPhone],[fldCreateTime],[fldIPaddress],[fldIdCare],[fldAgent],[fldRemark],fldisstand", "1=1" + where, page, limit, sort, out count);
                    getdata   getdatas = new getdata();
                    getdatas.total = count;
                    getdatas.Table = dt;
                    //查询所有的数据  用于前端筛选
                    List <tbleMerchant> tbleMerchants = (from x in db.tbleMerchant select x).ToList();
                    getdatas.tbleMerchants = tbleMerchants;
                    if (getdatas != null)
                    {
                        result = rule.JsonStr("ok", "", getdatas);
                    }
                    else
                    {
                        result = rule.JsonStr("nodata", "无数据!", getdatas);
                    }
                }
            }
            catch (Exception e)
            {
                result = rule.JsonStr("error", e.Message, "");
            }
            return(new HttpResponseMessage {
                Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json")
            });
        }
Пример #16
0
        public HttpResponseMessage VerificationMerchant(string MerchantID)
        {
            string result = string.Empty;

            try
            {
                using (YYPlayContext db = new YYPlayContext())
                {
                    getdata getdatas = new getdata();

                    //查询所有的数据
                    List <tbleMerchant> tbleMerchants = (from x in db.tbleMerchant
                                                         where x.fldMerchID == MerchantID
                                                         select x).ToList();

                    if (tbleMerchants.Count > 0)
                    {
                        result = rule.JsonStr("ok", "", "");
                    }
                    else
                    {
                        result = rule.JsonStr("nodata", "无数据!", "");
                    }
                }
            }
            catch (Exception e)
            {
                result = rule.JsonStr("error", e.Message, "");
            }
            return(new HttpResponseMessage {
                Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json")
            });
        }
 protected void btnsearch_Click(object sender, EventArgs e)
 {
     g.addressid    = Convert.ToByte(textid.Text);
     g              = bal.search(g);
     textlname.Text = g.lname;
     textfname.Text = g.fname;
     textphnno.Text = g.phn_no.ToString();
 }
Пример #18
0
 public IHttpActionResult now2([FromBody] getdata data)
 {
     try
     {
         MultigymEntities1 context = new MultigymEntities1();
         var a = DateTime.Now;
         return(Ok(RespuestaApi <DateTime> .createRespuestaSuccess(a)));
     }
     catch (Exception ex)
     {
         return(Ok(RespuestaApi <string> .createRespuestaError(ex.Message)));
     }
 }
Пример #19
0
 public IHttpActionResult historialcheckin([FromBody] getdata data)
 {
     try
     {
         MultigymEntities1 context = new MultigymEntities1();
         var user = (from x in context.MG_Gym
                     where x.ID == data.idgym
                     select x).First();
         if (user != null)
         {
             var his = (from x in context.MG_Visitas
                        where x.Id_Gym == data.idgym
                        select x).OrderByDescending(x => x.FecVisita).ToList().Take(30);
             if (data.total == false)
             {
                 var stingf = data.fechafin.ToString().Split(' ')[0] + " 23:59";
                 var ff     = Convert.ToDateTime(stingf);
                 his = (from x in his
                        where (x.FecVisita.Value >= data.fechainicio && x.FecVisita.Value <= ff)
                        select x).OrderByDescending(x => x.FecVisita).ToList().Take(30);
             }
             var result = new EResVisitas();
             var res    = new List <Evisita>();
             foreach (var v in his)
             {
                 var vi = new Evisita();
                 vi.idvisita  = v.Id;
                 vi.idusuario = user.ID;
                 vi.nombregym = v.MG_Persona.Nombre;
                 //vi.fechayhora = parcedatetime(Convert.ToDateTime(v.FecVisita));
                 vi.fechayhora    = Convert.ToDateTime(v.FecVisita);
                 vi.creditousados = v.CredUsado;
                 vi.idgym         = v.Id_Gym;
                 res.Add(vi);
             }
             result.visitas         = res;
             result.creditosganados = res.Sum(x => x.creditousados).ToString();
             result.visitastotales  = res.Count().ToString();
             return(Ok(RespuestaApi <EResVisitas> .createRespuestaSuccess(result)));
         }
         else
         {
             return(Ok(RespuestaApi <string> .createRespuestaError("no se enontro un Usuario con este Id")));
         }
     }
     catch (Exception ex)
     {
         return(Ok(RespuestaApi <string> .createRespuestaError(ex.ToString())));
     }
 }
Пример #20
0
 public getdata search(getdata g)
 {
     FillData();
     foreach (DataRow dr in ds.Tables[0].Rows)
     {
         if (Convert.ToInt16(dr["address_id"]) == g.addressid)
         {
             g.lname     = dr["lname"].ToString();
             g.fname     = dr["fname"].ToString();
             g.phn_no    = dr["phn_no"].ToString();
             g.addressid = Convert.ToInt16(dr["address_id"]);
         }
     }
     return(g);
 }
Пример #21
0
        public YingGuang()
        {
            InitializeComponent();
            s.PortName = "COM1";
            s.BaudRate = 9600;
            s.DataBits = 8;
            s.Parity   = Parity.None;
            s.StopBits = StopBits.One;

            m_Buffer = new StringBuilder();

            getdata1 = new getdata(dealData);

            opencomm();
        }
Пример #22
0
        public int deletedata(getdata g)
        {
            FillData();
            SqlCommandBuilder cb = new SqlCommandBuilder(ada);

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                if (Convert.ToInt16(dr["address_id"]) == g.addressid)
                {
                    dr.Delete();
                    ada.Update(ds);
                    return(1);
                }
            }
            return(0);
        }
Пример #23
0
        public IHttpActionResult getgymsbydisc([FromBody] getdata data)
        {
            try
            {
                MultigymEntities1 context = new MultigymEntities1();
                List <MG_Gym>     gyms    = new List <MG_Gym>();
                if (data.iddisc == 0)
                {
                    gyms = (from x in context.MG_Gym
                            where x.Activo.Equals(true) &&
                            x.Id_TipoEntidad == (int)tipoEntidad.gymnasio
                            select x).ToList();
                }
                else
                {
                    gyms = (from x in context.MG_Gym_Disc
                            where x.Id_Disciplina == data.iddisc &&
                            x.MG_Gym.Activo.Equals(true)
                            select x.MG_Gym).ToList();
                }

                List <EGym> lista = new List <EGym>();
                foreach (var g in gyms)
                {
                    var gy = new EGym();
                    gy.idgym         = g.ID;
                    gy.nombregym     = g.Nombre;
                    gy.img           = g.ImgLogo;
                    gy.direccion     = g.Direccion;
                    gy.telefono      = g.Telefono;
                    gy.creditos      = g.Creditos;
                    gy.lat           = g.Lat.ToString();
                    gy.lon           = g.Lon.ToString();
                    gy.horariolv     = g.HorarioLV;
                    gy.horarios      = g.HorarioS;
                    gy.horariod      = g.HorarioDF;
                    gy.reviewaverage = g.ReviewAverage.ToString();
                    gy.reviewcount   = g.ReviewCount.ToString();
                    lista.Add(gy);
                }
                return(Ok(RespuestaApi <List <EGym> > .createRespuestaSuccess(lista)));
            }
            catch (Exception ex)
            {
                return(Ok(RespuestaApi <string> .createRespuestaError(ex.Message)));
            }
        }
Пример #24
0
 public IHttpActionResult login([FromBody] getdata data)
 {
     try
     {
         MultigymEntities1 context = new MultigymEntities1();
         var user = (from x in context.MG_Gym
                     where x.Email == data.usuariomail &&
                     x.Passw == data.password
                     select x).ToList();
         if (user.Count() != 0)
         {
             //if (user.First().Activo == true)
             //{
             var per = new EPersona();
             per.id     = user.First().ID;
             per.nombre = user.First().Nombre;
             //per.apellido = user.First().Apellido;
             per.apellido = "";
             per.email    = user.First().Email;
             per.celular  = user.First().Celular;
             //per.fechaingreso = user.First().FecIngreso;
             per.creditos = user.First().Creditos;
             //per.token = user.First().Token;
             return(Ok(RespuestaApi <EPersona> .createRespuestaSuccess(per)));
             //}
             //else
             //{
             //    return Ok(RespuestaApi<string>.createRespuestaError("Usuario inactivo, Ponga en contacto con el soporte tecnico"));
             //}
         }
         else
         {
             return(Ok(RespuestaApi <string> .createRespuestaError("Nombre o contraseña Incorrectos")));
         }
     }
     catch (Exception ex)
     {
         return(Ok(RespuestaApi <string> .createRespuestaError(ex.Message)));
     }
 }
Пример #25
0
        public int insertrecord(getdata g)
        {
            FillData();
            SqlCommandBuilder cb = new SqlCommandBuilder(ada);

            foreach (DataRow d in ds.Tables[0].Rows)
            {
                if (g.addressid == Convert.ToByte(d["address_id"]))
                {
                    return(0);
                }
            }
            DataRow dr = ds.Tables[0].NewRow();

            dr["address_id"] = g.addressid;
            dr["lname"]      = g.lname;
            dr["fname"]      = g.fname;
            dr["phn_no"]     = g.phn_no;
            ds.Tables[0].Rows.Add(dr);
            ada.Update(ds);
            return(1);
        }
Пример #26
0
        public static string call_MCWOG(getdata data)
        {
            string          msg = "";
            DataAccessClass da  = new DataAccessClass();

            string datenow = DateTime.Now.ToString("dd-MM-yyyy");
            string timenow = DateTime.Now.ToString("hh.mm tt");

            int up_MCWOG = da.ExecuteNonQuery("update tbl_dl_next_tkn_call set Status='out',pending_status='c' where date='" + datenow + "' and Vehicle_type='MCWOG' and Token_no='" + data.tokn + "'");

            if (up_MCWOG > 0)
            {
                DataTable dt = da.getdataTable("select top 1 * from tbl_dl_next_tkn_call where Status='in' and pending_status='n' and date='" + datenow + "' order by Token_no asc ");

                //int update_dl = da.ExecuteNonQuery("update tbl_dl_daily_pdf_data set Current_Status='AT DL TEST',time='" + timenow + "' where `Appl No.`='" + dt.Rows[0]["Appl_no"].ToString() + "' and `Vehicle`='MCWOG'");

                DataTable dtup_MCWOG = da.getdataTable("select * from tbl_dl_next_tkn_call where Token_no='" + data.tokn + "' and Vehicle_type!='TRANS' and Status!='out' and  date='" + datenow + "'");

                if (dtup_MCWOG.Rows.Count > 0)
                {
                    for (int i = 0; i < dtup_MCWOG.Rows.Count; i++)
                    {
                        int up_MCWOG1 = da.ExecuteNonQuery("update tbl_dl_next_tkn_call set pending_status='p' where id='" + dtup_MCWOG.Rows[i]["id"].ToString() + "'");
                    }
                }
                msg = "success";
            }
            else
            {
                msg = "Fail";
            }


            string JSONString = string.Empty;

            JSONString = JsonConvert.SerializeObject(msg);
            return(JSONString);
        }
Пример #27
0
        public HttpResponseMessage GetOrdertable(parm reparm)
        {
            string result = string.Empty;

            try
            {
                int count = 0;
                string where = parwhere(reparm);
                if (where == "")
                {
                    where = " and fldCreatetime>='" + DateTime.Now.ToShortDateString() + "'";
                }
                //查询分页的数据
                DataTable dt = rule.getpaging("vwOrdertable", "*", "1=1" + where, reparm.page, reparm.limit, "fldCreatetime desc", out count);

                getdata getdata = new getdata();
                getdata.Table = dt;
                getdata.total = count;

                if (dt.Rows.Count > 0)
                {
                    result = rule.JsonStr("ok", "成功", getdata);
                }
                else
                {
                    result = rule.JsonStr("error", "失败", getdata);
                }
            }
            catch (Exception e)
            {
                //错误保存日志
                throw new InsertException(e.Message, "Transaction", "GetOrdertable", "");
            }
            return(new HttpResponseMessage {
                Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json")
            });
        }
Пример #28
0
        public HttpResponseMessage GetSubroute(parm reparm)
        {
            string result = string.Empty;

            try
            {
                int count = 0;
                string where = "";
                if (reparm.Gatewaynumber != "")
                {
                    where += " and fldGatewaynumber='" + reparm.Gatewaynumber + "'";
                }
                //查询分页的数据
                DataTable dt = rule.getpaging("vwSubroute", "*", "1=1" + where, reparm.page, reparm.limit, "fldGatewaynumber,fldPayType desc", out count);

                getdata getdata = new getdata();
                getdata.Table = dt;
                getdata.total = count;

                if (dt.Rows.Count > 0)
                {
                    result = rule.JsonStr("ok", "成功", getdata);
                }
                else
                {
                    result = rule.JsonStr("error", "失败", getdata);
                }
            }
            catch (Exception e)
            {
                //错误保存日志
                throw new InsertException(e.Message, "Subroute", "GetSubroute", "");
            }
            return(new HttpResponseMessage {
                Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json")
            });
        }
Пример #29
0
        public IHttpActionResult getgymbynombre([FromBody] getdata data)
        {
            try
            {
                MultigymEntities1 context = new MultigymEntities1();
                List <MG_Gym>     gyms    = new List <MG_Gym>();
                gyms = (from x in context.MG_Gym
                        where x.Activo == true &&
                        x.Nombre.Contains(data.nombregym)
                        select x).ToList();

                List <EGym> lista = new List <EGym>();
                foreach (var g in gyms)
                {
                    var gy = new EGym();
                    gy.idgym         = g.ID;
                    gy.nombregym     = g.Nombre;
                    gy.img           = g.ImgLogo;
                    gy.direccion     = g.Direccion;
                    gy.telefono      = g.Telefono;
                    gy.creditos      = g.Creditos;
                    gy.lat           = g.Lat.ToString();
                    gy.lon           = g.Lon.ToString();
                    gy.horariolv     = g.HorarioLV;
                    gy.horarios      = g.HorarioS;
                    gy.horariod      = g.HorarioDF;
                    gy.reviewaverage = g.ReviewAverage.ToString();
                    gy.reviewcount   = g.ReviewCount.ToString();
                    lista.Add(gy);
                }
                return(Ok(RespuestaApi <List <EGym> > .createRespuestaSuccess(lista)));
            }
            catch (Exception ex)
            {
                return(Ok(RespuestaApi <string> .createRespuestaError(ex.Message)));
            }
        }
Пример #30
0
        public IHttpActionResult historialcheckin([FromBody] getdata data)
        {
            try
            {
                MultigymEntities1 context = new MultigymEntities1();
                var user = (from x in context.MG_Persona
                            where x.Id == data.idusuario
                            select x).First();
                if (user != null)
                {
                    var his = (from x in context.MG_Visitas
                               where x.Id_Persona == data.idusuario
                               select x).OrderByDescending(x => x.FecVisita).ToList().Take(30);
                    var res = new List <Evisita>();
                    foreach (var v in his)
                    {
                        var vi = new Evisita();
                        vi.idusuario     = user.Id;
                        vi.nombregym     = v.MG_Gym.Nombre;
                        vi.fechayhora    = parcedatetime(Convert.ToDateTime(v.FecVisita));
                        vi.creditousados = v.CredUsado;
                        vi.idgym         = v.Id_Gym;
                        res.Add(vi);
                    }

                    return(Ok(RespuestaApi <List <Evisita> > .createRespuestaSuccess(res)));
                }
                else
                {
                    return(Ok(RespuestaApi <string> .createRespuestaError("no se enontro un Usuario con este Id")));
                }
            }
            catch (Exception ex)
            {
                return(Ok(RespuestaApi <string> .createRespuestaError(ex.Message)));
            }
        }