Esempio n. 1
0
        //确定
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (cardId.Text == "" || money.Text == "" || money.Text == "0")
            {
                GeneralClass.printErrorMsg("需要输入必填信息");
                return;
            }

            if (name.Text == "")
            {
                GeneralClass.printErrorMsg("不存在此会员卡");
                return;
            }

            CardCharge cc = new CardCharge();
            cc.CC_CardNo = cardId.Text;
            //cc.CC_AccountNo = account.id.ToString();
            cc.CC_ItemExplain = "会员扣卡";
            cc.CC_LenderSum = Convert.ToDouble(money.Text);
            //cc.expense = account_money;
            cc.CC_InputOperator = LogIn.m_User.id.ToString();
            cc.CC_InputDate = DateTime.Now;
            db.CardCharge.InsertOnSubmit(cc);

            //Deducted deduct = new Deducted();
            //deduct.memberId = cardId.Text;
            //deduct.money = Convert.ToDouble(money.Text);
            //deduct.date = BathClass.Now(LogIn.connectionString);
            //deduct.processed = false;

            //db.Deducted.InsertOnSubmit(deduct);
            db.SubmitChanges();
            this.DialogResult = DialogResult.OK;
        }
Esempio n. 2
0
        //确定
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (btnOk.Text == "读卡")
                get_member();
            else if (btnOk.Text == "充值" && money.Text != "")
            {
                CardCharge cardCharge = new CardCharge();

                cardCharge.CC_CardNo = m_member.CI_CardNo;
                cardCharge.CC_DebitSum = Convert.ToDouble(money.Text);
                cardCharge.CC_ItemExplain = "会员卡充值-收";
                cardCharge.CC_InputOperator = LogIn.m_User.id.ToString();
                cardCharge.CC_InputDate = GeneralClass.Now;
                cardCharge.systemId = m_Seat.systemId;
                db.CardCharge.InsertOnSubmit(cardCharge);

                int sale_money = find_card_sale();
                if (sale_money != 0)
                {
                    CardCharge cardChargeSale = new CardCharge();
                    cardChargeSale.CC_CardNo = m_member.CI_CardNo;
                    cardChargeSale.CC_ItemExplain = "优惠送";
                    cardChargeSale.CC_DebitSum = sale_money;
                    cardChargeSale.CC_LenderSum = 0;
                    cardChargeSale.CC_InputOperator = LogIn.m_User.id.ToString();
                    cardChargeSale.CC_InputDate = GeneralClass.Now;
                    cardChargeSale.systemId = m_Seat.systemId;
                    db.CardCharge.InsertOnSubmit(cardChargeSale);

                    BathClass.printInformation("送" + sale_money + "元");
                }

                //var menu = db.Menu.FirstOrDefault(x => x.name == type.Text+"充值");
                Orders order = new Orders();
                order.menu = "储值卡充值";
                order.text = m_Seat.text;
                order.systemId = m_Seat.systemId;
                order.number = 1;
                order.inputTime = BathClass.Now(LogIn.connectionString);
                order.inputEmployee = LogIn.m_User.id.ToString();
                order.paid = false;
                order.money = Convert.ToDouble(money.Text);
                db.Orders.InsertOnSubmit(order);

                db.SubmitChanges();
                this.DialogResult = DialogResult.OK;
            }
        }
Esempio n. 3
0
        //确定
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (db.CardInfo.FirstOrDefault(x => x.CI_CardNo == id.Text) != null)
            {
                BathClass.printErrorMsg("已经发行卡号为" + id.Text + "的卡");
                return;
            }

            bool st = false;
            var ct = db.MemberSetting.FirstOrDefault().cardType;
            if (ct == "SLE4442")
                st = ICCard.destribute_card_4442(company_code, id.Text);
            else if (ct == "M1")
                st = ICCard.destribute_card_M1(company_code, id.Text);
            else if (ct == "CT")
                st = true;
            if (!st)
                return;

            CardInfo m_Element = new CardInfo();
            m_Element.CI_CardNo = id.Text;
            m_Element.CI_CardTypeNo = db.MemberType.FirstOrDefault(x => x.name == memberType.Text).id;
            m_Element.state = "入库";
            db.CardInfo.InsertOnSubmit(m_Element);

            CardCharge cardCharge = new CardCharge();
            cardCharge.CC_CardNo = m_Element.CI_CardNo;
            cardCharge.CC_ItemExplain = "售卡收";
            if (money.Text != "")
                cardCharge.CC_DebitSum = Convert.ToDouble(money.Text);
            cardCharge.CC_LenderSum = 0;
            cardCharge.CC_InputOperator = LogIn.m_User.id.ToString();
            cardCharge.CC_InputDate = DateTime.Now;
            db.CardCharge.InsertOnSubmit(cardCharge);

            //if (money.Text != "")
            //{
            //    int sale_money = find_card_sale();
            //    if (sale_money != 0)
            //    {
            //        //CardCharge cardChargeSale = new CardCharge();
            //        //cardChargeSale.CC_CardNo = m_Element.CI_CardNo;
            //        //cardChargeSale.CC_ItemExplain = "优惠送";
            //        //cardChargeSale.CC_DebitSum = sale_money;
            //        //cardChargeSale.CC_LenderSum = 0;
            //        //cardChargeSale.CC_InputOperator = LogIn.m_User.id.ToString();
            //        //cardChargeSale.CC_InputDate = GeneralClass.Now;
            //        //cardChargeSale.systemId = m_Seat.systemId;
            //        //db.CardCharge.InsertOnSubmit(cardChargeSale);

            //        BathClass.printInformation("送" + sale_money + "元");
            //    }

            //    //CardSale cardSale = new CardSale();
            //    //cardSale.memberId = m_Element.CI_CardNo;
            //    //cardSale.balance = 0;
            //    //if (payType.Text == "现金")
            //        //cardSale.cash = Convert.ToDouble(money.Text);
            //    //else if (payType.Text == "银联")
            //        //cardSale.bankUnion = Convert.ToDouble(money.Text);

            //    //cardSale.payTime = GeneralClass.Now;
            //    //cardSale.payEmployee = LogIn.m_User.id.ToString();
            //    //cardSale.macAddress = PCUtil.getMacAddr_Local();
            //    //db.CardSale.InsertOnSubmit(cardSale);

            //    //var menu = db.Menu.FirstOrDefault(x => x.name == memberType.Text);
            //    //Orders order = new Orders();
            //    //order.menu = menu.name;
            //    //order.text = m_Seat.text;
            //    //order.systemId = m_Seat.systemId;
            //    //order.number = 1;
            //    //order.inputTime = BathClass.Now(LogIn.connectionString);
            //    //order.inputEmployee = LogIn.m_User.id.ToString();
            //    //order.paid = false;

            //    //if (money.Text == "")
            //    //    order.money = menu.price;
            //    //else
            //    //order.money = Convert.ToDouble(money.Text);

            //    //db.Orders.InsertOnSubmit(order);
            //}

            db.SubmitChanges();
            //this.DialogResult = DialogResult.OK;

            id.Text = "";
            money.Text = "";
        }
Esempio n. 4
0
        //插入会员消费记录
        private void insert_member_infor()
        {
            double account_money = BathClass.get_account_money(account);
            if (m_promotion_Member != null)
            {
                CardCharge cc = new CardCharge();
                cc.CC_CardNo = m_promotion_Member.CI_CardNo;
                cc.CC_AccountNo = account.id.ToString();
                cc.CC_ItemExplain = "会员打折";
                cc.expense = account_money;
                cc.CC_InputOperator = LogIn.m_User.id.ToString();
                cc.CC_InputDate = GeneralClass.Now;
                db.CardCharge.InsertOnSubmit(cc);
                send_sms(m_promotion_Member.CI_CardNo);
            }

            if (m_Member_List != null)
            {
                foreach (string cardNo in m_Member_List.Keys)
                {
                    CardCharge cc = new CardCharge();
                    cc.CC_CardNo = cardNo;
                    cc.CC_AccountNo = account.id.ToString();
                    cc.CC_ItemExplain = "会员刷卡";
                    cc.CC_LenderSum = m_Member_List[cardNo];
                    cc.expense = account_money;
                    cc.CC_InputOperator = LogIn.m_User.id.ToString();
                    cc.CC_InputDate = GeneralClass.Now;
                    db.CardCharge.InsertOnSubmit(cc);
                    send_sms(cardNo);
                }
                //db.SubmitChanges();
            }
            //db.SubmitChanges();
        }
Esempio n. 5
0
        //插入会员消费记录
        private void insert_member_infor(Account account)
        {
            double account_money = BathClass.get_account_money(account);
            if (m_promotion_Member != null)
            {
                CardCharge cc = new CardCharge();
                cc.CC_CardNo = m_promotion_Member.CI_CardNo;
                cc.CC_AccountNo = account.id.ToString();
                cc.CC_ItemExplain = "会员打折";
                cc.expense = account_money;
                cc.CC_InputOperator = LogIn.m_User.id.ToString();
                cc.CC_InputDate = DateTime.Now;
                db.CardCharge.InsertOnSubmit(cc);
            }

            if (m_Member != null)
            {
                CardCharge cc = new CardCharge();
                cc.CC_CardNo = m_Member.CI_CardNo;
                cc.CC_AccountNo = account.id.ToString();
                cc.CC_ItemExplain = "会员刷卡";
                cc.CC_LenderSum = account.creditCard;
                cc.expense = account_money;
                cc.CC_InputOperator = LogIn.m_User.id.ToString();
                cc.CC_InputDate = DateTime.Now;
                db.CardCharge.InsertOnSubmit(cc);
                db.SubmitChanges();
            }
            //db.SubmitChanges();
        }
Esempio n. 6
0
 partial void DeleteCardCharge(CardCharge instance);
Esempio n. 7
0
 partial void UpdateCardCharge(CardCharge instance);
Esempio n. 8
0
 partial void InsertCardCharge(CardCharge instance);