private bool RestoreTagNumber()
        {
            int id = sol_Agency.AgencyID;

            if (id < 1)
            {
                return(false);
            }

            if (sol_AutoNumber_Sp == null)
            {
                sol_AutoNumber_Sp = new Sol_AutoNumber_Sp(Properties.Settings.Default.WsirDbConnectionString);
            }

            Sol_AutoNumber sol_AutoNumber = sol_AutoNumber_Sp.Select(id, 1);
            int            tagNumber      = 0;

            int.TryParse(sol_Stage.TagNumber, out tagNumber);
            if (sol_AutoNumber.TagNumber == tagNumber)
            {
                sol_AutoNumber.TagNumber--;
                sol_AutoNumber_Sp.Update(sol_AutoNumber);
            }

            return(true);
        }
Example #2
0
        private void ReadAutoGeneratedNumbers()
        {
            intValue = 0;
            int.TryParse(agencyIDTextBox.Text, out intValue);

            sol_AutoNumber_Sp = new Sol_AutoNumber_Sp(Properties.Settings.Default.WsirDbConnectionString);
            sol_AutoNumber    = sol_AutoNumber_Sp.Select(intValue, 1);
            if (sol_AutoNumber == null)
            {
                sol_AutoNumber             = new Sol_AutoNumber();
                sol_AutoNumber.AgencyID    = intValue;
                sol_AutoNumber.FolioID     = 1;
                sol_AutoNumber.TagNumber   = 0;
                sol_AutoNumber.RBillNumber = 0;
                sol_AutoNumber_Sp.Insert(sol_AutoNumber);
            }

            //checkBoxAutoTagNumber.Checked = Main.Sol_ControlInfo.AutoGenerateTagNumber;
            textBoxTagNumber.Text = sol_AutoNumber.TagNumber.ToString();

            //checkBoxAutoRBillNumber.Checked = Main.Sol_ControlInfo.AutoGenerateRBillNumber;
            textBoxRBillNumber.Text = sol_AutoNumber.RBillNumber.ToString();
        }