Beispiel #1
0
        /// <summary>
        /// 开激活凭条
        /// </summary>
        /// <param name="storeinfo"></param>
        public static void PrintMemberNewCard(TMemberStoredInfo storeinfo)
        {
            try
            {
                string file = Application.StartupPath + @"\Reports\rptMember_NewCard.frx";
                rptReport.Load(file);//加载报表模板文件
                AddedtValue(ref rptReport, "edtbilltype", "------商户联------");
                AddedtValue(ref rptReport, "edtcardno", storeinfo.Cardno);
                AddedtValue(ref rptReport, "edtreport_membertitle", storeinfo.Treport_membertitle);
                AddedtValue(ref rptReport, "edtpzh", storeinfo.Pzh);
                AddedtValue(ref rptReport, "edtdate", storeinfo.Date);
                AddedtValue(ref rptReport, "edttime", storeinfo.Time);
                AddedtValue(ref rptReport, "edtstore", "0.00");
                AddedtValue(ref rptReport, "edtpoint", "0.00");

                PrintRpt(rptReport, 1);
                Application.DoEvents();
                AddedtValue(ref rptReport, "edtbilltype", "------客户联------");
                PrintRpt(rptReport, 1);
            }
            catch { }
        }
Beispiel #2
0
        private void button27_Click(object sender, EventArgs e)
        {
            try
            {
                try
                {
                    if (edtCardNo.Text.Length < 10)
                    {
                        Warning("请输入正确的会员卡号!");
                        edtCardNo.Focus();
                        edtCardNo.SelectAll();
                        edtCurr = edtCardNo;
                        return;
                    }

                    /*if (edtPwd.Text.Length < 3)
                     * {
                     *  Warning("请输入正确密码!");
                     *  edtPwd.Focus();
                     *  edtPwd.SelectAll();
                     *  edtCurr = edtPwd;
                     *  return;
                     * }*/
                    if (edtMobile.Text.Length < 11)
                    {
                        Warning("请输入正确的手机号!");
                        edtMobile.Focus();
                        edtMobile.SelectAll();
                        edtCurr = edtMobile;
                        return;
                    }
                    if (!frmAskQuestion.AskQuestion("确定激活吗?"))
                    {
                        return;
                    }

                    this.Cursor      = Cursors.WaitCursor;
                    button27.Enabled = false;
                    DateTime date      = DateTime.Now;
                    string   pszSerial = edtMobile.Text.Trim().ToString();
                    json = (JObject)WebServiceReference.RestClient.CardActive(edtCardNo.Text.Trim().ToString(), edtPwd.Text.Trim().ToString(), pszSerial);
                    string data = json["Data"].ToString();

                    String mmtext = "";
                    if (data == "0")
                    {
                        Warning(json["Info"].ToString());
                        edtCardNo.Focus();
                        edtCardNo.SelectAll();
                        return;
                    }
                    else
                    {
                        //打印交易凭条
                        TMemberStoredInfo memberstoreinfo = new TMemberStoredInfo();
                        memberstoreinfo.Cardno = edtCardNo.Text;
                        memberstoreinfo.Treport_membertitle = WebServiceReference.WebServiceReference.Report_membertitle;
                        date = DateTime.Now;
                        memberstoreinfo.Pzh = string.Format("{0:yyyyMMddHHmmssffff}", date);
                        string datestr = string.Format("{0:yyyy-MM-dd}", date);
                        memberstoreinfo.Date = datestr;
                        datestr = string.Format("{0:hh:mm}", date);
                        memberstoreinfo.Time  = datestr;
                        memberstoreinfo.Store = "0.00";
                        memberstoreinfo.Point = "0.00";
                        try
                        {
                            ReportsFastReport.ReportPrint.PrintMemberNewCard(memberstoreinfo);
                        }
                        catch { }
                        Warning(json["Info"].ToString());
                        return;
                    }
                }
                catch (Exception ex)
                {
                    Warning(ex.Message);
                    return;
                }
            }
            finally
            { this.Cursor = Cursors.Default; button27.Enabled = true; }
        }
