Ejemplo n.º 1
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            try
            {
                LoadOperationNumber();
                UpdateOperation(m_TicketID);
                UpdateOperationNumber();
                UpdateTicketStatus(m_TicketID);

                MessageBox.Show(this, "赎当成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);

                this.btnPrint.Enabled = false;
            }
            catch
            {
                MessageBox.Show(this, "操作失败,请检查数据库是否连接正确!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            try
            {
                DDPrintParam newParam = new DDPrintParam("PrintOption", 5);
                if (newParam.OptionValue == 1)
                {
                    PrintReceipt();
                }
            }
            catch
            {
                MessageBox.Show("数据库更新成功,打印失败", "提示信息");
            }

            LoadOperationNumber();
            this.Close();
        }
Ejemplo n.º 2
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            using (TransactionScope Scope = new TransactionScope())
            {
                try
                {
                    LoadOperationNumber();
                    UpdateOperation(m_TicketID);
                    UpdateOperationNumber();
                    UpdateTicketStatus(m_TicketID);

                    DDPrintParam newParam = new DDPrintParam("PrintOption", 5);
                    if (newParam.OptionValue == 1)
                    {
                        PrintReceipt();
                    }
                    LoadOperationNumber();
                    this.btnPrint.Enabled = false;
                    Scope.Complete();
                    MessageBox.Show(this, "赎当成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                catch
                {
                    Scope.Dispose();
                    MessageBox.Show(this, "操作失败,请检查数据库是否连接正确!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
        }
Ejemplo n.º 3
0
        public void Insert(string OptionName, int?OptionValue)
        {
            DDPrintParam item = new DDPrintParam();

            item.OptionName = OptionName;

            item.OptionValue = OptionValue;


            item.Save(UserName);
        }
Ejemplo n.º 4
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DialogResult res = CheckAllData();

            if (res != DialogResult.OK)
            {
                return;
            }

            using (TransactionScope Scope = new TransactionScope())
            {
                try
                {
                    LoadOperationNumber();
                    UpdateOperation();
                    UpdateOperationNumber();
                    this.btnPrint.Enabled = false;

                    DDPrintParam newParam = new DDPrintParam("PrintOption", 3);
                    if (newParam.OptionValue == 1)
                    {
                        PrintPawnTicket();
                    }

                    newParam = new DDPrintParam("PrintOption", 4);
                    if (newParam.OptionValue == 1)
                    {
                        PrintReceipt();
                    }
                    LoadOperationNumber();
                    this.btnPrint.Enabled = false;

                    Scope.Complete();
                    //MessageBox.Show(this, "续当成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.isOperationSuccess = true;
                }
                catch
                {
                    Scope.Dispose();
                    //MessageBox.Show(this, "续当操作失败,请检查数据库是否连接正确!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.isOperationSuccess = false;
                }
            }

            if (this.isOperationSuccess == true)
            {
                this.isOperationSuccess = false;
                MessageBox.Show(this, "续当成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show(this, "续当操作失败,请检查数据库是否连接正确!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 5
0
        public void Update(int PrintOption, string OptionName, int?OptionValue)
        {
            DDPrintParam item = new DDPrintParam();

            item.MarkOld();
            item.IsLoaded = true;

            item.PrintOption = PrintOption;

            item.OptionName = OptionName;

            item.OptionValue = OptionValue;

            item.Save(UserName);
        }
Ejemplo n.º 6
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DialogResult res = CheckAllData();

            if (res != DialogResult.OK)
            {
                return;
            }

            try
            {
                LoadOperationNumber();
                UpdateOperation();
                UpdateOperationNumber();
                this.btnPrint.Enabled = false;
                MessageBox.Show(this, "续当成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch
            {
                MessageBox.Show(this, "续当操作失败,请检查数据库是否连接正确!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            try
            {
                DDPrintParam newParam = new DDPrintParam("PrintOption", 3);
                if (newParam.OptionValue == 1)
                {
                    PrintPawnTicket();
                }

                newParam = new DDPrintParam("PrintOption", 4);
                if (newParam.OptionValue == 1)
                {
                    PrintReceipt();
                }
            }
            catch
            {
                MessageBox.Show("数据库更新成功,打印失败", "提示信息");
            }



            this.btnPrint.Enabled = false;
            LoadOperationNumber();
            this.Close();
        }
Ejemplo n.º 7
0
 private void btnPrint_Click(object sender, EventArgs e)
 {
     try
     {
         UpdateOperation(m_TicketID);
         UpdateOperationNumber();
         UpdateTicketStatus(m_TicketID);
         DDPrintParam newParam = new DDPrintParam("PrintOption", 5);
         if (newParam.OptionValue == 1)
         {
             PrintReceipt();
         }
         else
         {
             MessageBox.Show(this, "赎当成功!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch
     {
         MessageBox.Show(this, "操作失败,请检查数据库是否连接正确!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 8
0
 public bool Destroy(object PrintOption)
 {
     return(DDPrintParam.Destroy(PrintOption) == 1);
 }
Ejemplo n.º 9
0
 public bool Delete(object PrintOption)
 {
     return(DDPrintParam.Delete(PrintOption) == 1);
 }