Exemple #1
0
        /// <summary>
        /// 处理收银员对账信息
        /// </summary>
        /// <param name="isWorkInvoke"></param>
        void DealerVip(bool isWorkInvoke)
        {
            DataTable tableAcc     = null;
            bool      isok         = true;
            string    errorMessage = string.Empty;

            try
            {
                tableAcc = UploadInfoBLL.Instance.GetUploadVip(GlobalSet.dbsaleconn);
                if (tableAcc != null && tableAcc.Rows.Count > 0)
                {
                    foreach (DataRow dr in tableAcc.Rows)
                    {
                        if (isWorkInvoke)
                        {
                            if (isWork == false)
                            {
                                break;
                            }
                        }
                        StringBuilder sb  = new StringBuilder();
                        t_app_viplist vip = new t_app_viplist();
                        vip.flow_no     = ExtendUtility.Instance.ParseToString(dr["flow_no"]);
                        vip.card_no     = ExtendUtility.Instance.ParseToString(dr["card_no"]);
                        vip.score       = ExtendUtility.Instance.ParseToDecimal(dr["score"]);
                        vip.sale_amt    = ExtendUtility.Instance.ParseToDecimal(dr["sale_amt"]);
                        vip.voucher_no  = ExtendUtility.Instance.ParseToString(dr["voucher_no"]);
                        vip.card_score  = ExtendUtility.Instance.ParseToDecimal(dr["card_score"]);
                        vip.card_amount = ExtendUtility.Instance.ParseToDecimal(dr["card_amount"]);
                        vip.oper_date   = ExtendUtility.Instance.ParseToString(dr["oper_date"]);
                        List <t_app_viplist> acList = new List <t_app_viplist>();
                        acList.Add(vip);
                        string ac = JsonUtility.Instance.ObjectToJson <t_app_viplist>(acList);
                        Dictionary <string, object> _dic = new Dictionary <string, object>();
                        _dic.Add("username", "");
                        _dic.Add("password", "");
                        _dic.Add("client_id", GlobalSet.client_id);
                        _dic.Add("access_token", GlobalSet.access_token);
                        _dic.Add("vip", ac);
                        string json = PServiceProvider.Instance.InvokeMethod(GlobalSet.serverUrl + "/" + "Addvip", _dic, ref isok, ref errorMessage);
                        if (isok)
                        {
                            if (json != "-10" && json != "-20")
                            {
                                int result = ExtendUtility.Instance.ParseToInt32(json);
                                if (result == 1)
                                {
                                    UploadInfoBLL.Instance.UpdateVipFlag(GlobalSet.dbsaleconn, vip.flow_no, vip.card_no);
                                    sb.Append("流水号:" + vip.flow_no);
                                    sb.Append("会员卡:" + vip.card_no);
                                    sb.Append(" 会员消费上传成功");
                                    LoggerHelper.Log("MsmkLogger", sb.ToString(), LogEnum.TransferLog);
                                }
                                else
                                {
                                    sb.Append("流水号:" + vip.flow_no);
                                    sb.Append("会员卡:" + vip.card_no);
                                    sb.Append(" 会员消费上传失败" + "Error:" + errorMessage);
                                    LoggerHelper.Log("MsmkLogger", sb.ToString(), LogEnum.TransferLog);
                                }
                            }
                            else
                            {
                                if (json == "-10")
                                {
                                    sb.AppendLine("流水号:" + dr[0].ToString() + "Error:参数错误");
                                    LoggerHelper.Log("MsmkLogger", sb.ToString(), LogEnum.TransferLog);
                                }
                                else
                                {
                                    sb.AppendLine("流水号:" + dr[0].ToString() + "Error:权限不足");
                                    LoggerHelper.Log("MsmkLogger", sb.ToString(), LogEnum.TransferLog);
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Exemple #2
0
 /// <summary>
 /// 新增会员本地积分记录
 /// </summary>
 /// <param name="vipinfo">会员支付记录</param>
 /// <returns></returns>
 public bool AddVipflow(t_app_viplist vipinfo)
 {
     return(this._dal.AddVipflow(vipinfo));
 }