Example #1
0
        public int Comfirm_Smar1(Smar request)
        {
            int Result = -1;

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection())
                {
                    if (request.UpdateAllString != null && request.UpdateAllString != "")
                    {
                        JArray ja = (JArray)JsonConvert.DeserializeObject(request.UpdateAllString);
                        if (ja != null)
                        {
                            for (int i = 0; i < ja.Count(); i++)
                            {
                                string strSql         = "";
                                string PhoneNumber    = ja[i]["PhoneNumber"].ToString();
                                string PassWord       = ja[i]["PassWord"].ToString();
                                string YogaStudioName = ja[i]["YogaStudioName"].ToString();
                                string Sex            = ja[i]["Sex"].ToString();
                                string Remark         = ja[i]["Remark"].ToString();
                                string AreaCode       = ja[i]["AreaCode"].ToString();

                                strSql = "insert into Samr1( " +
                                         "   YogaStudioName," +
                                         "   AreaCode," +
                                         "   Sex," +
                                         "   Remark ," +
                                         "   PhoneNumber ," +
                                         "   PassWord ," +
                                         "   CreateDateTime," +
                                         "   UpdateDateTime" +
                                         "  )" +
                                         "values( " +
                                         Modfunction.SQLSafeValue(YogaStudioName) + "," +
                                         Modfunction.SQLSafeValue(AreaCode) + "," +
                                         Modfunction.SQLSafeValue(Sex) + "," +
                                         Modfunction.SQLSafeValue(Remark) + "," +
                                         Modfunction.SQLSafeValue(PhoneNumber) + "," +
                                         Modfunction.SQLSafeValue(PassWord) + "," +
                                         "GETDATE()," +
                                         "GETDATE()" +
                                         ") ";
                                db.ExecuteSql(strSql);
                            }
                            Result = 1;
                        }
                    }
                }
            }
            catch { throw; }
            return(Result);
        }
Example #2
0
        public List <Samr1> LoginCheck(Smar request)
        {
            List <Samr1> Result = null;

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection("Yoga"))
                {
                    string strSql = "";

                    if (request.PhoneNumber != null && request.PhoneNumber.Length > 0 && request.PassWord != null && request.PassWord.Length > 0)
                    {
                        strSql = "Select isnull(PhoneNumber,'') as  PhoneNumber ,isnull(PassWord,'') as  PassWord From Samr1 Where PhoneNumber='" + request.PhoneNumber + "' And PassWord ='******' ";
                        Result = db.Select <Samr1>(strSql);
                    }
                }
            }
            catch { throw; }
            return(Result);
        }