Beispiel #3
0
        private void button27_Click(object sender, EventArgs e)
        {
            if (!checkInput())
            {
                return;
            }
            try
            {
                this.Cursor = Cursors.WaitCursor;
                if (rgpPayType.SelectedIndex < 0)
                {
                    Warning("请选择收款方式!");
                    return;
                }
                if (edtAmount.Text.Trim().Length <= 0)
                {
                    Warning("请输入储值金额!");
                    edtAmount.Focus();
                    edtAmount.SelectAll();
                    edtCurr = edtAmount;
                    return;
                }
                if (float.Parse(edtAmount.Text) <= 0)
                {
                    Warning("请输入正确的金额!");
                    edtAmount.Focus();
                    edtCurr = edtAmount;
                    edtAmount.SelectAll();
                    return;
                }
                if (!AskQuestion("确定储值 " + edtAmount.Text + " 吗?"))
                {
                    return;
                }

                lblAmount.Text = "卡余额:";
                String mmtext = "";
                TCandaoRet_StoreCardDeposit ret = CanDaoMemberClient.StoreCardDeposit(Globals.branch_id, "", _memberInfo.Cardno, Globals.branch_id, decimal.Parse(edtAmount.Text), 0, rgpPayType.SelectedIndex);
                if (!ret.Ret)
                {
                    Warning(ret.Retinfo);
                    return;
                }
                else
                {
                    lblAmount.Text = "卡余额:" + ret.StoreCardbalance.ToString();
                    edtAmount.Text = "";
                    edtAmount.Focus();
                    //打印交易凭条
                    try
                    {
                        TMemberStoredInfo memberstoreinfo = new TMemberStoredInfo();
                        memberstoreinfo.Cardno = _memberInfo.Cardno;
                        memberstoreinfo.Treport_membertitle = WebServiceReference.WebServiceReference.Report_membertitle;
                        memberstoreinfo.Pzh = ret.Tracecode;
                        DateTime date = DateTime.Now;
                        date = DateTime.Now;
                        string datestr = string.Format("{0:yyyy-MM-dd}", date);
                        memberstoreinfo.Date = datestr;
                        datestr = string.Format("{0:hh:mm}", date);
                        memberstoreinfo.Time   = datestr;
                        memberstoreinfo.Store  = ret.StoreCardbalance.ToString();
                        memberstoreinfo.Point  = "0";// ret.Integral.ToString();//ret.Giftamount.ToString();
                        memberstoreinfo.Amount = edtAmount.Text;
                        ReportsFastReport.ReportPrint.PrintMemberStore(memberstoreinfo);
                    }
                    catch { }
                    Warning("储值成功,交易流水号:" + ret.Tracecode);
                    return;
                }
            }
            finally { this.Cursor = Cursors.Default; }
        }
