Esempio n. 1
0
        public object getOrderContain(Dictionary <string, object> dicParas)
        {
            string errMsg     = string.Empty;
            string orderFlwId = dicParas.ContainsKey("orderFlwId") ? dicParas["orderFlwId"].ToString() : string.Empty;
            XCCloudUserTokenModel userTokenModel     = (XCCloudUserTokenModel)(dicParas[Constant.XCCloudUserTokenModel]);
            StoreIDDataModel      userTokenDataModel = (StoreIDDataModel)(userTokenModel.DataModel);

            if (string.IsNullOrEmpty(orderFlwId))
            {
                return(new ResponseModel(Return_Code.T, "", Result_Code.F, "订单Id参数无效"));
            }

            string storedProcedure = "GetOrderContainById";

            SqlParameter[] sqlParameter = new SqlParameter[2];
            sqlParameter[0]       = new SqlParameter("@StoreId", SqlDbType.VarChar);
            sqlParameter[0].Value = userTokenDataModel.StoreId;
            sqlParameter[1]       = new SqlParameter("@OrderFlwId", SqlDbType.Int);
            sqlParameter[1].Value = orderFlwId;

            System.Data.DataSet ds = XCCloudBLL.GetStoredProcedureSentence(storedProcedure, sqlParameter);
            if (ds != null && ds.Tables.Count == 2 && ds.Tables[0].Rows.Count > 0)
            {
                OrderMainModel          main   = Utils.GetModelList <OrderMainModel>(ds.Tables[0]).ToList()[0];
                List <OrderDetailModel> detail = Utils.GetModelList <OrderDetailModel>(ds.Tables[1]).ToList();
                OrderInfoModel          model  = new OrderInfoModel(main, detail);
                return(ResponseModelFactory.CreateSuccessModel <OrderInfoModel>(isSignKeyReturn, model));
            }
            else
            {
                return(new ResponseModel(Return_Code.T, "", Result_Code.F, "订单信息不存在"));
            }
        }
Esempio n. 2
0
        public object getMember(Dictionary <string, object> dicParas)
        {
            XCCloudUserTokenModel userTokenModel     = (XCCloudUserTokenModel)(dicParas[Constant.XCCloudUserTokenModel]);
            StoreIDDataModel      userTokenDataModel = (StoreIDDataModel)(userTokenModel.DataModel);

            string icCardId = dicParas.ContainsKey("icCardId") ? dicParas["icCardId"].ToString() : string.Empty;
            string storeId  = dicParas.ContainsKey("storeId") ? dicParas["storeId"].ToString() : string.Empty;

            if (string.IsNullOrEmpty(icCardId))
            {
                return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, "会员卡号无效"));
            }
            if (string.IsNullOrEmpty(storeId))
            {
                return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, "门店号无效"));
            }

            string storedProcedure = "GetMember";

            SqlParameter[] parameters = new SqlParameter[4];
            parameters[0]           = new SqlParameter("@ICCardID", icCardId);
            parameters[1]           = new SqlParameter("@StoreID", storeId);
            parameters[2]           = new SqlParameter("@Result", SqlDbType.Int);
            parameters[2].Direction = System.Data.ParameterDirection.Output;
            parameters[3]           = new SqlParameter("@ErrMsg", SqlDbType.VarChar, 200);
            parameters[3].Direction = System.Data.ParameterDirection.Output;
            System.Data.DataSet ds = XCCloudBLL.GetStoredProcedureSentence(storedProcedure, parameters);
            if (parameters[2].Value.ToString() == "1")
            {
                var baseMemberModel = Utils.GetModelList <BaseMemberModel>(ds.Tables[0]).ToList()[0];
                return(ResponseModelFactory <BaseMemberModel> .CreateModel(isSignKeyReturn, baseMemberModel));
            }
            return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, "会员信息不存在"));
        }
Esempio n. 3
0
        public object getMemberLevel(Dictionary <string, object> dicParas)
        {
            XCCloudUserTokenModel userTokenModel     = (XCCloudUserTokenModel)(dicParas[Constant.XCCloudUserTokenModel]);
            StoreIDDataModel      userTokenDataModel = (StoreIDDataModel)(userTokenModel.DataModel);

            string storedProcedure = "GetMemberLevel";

            SqlParameter[] parameters = new SqlParameter[1];
            parameters[0] = new SqlParameter("@StoreId", userTokenDataModel.StoreId);
            System.Data.DataSet          ds   = XCCloudBLL.GetStoredProcedureSentence(storedProcedure, parameters);
            List <Data_MemberLevelModel> list = Utils.GetModelList <Data_MemberLevelModel>(ds.Tables[0]);

            return(ResponseModelFactory.CreateSuccessModel(isSignKeyReturn, list));
        }
