public static bool update_qty(int id, Int64 received_qty, int status, string remarks)
 {
     CE sqlCe = new CE();
     string query = "UPDATE tbl_delivery_items_received SET " +
                    "received_qty = '" + received_qty + "', " +
                    "status = '" + status + "', " +
                    "remarks = '" + remarks + "' " +
                    "WHERE did = " + id;
     return sqlCe.Execute(query);
 }
        public static void save_to_localdb()
        {
            try
            {
                CE sqlCe = new CE();
                dt = new DataTable("table");
                dt = config.get(api.GetDeliveryItems(delivery_id));
                DataRow[] result = dt.Select();
                string query = string.Empty;
                foreach (DataRow l in result)
                {
                    if (!Is_Exist(Convert.ToInt64(l["id"])))
                    {
                        query = "INSERT INTO tbl_delivery_items_received (delivery_id, did, mid, code, po_qty, received_qty, status) " +
                                "VALUES " +
                                "('" + delivery_id + "', " +
                                "'" + l["id"].ToString() + "', " +
                                "'" + l["mid"].ToString() + "', " +
                                "'" + l["code"].ToString() + "', " +
                                "'" + l["po_qty"].ToString() + "', " +
                                "'" + l["received"].ToString() + "', " +
                                "'22');";
                        sqlCe.Execute(query);
                    }
                }

                query = "SELECT delivery_id, did, mid, code, po_qty, received_qty " +
                        "FROM tbl_delivery_items_received WHERE delivery_id = " + delivery_id;
                dt = new DataTable("table");
                dt = sqlCe.DataTable(query);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }