Esempio n. 1
0
        //btnAdd_Click
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (txbCard.Text.Trim() == "")
                {
                    tblNotification.Text = FindResource("card_null").ToString();
                    return;
                }

                EC_tb_Payment ec_payment = new EC_tb_Payment();
                //ec_payment.PaymentID = bus_payment.GetMaxPaymentID("") + 1;
                ec_payment.Card = txbCard.Text.Trim();

                if (bus_payment.InsertPayment(ec_payment, StaticClass.GeneralClass.flag_database_type_general) == 1)
                {
                    if (add_delegate != null)
                    {
                        add_delegate();
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                tblNotification.Text = ex.Message;
            }
        }
Esempio n. 2
0
        //InSertAllPayment
        private int InSertAllPayment(DataTable tb_payment)
        {
            int result = 0;

            foreach (DataRow datarow in tb_payment.Rows)
            {
                if (datarow[0].ToString() != "")
                {
                    EC_tb_Payment ec_tb_payment = new EC_tb_Payment();
                    ec_tb_payment.PaymentID = Convert.ToInt32(datarow[0].ToString());
                    ec_tb_payment.Card      = StaticClass.GeneralClass.HandlingSpecialCharacter(datarow[1].ToString());

                    if (bus_tb_payment.InsertPayment(ec_tb_payment, StaticClass.GeneralClass.flag_database_type_general) == 1)
                    {
                        result++;
                    }
                }
            }
            return(result);
        }