Esempio n. 4
0
        public object register(Dictionary <string, object> dicParas)
        {
            XCCloudUserTokenModel userTokenModel     = (XCCloudUserTokenModel)(dicParas[Constant.XCCloudUserTokenModel]);
            StoreIDDataModel      userTokenDataModel = (StoreIDDataModel)(userTokenModel.DataModel);
            string errMsg        = string.Empty;
            string storeId       = dicParas.ContainsKey("storeId") ? dicParas["storeId"].ToString() : string.Empty;
            string mobile        = dicParas.ContainsKey("mobile") ? dicParas["mobile"].ToString() : string.Empty;
            string wechat        = dicParas.ContainsKey("wechat") ? dicParas["wechat"].ToString() : string.Empty;
            string qq            = dicParas.ContainsKey("qq") ? dicParas["qq"].ToString() : string.Empty;
            string imme          = dicParas.ContainsKey("imme") ? dicParas["imme"].ToString() : string.Empty;
            string cardShape     = dicParas.ContainsKey("cardShape") ? dicParas["cardShape"].ToString() : string.Empty;
            string memberName    = dicParas.ContainsKey("memberName") ? dicParas["memberName"].ToString() : string.Empty;
            string birthday      = dicParas.ContainsKey("birthday") ? dicParas["birthday"].ToString() : string.Empty;
            string gender        = dicParas.ContainsKey("gender") ? dicParas["gender"].ToString() : string.Empty;
            string identityCard  = dicParas.ContainsKey("identityCard") ? dicParas["identityCard"].ToString() : string.Empty;
            string email         = dicParas.ContainsKey("email") ? dicParas["email"].ToString() : string.Empty;
            string leftHandCode  = dicParas.ContainsKey("leftHandCode") ? dicParas["leftHandCode"].ToString() : string.Empty;
            string rightHandCode = dicParas.ContainsKey("rightHandCode") ? dicParas["rightHandCode"].ToString() : string.Empty;
            string photo         = dicParas.ContainsKey("photo") ? dicParas["photo"].ToString() : string.Empty;
            string memberLevelId = dicParas.ContainsKey("memberLevelId") ? dicParas["memberLevelId"].ToString() : string.Empty;
            string foodId        = dicParas.ContainsKey("foodId") ? dicParas["foodId"].ToString() : string.Empty;
            string payCount      = dicParas.ContainsKey("payCount") ? dicParas["payCount"].ToString() : string.Empty;
            string realPay       = dicParas.ContainsKey("realPay") ? dicParas["realPay"].ToString() : string.Empty;
            string freePay       = dicParas.ContainsKey("freePay") ? dicParas["freePay"].ToString() : string.Empty;
            string repeatCode    = dicParas.ContainsKey("repeatCode") ? dicParas["repeatCode"].ToString() : string.Empty;
            string icCardId      = dicParas.ContainsKey("icCardId") ? dicParas["icCardId"].ToString() : string.Empty;
            string workStation   = dicParas.ContainsKey("workStation") ? dicParas["workStation"].ToString() : string.Empty;
            string note          = dicParas.ContainsKey("note") ? dicParas["note"].ToString() : string.Empty;
            string deposit       = dicParas.ContainsKey("deposit") ? dicParas["deposit"].ToString() : string.Empty;
            string payType       = dicParas.ContainsKey("payType") ? dicParas["payType"].ToString() : string.Empty;
            string saleCoinType  = dicParas.ContainsKey("saleCoinType") ? dicParas["saleCoinType"].ToString() : string.Empty;


            if (!checkRegisterParas(dicParas, out errMsg))
            {
                ResponseModel responseModel = new ResponseModel(Return_Code.T, "", Result_Code.F, errMsg);
                return(responseModel);
            }

            string storedProcedure = "RegisterMember";

            String[] Ary = new String[] {
                "数据0", "数据1", "数据2", "数据3", "数据4",
                "数据5", "数据6", "数据7", "数据8", "数据9",
                "数据10", "数据11", "数据12", "数据13", "数据14",
                "数据15", "数据16", "数据17", "数据18", "数据19",
                "数据20", "数据21", "数据22", "数据23", "数据24",
                "数据25", "数据26", "数据27"
            };

            List <object> listParas = new List <object>();

            listParas.Add(storeId);                         //StoreId
            listParas.Add(mobile);                          //Mobile
            listParas.Add(wechat);                          //WeChat
            listParas.Add(qq);                              //QQ
            listParas.Add(imme);                            //IMME

            listParas.Add(int.Parse(cardShape));            //CardShape
            listParas.Add(memberName);                      //MemberName
            listParas.Add("888888");                        //MemberPassword
            listParas.Add(birthday);                        //Birthday
            listParas.Add(gender);                          //Gender

            listParas.Add(identityCard);                    //IdentityCard
            listParas.Add(email);                           //EMail
            listParas.Add(leftHandCode);                    //LeftHandCode
            listParas.Add(rightHandCode);                   //RightHandCode
            listParas.Add(photo);                           //Photo

            listParas.Add(int.Parse(memberLevelId));        //MemberLevelId
            listParas.Add(int.Parse(foodId));               //FoodId
            listParas.Add(decimal.Parse(payCount));         //payCount
            listParas.Add(decimal.Parse(realPay));          //realPay
            listParas.Add(decimal.Parse(freePay));          //freePay

            listParas.Add(int.Parse(repeatCode));           //repeatCode
            listParas.Add(int.Parse(icCardId));             //icCardId
            listParas.Add(workStation);                     //workStation
            listParas.Add(int.Parse(userTokenModel.LogId)); //UserId
            listParas.Add(decimal.Parse(deposit));          //deposit

            listParas.Add((long)0);                         //icCardUID
            listParas.Add(int.Parse(payType));              //payType
            listParas.Add(int.Parse(saleCoinType));         //saleCoinType


            List <SqlDataRecord> listSqlDataRecord = new List <SqlDataRecord>();

            SqlMetaData[] MetaDataArr = new SqlMetaData[] {
                new SqlMetaData("StoreId", SqlDbType.VarChar, 15),
                new SqlMetaData("Mobile", SqlDbType.VarChar, 20),
                new SqlMetaData("WeChat", SqlDbType.VarChar, 64),
                new SqlMetaData("QQ", SqlDbType.VarChar, 64),
                new SqlMetaData("IMME", SqlDbType.VarChar, 64),

                new SqlMetaData("CardShape", SqlDbType.Int),
                new SqlMetaData("MemberName", SqlDbType.VarChar, 50),
                new SqlMetaData("MemberPassword", SqlDbType.VarChar, 20),
                new SqlMetaData("Birthday", SqlDbType.VarChar, 16),
                new SqlMetaData("Gender", SqlDbType.VarChar, 1),

                new SqlMetaData("IdentityCard", SqlDbType.VarChar, 50),
                new SqlMetaData("EMail", SqlDbType.VarChar, 50),
                new SqlMetaData("LeftHandCode", SqlDbType.VarChar, 5000),
                new SqlMetaData("RightHandCode", SqlDbType.VarChar, 5000),
                new SqlMetaData("Photo", SqlDbType.VarChar, 100),

                new SqlMetaData("MemberLevelId", SqlDbType.Int),
                new SqlMetaData("FoodId", SqlDbType.Int),
                new SqlMetaData("PayCount", SqlDbType.Decimal),
                new SqlMetaData("RealPay", SqlDbType.Decimal),
                new SqlMetaData("FreePay", SqlDbType.Decimal),

                new SqlMetaData("RepeatCode", SqlDbType.Int),
                new SqlMetaData("ICCardId", SqlDbType.Int),
                new SqlMetaData("WorkStation", SqlDbType.VarChar, 50),
                new SqlMetaData("UserId", SqlDbType.Int),
                new SqlMetaData("Deposit", SqlDbType.Decimal),

                new SqlMetaData("ICCardUID", SqlDbType.BigInt),
                new SqlMetaData("PayType", SqlDbType.Int),
                new SqlMetaData("SaleCoinType", SqlDbType.Int)
            };

            var record = new SqlDataRecord(MetaDataArr);

            for (int i = 0; i < Ary.Length; i++)
            {
                record.SetValue(i, listParas[i]);
            }
            listSqlDataRecord.Add(record);

            SqlParameter[] sqlParameter = new SqlParameter[4];
            sqlParameter[0]           = new SqlParameter("@RegisterMember", SqlDbType.Structured);
            sqlParameter[0].Value     = listSqlDataRecord;
            sqlParameter[1]           = new SqlParameter("@Note", SqlDbType.Text);
            sqlParameter[1].Value     = note;
            sqlParameter[2]           = new SqlParameter("@ErrMsg", SqlDbType.VarChar, 200);
            sqlParameter[2].Direction = ParameterDirection.Output;
            sqlParameter[3]           = new SqlParameter("@Result", SqlDbType.Int);
            sqlParameter[3].Direction = ParameterDirection.Output;
            System.Data.DataSet ds = XCCloudBLL.GetStoredProcedureSentence(storedProcedure, sqlParameter);
            if (sqlParameter[3].Value.ToString() == "1")
            {
                var baseMemberModel = Utils.GetModelList <BaseMemberModel>(ds.Tables[0]).ToList()[0];
                return(ResponseModelFactory <BaseMemberModel> .CreateModel(isSignKeyReturn, baseMemberModel));
            }
            else
            {
                return(new ResponseModel(Return_Code.T, "", Result_Code.F, sqlParameter[2].Value.ToString()));
            }
        }