Exemplo n.º 1
0
        public HttpResponseMessage GetUserInformation(dynamic SearchForm)
        {
            string UserID = string.Empty;

            UserID = (string)SearchForm.UserID;

            string OutMsg = "No records found";

            try
            {
                APPDL     Obj = new APPDL();
                DataTable DT  = new DataTable();
                DT = Obj.Fn_UserInformation(Convert.ToString(UserID));
                List <CustomerList> UserList = new List <CustomerList>();
                if (DT.Rows.Count > 0)
                {
                    UserList = (from DataRow dr in DT.Rows
                                select new CustomerList()
                    {
                        appmstpaid = dr["appmstpaid"].ToString(),
                        appmstDOJ = dr["appmstDOJ"].ToString(),
                        appPaiddatetime = dr["appPaiddatetime"].ToString(),
                        AppMstRegNo = dr["AppMstRegNo"].ToString(),
                        AppmstFName = (dr["AppmstFName"]).ToString(),
                        appmststate = dr["appmststate"].ToString(),
                        appmstcity = dr["appmstcity"].ToString(),
                        AppmstSponsorTotal = dr["AppmstSponsorTotal"].ToString(),
                        appmstLeftTotal = dr["appmstLeftTotal"].ToString(),
                        appmstRightTotal = (dr["appmstRightTotal"]).ToString(),
                        sponsorid = dr["sponsorid"].ToString(),
                        Email = (dr["email"]).ToString(),
                        Number = dr["AppMstMobile"].ToString(),
                        BTC = dr["AcountNo"].ToString(),
                        Country = dr["distt"].ToString(),
                        zipCode = dr["appmstpincode"].ToString(),
                        ProfileImage = dr["imagename"].ToString(),
                        Type = dr["Type"].ToString(),
                        Passowrd = dr["AppMstPassword"].ToString(),
                        EPassowrd = dr["ePassword"].ToString(),
                    }).ToList();
                    return(Request.CreateResponse(HttpStatusCode.OK, UserList));
                }

                else
                {
                    return(Request.CreateErrorResponse(HttpStatusCode.NotFound, OutMsg));
                }
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "500_INTERNAL_SERVER_ERROR"));
            }
        }
Exemplo n.º 2
0
        public HttpResponseMessage Purchasepackage(dynamic SearchForm)
        {
            try
            {
                string RegID = string.Empty;
                string Amt   = string.Empty;
                string Type  = string.Empty;
                string OTP   = string.Empty;

                string Amountrate = string.Empty;
                string ConverAmt  = string.Empty;



                OTP        = (string)SearchForm.OTP;
                Type       = (string)SearchForm.Type;
                RegID      = (string)SearchForm.RegID;
                Amt        = (string)SearchForm.Amt;
                Amountrate = (string)SearchForm.Amountrate;
                ConverAmt  = (string)SearchForm.ConverAmt;



                APPDL     Objnew = new APPDL();
                DataTable Dtt    = new DataTable();
                Dtt = Objnew.Fn_UserInformation(Convert.ToString(RegID));
                int appmstpaid = 0;
                if (Dtt.Rows.Count > 0)
                {
                    appmstpaid = Convert.ToInt16(Dtt.Rows[0]["appmstpaid"]);
                }


                UserAppClass Obj = new UserAppClass();
                DataTable    DT  = new DataTable();

                if (appmstpaid == 0)
                {
                    Obj.ActivateUser(RegID, Amt, OTP, Amountrate, ConverAmt);
                    string OUtMsg = "";
                    if (Obj.OutMsg == "1")
                    {
                        OUtMsg = Obj.OutMsg;
                    }
                    else
                    {
                        OUtMsg = Obj.OutMsg;
                    }

                    return(Request.CreateResponse(HttpStatusCode.OK, OUtMsg));
                }

                else
                {
                    Obj.UpgradeUser(ConverAmt, RegID, Amt, OTP, Amountrate);
                    string OUtMsg = "";
                    if (Obj.OutMsg == "1")
                    {
                        OUtMsg = Obj.OutMsg;
                    }
                    else
                    {
                        OUtMsg = Obj.OutMsg;
                    }

                    return(Request.CreateResponse(HttpStatusCode.OK, OUtMsg));
                }
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "500_INTERNAL_SERVER_ERROR"));
            }
        }