Exemplo n.º 1
0
        public void Transfer()
        {
            //vat = T_String.GetMax("MAX(SEQ_NO)", "FILC10A");
            Stop  = false;
            table = "TBLDETAILSATTENDANCE_" + "UserLoginTemp";
            //--Neu chuyen tiep -->
            string sql;

            if (numTransfered == 0)
            {
                sql = "IF EXISTS (SELECT * FROM sysobjects WHERE name=N'" + table + "' AND type='U') Drop Table [" + table + "]";
                PublicFunction.SQL_Execute(sql, PublicFunction.C_con, 180);
                PublicFunction.Copy_Table("TBLDETAILSATTENDANCE", table, PublicFunction.C_con);
            }
            //<--

            Set    = new RecordSet("Select * from TBLATTSYSSETTING", PublicFunction.C_con);
            rsType = new RecordSet("Select TYP_ID,ROU_DR from TBLTYPESHIFT", PublicFunction.C_con);
            CheckFieldName();

            DateTime d1 = dt1;
            DateTime d2 = dt2;

            //sql = "Select a.EMP_ID,a.EMP_I1,EMP_NM,DEP_ID,CONVERT(NVARCHAR(10),VAC_DT,111) VAC_DT,"
            //    + "CONVERT(NVARCHAR(10),INH_DT,111) INH_DT,CRD_NO from FILB01A  a Left JOIN  FILB01AC b on a.EMP_ID=b.EMP_ID where "
            //    + crtCondition1.GetWhere("a", false) + " and ATT_BT=1 and (VAC_DT is null or VAC_DT>='" + d1.ToString("yyyy/MM/dd") + "') and INH_DT is not null";
            sql = "Select a.EMP_ID,a.EMP_I1,EMP_NM,DEP_ID, null VAC_DT,"
                  + "CONVERT(NVARCHAR(10),INH_DT,111) INH_DT,CRD_NO from TBLEMPLOYEE  a"
                  + " where " + crtCondition1.GetWhere("a", false) + " and INH_DT is not null";

            rs = new RecordSet(sql, PublicFunction.C_con);

            //tm.Text = "00:00:00";
            s = 0;
            p = 0;
            h = 0;

            //timer1.Enabled = true;
            //timer1.Start();

            process();
        }