Beispiel #4
0
        private void button27_Click(object sender, EventArgs e)
        {
            try
            {
                try
                {
                    if (rgpPayType.SelectedIndex < 0)
                    {
                        Warning("请选择收款方式!");
                        return;
                    }
                    if (edtAmount.Text.Trim().Length <= 0)
                    {
                        Warning("请输入储值金额!");
                        edtAmount.Focus();
                        edtAmount.SelectAll();
                        edtCurr = edtAmount;
                        return;
                    }
                    if (float.Parse(edtAmount.Text) <= 0)
                    {
                        Warning("请输入正确的金额!");
                        edtAmount.Focus();
                        edtCurr = edtAmount;
                        edtAmount.SelectAll();
                        return;
                    }
                    if (!AskQuestion("确定储值 " + edtAmount.Text + " 吗?"))
                    {
                        return;
                    }
                    this.Cursor      = Cursors.WaitCursor;
                    button27.Enabled = false;
                    DateTime date      = DateTime.Now;
                    string   pszSerial = string.Format("{0:yyyyMMddHHmmssffff}", date);
                    int      paytype   = 0;
                    if (rgpPayType.SelectedIndex == 1)
                    {
                        paytype = 1;
                    }
                    json = (JObject)WebServiceReference.RestClient.StoreCardDeposit(edtRoom.Text.Trim().ToString(), float.Parse(edtAmount.Text), pszSerial, paytype);
                    string data = json["Data"].ToString();
                    lblAmount.Text = "卡余额:";
                    String mmtext = "";
                    if (data == "0")
                    {
                        Warning(json["Info"].ToString());
                        return;
                    }
                    else
                    {
                        JObject           jsonQuery       = null;
                        TMemberStoredInfo memberstoreinfo = new TMemberStoredInfo();
                        memberstoreinfo.Cardno = json["pszPan"].ToString();
                        memberstoreinfo.Treport_membertitle = WebServiceReference.WebServiceReference.Report_membertitle;
                        memberstoreinfo.Pzh = json["pszTrace"].ToString();
                        date = DateTime.Now;
                        string datestr = string.Format("{0:yyyy-MM-dd}", date);
                        memberstoreinfo.Date = datestr;
                        datestr = string.Format("{0:hh:mm}", date);
                        memberstoreinfo.Time = datestr;
                        try
                        {
                            jsonQuery = (JObject)WebServiceReference.RestClient.QueryBalance(edtRoom.Text.Trim().ToString());
                            //json = (JObject)WebServiceReference.RestClient.QueryBalance(edtMemberCard.Text.Trim().ToString());

                            memberstoreinfo.Store  = (decimal.Parse(json["psStoreCardBalance"].ToString()) / 100).ToString();
                            memberstoreinfo.Point  = (decimal.Parse(jsonQuery["psIntegralOverall"].ToString()) / 100).ToString();
                            memberstoreinfo.Amount = edtAmount.Text;
                        }
                        catch (Exception ex)
                        {
                            try
                            {
                                jsonQuery = (JObject)WebServiceReference.RestClient.QueryBalance(edtRoom.Text.Trim().ToString());
                                //json = (JObject)WebServiceReference.RestClient.QueryBalance(edtMemberCard.Text.Trim().ToString());

                                memberstoreinfo.Store  = (decimal.Parse(json["psStoreCardBalance"].ToString()) / 100).ToString();
                                memberstoreinfo.Point  = (decimal.Parse(jsonQuery["psIntegralOverall"].ToString()) / 100).ToString();
                                memberstoreinfo.Amount = edtAmount.Text;
                            }
                            catch (Exception ex3)
                            {
                                try
                                {
                                    jsonQuery = (JObject)WebServiceReference.RestClient.QueryBalance(edtRoom.Text.Trim().ToString());
                                    //json = (JObject)WebServiceReference.RestClient.QueryBalance(edtMemberCard.Text.Trim().ToString());

                                    memberstoreinfo.Store  = (decimal.Parse(json["psStoreCardBalance"].ToString()) / 100).ToString();
                                    memberstoreinfo.Point  = (decimal.Parse(jsonQuery["psIntegralOverall"].ToString()) / 100).ToString();
                                    memberstoreinfo.Amount = edtAmount.Text;
                                }
                                catch (Exception ex2)
                                {
                                    Warning(ex2.Message);
                                    return;
                                }
                            }
                        }

                        //打印交易凭条
                        try
                        {
                            ReportsFastReport.ReportPrint.PrintMemberStore(memberstoreinfo);
                        }
                        catch {  }
                        lblAmount.Text = "卡余额:" + (float.Parse(json["psStoreCardBalance"].ToString()) / 100.00).ToString();
                        edtAmount.Text = "";
                        edtAmount.Focus();
                        Warning("储值成功,交易流水号:" + json["pszTrace"].ToString());
                        return;
                    }
                }
                catch (Exception ex)
                {
                    Msg.Warning(ex.Message);
                    return;
                }
            }
            finally
            { this.Cursor = Cursors.Default; button27.Enabled = true; }
        }