Beispiel #1
0
        //IPV Report
        //public DataTable GetSKUQC()
        //{
        //    dt = new DataTable();
        //    string query = "select PROCESSOR, fullname, VALIDATED_BY, SKU_NUMBER, DATE_ADDED, CLIENT, TSHEETS_CLIENT_CODE, DATE_FINISHED, VALIDATED_DATETIME, EDI_VAN from sku left join users on VALIDATED_BY =  username left join client on CLIENT = CLIENT_NAME where users.group_num >= 50 and users.ACTIVE =1 and VALIDATED_DATETIME BETWEEN CURDATE() - INTERVAL 1 DAY AND CURDATE() order by VALIDATED_DATETIME";

        //    if (this.OpenConnection() == true)
        //    {
        //        MySqlCommand cmd = new MySqlCommand(query, connection);
        //        cmd.CommandTimeout = int.MaxValue;

        //        using (MySqlDataAdapter da = new MySqlDataAdapter(cmd))
        //        {
        //            da.Fill(dt);
        //        }
        //        this.CloseConnection();
        //    }

        //    return dt;
        //}


        private void GetPSL_QC()
        {
            try
            {
                dt = new DataTable();
                //disbling Service***************
                WebReference.Service1 objSku = new WebReference.Service1();
                dt = objSku.GetQCPSL();

                if (dt.Rows.Count > 0)
                {
                    openConnection();
                    SqlBulkCopy objbulk = new SqlBulkCopy(con);
                    objbulk.DestinationTableName = "RTM_PSL_QC";
                    objbulk.ColumnMappings.Add("PKEY", "PKEY");
                    objbulk.ColumnMappings.Add("IPN", "IPN");
                    objbulk.ColumnMappings.Add("client", "client");
                    objbulk.ColumnMappings.Add("TSHEETS_CLIENT_CODE", "TSHEETS_CLIENT_CODE");
                    objbulk.ColumnMappings.Add("validatedBy", "validatedBy");
                    objbulk.ColumnMappings.Add("fullname", "fullname");
                    objbulk.ColumnMappings.Add("validatedDateTime", "validatedDateTime");

                    objbulk.WriteToServer(dt);

                    con.Close();
                }
            }
            catch (Exception ex)
            {
                WriteToErrorLog(ex.Message, ex.StackTrace, "PSL_QC");
            }
        }
Beispiel #2
0
        //IPV-Invoices
        private void GetData()
        {
            try
            {
                dt = new DataTable();
                WebReference.Service1 objSku = new WebReference.Service1();
                objSku.Timeout = int.MaxValue;
                dt             = objSku.GetIPSKU();

                if (dt.Rows.Count > 0)
                {
                    dt.Rows.Cast <DataRow>().ToList().ForEach(r => r.SetField("VALIDATED_DATETIME", UpdateTime(Convert.ToDateTime(r["VALIDATED_DATETIME"]))));
                    openConnection();
                    SqlBulkCopy objbulk = new SqlBulkCopy(con);
                    //assigning Destination table name
                    objbulk.DestinationTableName = "RTM_Sku";


                    //Mapping Table column
                    objbulk.ColumnMappings.Add("PROCESSOR", "PROCESSOR");
                    objbulk.ColumnMappings.Add("fullname", "fullname");
                    objbulk.ColumnMappings.Add("VALIDATED_BY", "VALIDATED_BY");
                    objbulk.ColumnMappings.Add("SKU_NUMBER", "SKU_NUMBER");
                    objbulk.ColumnMappings.Add("DATE_ADDED", "DATE_ADDED");
                    objbulk.ColumnMappings.Add("CLIENT", "CLIENT");
                    objbulk.ColumnMappings.Add("TSHEETS_CLIENT_CODE", "TSHEETS_CLIENT_CODE");
                    objbulk.ColumnMappings.Add("DATE_FINISHED", "DATE_FINISHED");
                    objbulk.ColumnMappings.Add("VALIDATED_DATETIME", "VALIDATED_DATETIME");
                    objbulk.ColumnMappings.Add("EDI_VAN", "EDI_VAN");
                    //inserting bulk Records into DataBase
                    objbulk.WriteToServer(dt);

                    con.Close();
                }
            }
            catch (Exception ex)
            {
                // MessageBox.Show(ex.Message);
                WriteToErrorLog(ex.Message, ex.StackTrace, "SKU");
            }
        }
Beispiel #3
0
        //CMP Invoices
        private void GetCMPData()
        {
            try
            {
                dt = new DataTable();
                WebReference.Service1 objCMP = new WebReference.Service1();
                dt = objCMP.GetCMP();
                if (dt.Rows.Count > 0)
                {
                    //dt.Rows.Cast<DataRow>().ToList().ForEach(r => r.SetField("validatedDateBackend", UpdateTime(Convert.ToDateTime(r["validatedDateBackend"]))));
                    //openDevConnection();
                    openConnection();
                    SqlBulkCopy objbulk = new SqlBulkCopy(con);
                    //assigning Destination table name
                    objbulk.DestinationTableName = "RTM_CMP";

                    //Mapping Table column
                    objbulk.ColumnMappings.Add("invoiceSubId", "invoiceSubId");
                    objbulk.ColumnMappings.Add("assignedTo", "assignedTo");
                    objbulk.ColumnMappings.Add("validatedBy", "validatedBy");
                    objbulk.ColumnMappings.Add("batchDate", "batchDate");
                    objbulk.ColumnMappings.Add("custAbbr", "custAbbr");
                    objbulk.ColumnMappings.Add("customer", "customer");
                    objbulk.ColumnMappings.Add("buildDateBackend", "buildDateBackend");
                    objbulk.ColumnMappings.Add("validatedDateBackend", "validatedDateBackend");

                    //inserting bulk Records into DataBase
                    objbulk.WriteToServer(dt);
                    con.Close();
                    //devCon.Close();
                }
            }
            catch (Exception ex)
            {
                WriteToErrorLog(ex.Message, ex.StackTrace, "CMP");
            }
        }