Example #1
0
        /// <summary>
        /// delete CFP
        /// Insert CFP
        /// Calculate
        /// </summary>

        public void GTSCalculate(string barcode, decimal PrsId, string fromdate, string todate)
        {
            try
            {
                string pTableName1 = GetPtableFromDate(fromdate);
                string pTableName2 = GetPtableFromDate(todate);
                barcode = barcode.PadLeft(8, '0');
                DeletePTable(barcode, pTableName1);
                DeletePTable(barcode, pTableName2);
                DataSet.DBDataSetTableAdapters.TA_Calculation_Flag_PersonsTableAdapter cfpTA = new DataSet.DBDataSetTableAdapters.TA_Calculation_Flag_PersonsTableAdapter();
                cfpTA.Connection = GTSAppSettings.SQLConnection;
                //cfpTA.DeleteCFP(PrsId);
                cfpTA.UpdateCFP(Utility.ToMildiDate(fromdate), PrsId);
                string MiladifromDate = Utility.ToString(Utility.ToMildiDate(fromdate));
                //cfpTA.InsertCFP(PrsId, new DateTime(int.Parse(MiladifromDate.Split('/')[0]), int.Parse(MiladifromDate.Split('/')[1]), int.Parse(MiladifromDate.Split('/')[2])));
                ServiceReference1.TotalWebServiceClient total = new GTS.Clock.AppSetup.ServiceReference1.TotalWebServiceClient("BasicHttpBinding_ITotalWebService", GTSAppSettings.WebServiceAddress);
                if (GTSAppSettings.ClockCalculation)
                {
                    //total.Clock_FillByPersonBarCodeAndToDate(barcode, todate);
                }
                else
                {
                    string date = Utility.ToString(Utility.ToMildiDate(todate));
                    total.GTS_ExecuteByPersonIdAndToDate("InternalUtility", PrsId, new DateTime(int.Parse(date.Split('/')[0]), int.Parse(date.Split('/')[1]), int.Parse(date.Split('/')[2])));
                }
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
Example #2
0
 /// <summary>
 /// execute all
 /// </summary>
 /// <param name="todate"></param>
 public void GTSCalculateAll(string todate)
 {
     try
     {
         ServiceReference1.TotalWebServiceClient total = new GTS.Clock.AppSetup.ServiceReference1.TotalWebServiceClient("BasicHttpBinding_ITotalWebService", GTSAppSettings.WebServiceAddress);
         if (GTSAppSettings.ClockCalculation)
         {
             total.GTS_ExecuteAllByToDate("InternalUtility", PersianDateTime.Parse(todate).GregorianDate);
         }
         else
         {
             total.GTS_ExecuteAllByToDate("InternalUtility", PersianDateTime.Parse(todate).GregorianDate);
         }
     }
     catch (Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
     }
 }