예제 #1
0
 /// <remarks/>
 public System.IAsyncResult BeginUpdateInventoryCount(InventoryCount[] inventoryCountList, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("UpdateInventoryCount", new object[] {
                 inventoryCountList}, callback, asyncState);
 }
예제 #2
0
        public static void SendInventoryCount()
        {
            Int16 iWrittenToDB = 0;
            using (var cnn = new SQLiteConnection(Common.getDBConnection()))
            {
                try
                {
                    string sql = "";
                    SasolWax.OneMobileWS_Wax.InventoryCount inventoryCountItem;
                    DataTable dtInventoryCount = new DataTable();

                    SQLiteCommand cmd = new SQLiteCommand(cnn);
                    SQLiteDataAdapter da = new SQLiteDataAdapter(cmd);
                    cnn.Open();

                    if (IsTableExists(cnn, "InventoryCount"))
                    {
                        sql = "SELECT * FROM InventoryCount;";
                        cmd.CommandText = sql;
                        da.Fill(dtInventoryCount);


                        List<SasolWax.OneMobileWS_Wax.InventoryCount> iCountList = new List<SasolWax.OneMobileWS_Wax.InventoryCount>();


                        foreach (DataRow dr in dtInventoryCount.Rows)
                        {
                            inventoryCountItem = new InventoryCount();

                            inventoryCountItem.dBagWeight = Convert.ToDecimal(dr["dBagWeight"].ToString());
                            inventoryCountItem.dtCount = Convert.ToDateTime(dr["dtCount"].ToString());
                            inventoryCountItem.iBagStation = dr["iBagStation"].ToString();
                            inventoryCountItem.iCountQuantity = Convert.ToInt32(dr["iCountQuantity"].ToString());
                            inventoryCountItem.ifkUser = Convert.ToInt16(dr["ifkUser"].ToString());
                            inventoryCountItem.ifkVersion = Convert.ToInt16(dr["ifkVersion"].ToString());
                            inventoryCountItem.ipk = Convert.ToInt32(dr["ipk"].ToString());
                            inventoryCountItem.sBatchCode = dr["sBatchCode"].ToString();
                            inventoryCountItem.sSerial = dr["sSerial"].ToString();
                            inventoryCountItem.sStockCode = dr["sStockCode"].ToString();
                            inventoryCountItem.sWarehouse = dr["sWarehouse"].ToString();
                            inventoryCountItem.gUID = new Guid(dr["gUID"].ToString().Trim());


                            iCountList.Add(inventoryCountItem);

                            iWrittenToDB++;

                        }
                        cnn.Close();

                        Common.wsWax.UpdateInventoryCount(iCountList.ToArray());
                    }
                }
                catch (System.Exception ex)
                {
                }
            }
            
        }
예제 #3
0
 public void UpdateInventoryCount(InventoryCount[] inventoryCountList) {
     this.Invoke("UpdateInventoryCount", new object[] {
                 inventoryCountList});
 }