Esempio n. 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                GTSAppSettings.FromDate   = startTimeTB.Text;
                GTSAppSettings.PTableName = ptableTB.Text;

                string        sql = String.Format(@"insert into TA_Calculation_Flag_Persons 
                                        select Prc_PCode ,'{0}'  from {1} group by Prc_PCode", startTimeTB.Text, ptableTB.Text);
                QueryExecuter exe = new QueryExecuter(null);
                exe.RunQuery(sql, GTSAppSettings.SQLConnection);

                DataSet.DBDataSetTableAdapters.TA_Calculation_Flag_PersonsTableAdapter cfpTA = new DataSet.DBDataSetTableAdapters.TA_Calculation_Flag_PersonsTableAdapter();
                DBDataSet.TA_Calculation_Flag_PersonsDataTable cfpTable = new DBDataSet.TA_Calculation_Flag_PersonsDataTable();
                cfpTA.Connection = GTSAppSettings.SQLConnection;
                cfpTA.Fill(cfpTable);
                int cfpCount = cfpTable.Rows.Count;

                MessageBox.Show(String.Format("تعداد {0} درج شد", cfpCount.ToString()));
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                cfpTA.Connection = GTSAppSettings.SQLConnection;
                cfpTA.Fill(cfpTable);
                cfpCount = cfpTable.Rows.Count;

                GTSAppSettings.ToDate = endtimeTB.Text;
                GTSAppSettings.SaveToFile();

                this.Cursor  = Cursors.WaitCursor;
                this.Enabled = false;


                if (cfpCount == 0)
                {
                    MessageBox.Show("CFP Table is Empty!");
                }
                else
                {
                    toolStripStatusLabel2.Text = "محاسبه";
                    WaitNow(Calculate, "Initilizing....");
                    toolStripStatusLabel2.Text = "مقایسه";
                    Compaire();
                    toolStripStatusLabel2.Text = "اتمام";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                this.Enabled = true;
                this.Cursor  = Cursors.Default;
            }
        }