Exemple #1
0
        public object getMemberRepeatCode(Dictionary <string, object> dicParas)
        {
            XCCloudUserTokenModel userTokenModel = (XCCloudUserTokenModel)(dicParas[Constant.XCCloudUserTokenModel]);
            string storeId  = dicParas.ContainsKey("storeId") ? dicParas["storeId"].ToString() : string.Empty;
            string icCardId = dicParas.ContainsKey("icCardId") ? dicParas["icCardId"].ToString() : string.Empty;

            if (string.IsNullOrEmpty(storeId))
            {
                return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, "门店号不能为空"));
            }

            StoreInfoCacheModel storeInfo = null;

            if (!XCCloudStoreBusiness.IsEffectiveStore(storeId, ref storeInfo))
            {
                return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, "门店号无效"));
            }

            if (string.IsNullOrEmpty(icCardId))
            {
                return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, "会员卡号无效"));
            }
            //获取会员信息
            string storedProcedure = "GetMemberRepeatCode";

            SqlParameter[] parameters = new SqlParameter[5];
            parameters[0]           = new SqlParameter("@ICCardID", icCardId);
            parameters[1]           = new SqlParameter("@StoreID", storeId);
            parameters[2]           = new SqlParameter("@RepeatCode", SqlDbType.Int);
            parameters[2].Direction = System.Data.ParameterDirection.Output;
            parameters[3]           = new SqlParameter("@ErrMsg", SqlDbType.VarChar, 200);
            parameters[3].Direction = System.Data.ParameterDirection.Output;
            parameters[4]           = new SqlParameter("@Return", SqlDbType.Int);
            parameters[4].Direction = System.Data.ParameterDirection.ReturnValue;
            XCCloudBLL.ExecuteStoredProcedureSentence(storedProcedure, parameters);
            if (parameters[4].Value.ToString() == "1")
            {
                var obj = new {
                    repeatCode = parameters[2].Value.ToString()
                };
                return(ResponseModelFactory.CreateAnonymousSuccessModel(isSignKeyReturn, obj));
            }
            else
            {
                return(ResponseModelFactory.CreateModel(isSignKeyReturn, Return_Code.T, "", Result_Code.F, "会员卡无效"));
            }
        }
Exemple #2
0
        private bool CheckAddOrderParams(Dictionary <string, object> dicParas, out string errMsg)
        {
            errMsg = string.Empty;
            string storeId      = dicParas.ContainsKey("storeId") ? dicParas["storeId"].ToString() : string.Empty;
            string icCardId     = dicParas.ContainsKey("icCardId") ? dicParas["icCardId"].ToString() : string.Empty;
            string payCount     = dicParas.ContainsKey("payCount") ? dicParas["payCount"].ToString() : string.Empty;
            string freePay      = dicParas.ContainsKey("freePay") ? dicParas["freePay"].ToString() : string.Empty;
            string realPay      = dicParas.ContainsKey("realPay") ? dicParas["realPay"].ToString() : string.Empty;
            string scheduleId   = dicParas.ContainsKey("scheduleId") ? dicParas["scheduleId"].ToString() : string.Empty;
            string workStation  = dicParas.ContainsKey("workStation") ? dicParas["workStation"].ToString() : string.Empty;
            string authorId     = dicParas.ContainsKey("authorId") ? dicParas["authorId"].ToString() : string.Empty;
            string note         = dicParas.ContainsKey("note") ? dicParas["note"].ToString() : string.Empty;
            string orderSource  = dicParas.ContainsKey("orderSource") ? dicParas["orderSource"].ToString() : string.Empty;
            string saleCoinType = dicParas.ContainsKey("saleCoinType") ? dicParas["saleCoinType"].ToString() : string.Empty;

            if (!XCCloudStoreBusiness.IsEffectiveStore(storeId))
            {
                errMsg = "门店无效";
                return(false);
            }

            if (!Utils.IsDecimal(payCount))
            {
                errMsg = "应付金额无效";
                return(false);
            }

            if (!Utils.IsDecimal(realPay))
            {
                errMsg = "实付金额无效";
                return(false);
            }

            if (!Utils.IsDecimal(freePay))
            {
                errMsg = "减免金额无效";
                return(false);
            }

            if (!Utils.isNumber(scheduleId))
            {
                errMsg = "班次Id不正确";
                return(false);
            }

            if (string.IsNullOrEmpty(workStation))
            {
                errMsg = "工作站无效";
                return(false);
            }

            if (!Utils.IsNumeric(authorId))
            {
                errMsg = "授权员工Id无效";
                return(false);
            }

            if (string.IsNullOrEmpty(orderSource))
            {
                errMsg = "订单来源无效";
                return(false);
            }

            string orderSourceDefineStr = "0,1,2,3,4";

            string[] orderSourceArr = orderSource.Split(',');
            for (int i = 0; i < orderSourceArr.Length; i++)
            {
                if (!Utils.IsNumeric(orderSourceArr[i]))
                {
                    errMsg = "订单来源无效";
                    return(false);
                }

                if (!orderSourceDefineStr.Contains(orderSourceArr[i]))
                {
                    errMsg = "订单来源无效";
                    return(false);
                }
            }

            //:1电子币、2实物币手工、3、实物币售币机
            string saleCoinTypeStr = "1,2,3";

            string[] saleCoinTypeArr = saleCoinTypeStr.Split(',');
            for (int i = 0; i < saleCoinTypeArr.Length; i++)
            {
                if (!Utils.IsNumeric(saleCoinTypeArr[i]))
                {
                    errMsg = "售币类型无效";
                    return(false);
                }

                if (!saleCoinTypeStr.Contains(saleCoinTypeArr[i]))
                {
                    errMsg = "售币类型无效";
                    return(false);
                }
            }

            return(true);
        }