Пример #1
0
        private void updated()
        {
            StringBuilder sql     = new StringBuilder();
            var           primary = new List <string>();
            Dictionary <String, Object> header = new Dictionary <string, object>();

            header.Add("transport", txtTransport.Text);
            header.Add("customer", txtcustname.Text);
            header.Add("custCode", txtCode.Text);
            header.Add("address", txtAddress.Text);
            header.Add("contactNo", txtcontact.Text);
            header.Add("postalCode", txtpostCode.Text);
            header.Add("tinNo", txtTin.Text);
            header.Add("terms", txtTerms.Text);
            header.Add("discount1", txtDis1.Text);
            header.Add("discount2", txtDis2.Text);
            header.Add("discount3", txtDis3.Text);
            header.Add("discount4", txtDis4.Text);
            header.Add("discount5", txtDis5.Text);
            header.Add("dateStamp", DateTime.Now);
            primary.Add("custCode");
            sql.Append(DataSupport.GetUpdate("TransportCustomers", header, primary));

            DataSupport.RunNonQuery(sql.ToString(), IsolationLevel.ReadCommitted);
            MessageBox.Show("Success");
            DialogResult = DialogResult.OK;
        }
Пример #2
0
        public void WMSDetailsInsert(string tripId, string orderId, string dropSequence, string expectedStart)
        {
            var param = new Dictionary <string, object>();

            List <string> pk = new List <string>
            {
                "order_id",
                "status"
            };

            List <string> pv = new List <string>
            {
                orderId,
                "FOR SCHEDULING"
            };

            param.Add("trip", tripId);
            param.Add("order_id", orderId);
            param.Add("drop_sequence", dropSequence);
            WMSSqlScript.AppendLine(DataSupport.GetUpsert("ReleaseTripDetails", param, "trip"));
            param.Clear();

            param.Add("status", "FOR PICKING");
            param.Add("order_id", orderId);
            param.Add("scheduled_release_date", expectedStart);
            WMSSqlScript.AppendLine(DataSupport.GetUpdate("ReleaseOrders", param, pk, pv));
            param.Clear();

            //WMSSqlScript.AppendLine(DataSupport.GetDelete("ReleaseTripDetails", "trip", tripId));
            //WMSSqlScript.AppendLine(DataSupport.GetDelete("ReleaseTrips", "trip_id", tripId));
        }
Пример #3
0
        private void updated()
        {
            StringBuilder sql     = new StringBuilder();
            var           primary = new List <String>();
            Dictionary <String, Object> header = new Dictionary <string, object>();

            header.Add("custCode", txtcustCode.Text);
            header.Add("customer", txtcustName.Text);
            header.Add("address", txtaddress.Text);
            header.Add("businessStyle", txtbusiness.Text);
            header.Add("contactNo", txtcontact.Text);
            header.Add("postalCode", txtpostCode.Text);
            header.Add("tinNo", txttin.Text);
            header.Add("terms", txtterms.Text);
            header.Add("discount1", txtdisc1.Text);
            header.Add("discount2", txtdisc2.Text);
            header.Add("discount3", txtdisc3.Text);
            header.Add("discount4", txtdisc4.Text);
            header.Add("discount5", txtdisc5.Text);
            header.Add("zone", txtzone.Text);
            header.Add("status", 1);
            primary.Add("custCode");
            sql.Append(DataSupport.GetUpdate("base_customer", header, primary));
            DataSupport.RunNonQuery(sql.ToString(), IsolationLevel.ReadCommitted);
            MessageBox.Show("updated");
            DialogResult = DialogResult.OK;
        }
Пример #4
0
        private void btnDeclare_Click(object sender, EventArgs e)
        {
            StringBuilder sql = new StringBuilder();

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                if (dataGridView1.Rows.IndexOf(row) == dataGridView1.Rows.Count - 1)
                {
                    break;
                }
                var primary = new List <string>();
                Dictionary <String, Object> header = new Dictionary <String, Object>();
                header.Add("productID", txtCode.Text);
                header.Add("uom", row.Cells[colUom.Name].Value.ToString());
                header.Add("priceTypeID", row.Cells[colPriceType.Name].Value.ToString());
                header.Add("unitPrice", row.Cells[colUnitPrice.Name].Value.ToString());
                header.Add("dateStamp", DateTime.Now);
                header.Add("qty", row.Cells[colQty.Name].Value.ToString());
                primary.Add("productID"); primary.Add("uom"); primary.Add("priceTypeID");
                if (FAQ.productPriceExist(Convert.ToInt32(txtCode.Text), row.Cells[colUom.Name].Value.ToString(), row.Cells[colPriceType.Name].Value.ToString()))
                {
                    sql.Append(DataSupport.GetUpdate("itemPrice", header, primary));
                }
                else
                {
                    sql.Append(DataSupport.GetInsert("itemPrice", header));
                }
            }
            DataSupport.RunNonQuery(sql.ToString(), IsolationLevel.ReadCommitted);
            MessageBox.Show("Success");
            DialogResult = DialogResult.OK;
        }
Пример #5
0
        public void UpdateOutgoingShipmentRequest(string pk, string pkValue)
        {
            var           param = new Dictionary <string, object>();
            List <string> pv    = new List <string> {
                pkValue
            };

            param.Add("out_shipment_id", pkValue);
            param.Add("status", "FOR RELEASING");

            OMSSqlScript.AppendLine(DataSupport.GetUpdate("OutgoingShipmentRequests", param, pk));
        }
Пример #6
0
        private void update()
        {
            StringBuilder sql     = new StringBuilder();
            var           primary = new List <string>();
            Dictionary <String, Object> header = new Dictionary <String, Object>();

            header.Add("product_code", txtproductCode.Text);
            header.Add("description", txtDescription.Text);
            primary.Add("product_code");
            sql.Append(DataSupport.GetUpdate("base_product", header, primary));

            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                if (dataGridView1.Rows.IndexOf(row) == dataGridView1.Rows.Count - 1)
                {
                    break;
                }
                var primarys = new List <string>();
                Dictionary <String, Object> details = new Dictionary <String, Object>();
                details.Add("product_code", txtproductCode.Text);
                if (string.IsNullOrEmpty(row.Cells[colUOM.Name].Value as string))
                {
                    details.Add("uom", "");
                }
                else
                {
                    details.Add("uom", row.Cells[colUOM.Name].Value.ToString());
                }
                if (string.IsNullOrEmpty(row.Cells[colUOM.Name].Value as string))
                {
                    details.Add("quantity", "");
                }
                else
                {
                    details.Add("quantity", row.Cells[colQty.Name].Value.ToString());
                }
                if (string.IsNullOrEmpty(row.Cells[colPriceType.Name].Value as string))
                {
                    details.Add("priceType", "");
                }
                else
                {
                    details.Add("priceType", row.Cells[colPriceType.Name].Value.ToString());
                }
                if (string.IsNullOrEmpty(row.Cells[colPriceType.Name].Value as string))
                {
                    details.Add("price", "");
                }
                else
                {
                    details.Add("price", row.Cells[colPrice.Name].Value.ToString());
                }
                primarys.Add("product_code"); primarys.Add("uom"); primarys.Add("priceType");
                if (FAQ.productPriceExist(txtproductCode.Text, row.Cells[colUOM.Name].Value.ToString(), row.Cells[colPriceType.Name].Value.ToString()))
                {
                    sql.Append(DataSupport.GetUpdate("base_price", details, primarys));
                }
                else
                {
                    sql.Append(DataSupport.GetInsert("base_price", details));
                }
            }
            DataSupport.RunNonQuery(sql.ToString(), IsolationLevel.ReadCommitted);
            MessageBox.Show("updated");
            DialogResult = DialogResult.OK;
        }
Пример #7
0
        private void update()
        {
            StringBuilder sql     = new StringBuilder();
            var           primary = new List <string>();
            Dictionary <String, Object> header = new Dictionary <String, Object>();

            header.Add("id", id);
            header.Add("product_id", txtCode.Text);
            header.Add("description", txtdesc1.Text);
            header.Add("description1", txtdesc2.Text);
            header.Add("description2", txtdesc3.Text);
            header.Add("category", txtCategory.Text);
            primary.Add("id");
            sql.Append(DataSupport.GetUpdate("products", header, primary));
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                if (dataGridView1.Rows.IndexOf(row) == dataGridView1.Rows.Count - 1)
                {
                    break;
                }
                var primarys = new List <string>();
                Dictionary <String, Object> details = new Dictionary <String, Object>();
                details.Add("productID", id);
                details.Add("prodCode", txtCode.Text);
                if (string.IsNullOrEmpty(row.Cells[colUOM.Name].Value as string))
                {
                    details.Add("uom", "");
                }
                else
                {
                    details.Add("uom", row.Cells[colUOM.Name].Value.ToString());
                }
                if (string.IsNullOrEmpty(row.Cells[colUOM.Name].Value as string))
                {
                    details.Add("qty", "");
                }
                else
                {
                    details.Add("qty", row.Cells[colQty.Name].Value.ToString());
                }
                if (string.IsNullOrEmpty(row.Cells[colPriceType.Name].Value as string))
                {
                    details.Add("priceTypeID", "");
                }
                else
                {
                    details.Add("priceTypeID", row.Cells[colPriceType.Name].Value.ToString());
                }
                if (string.IsNullOrEmpty(row.Cells[colPriceType.Name].Value as string))
                {
                    details.Add("unitPrice", "");
                }
                else
                {
                    details.Add("unitPrice", row.Cells[colPrice.Name].Value.ToString());
                }
                details.Add("dateStamp", DateTime.Now);
                primarys.Add("productID"); primarys.Add("uom"); primarys.Add("priceTypeID");
                if (FAQ.productPriceExist(Convert.ToInt32(id), row.Cells[colUOM.Name].Value.ToString(), row.Cells[colPriceType.Name].Value.ToString()))
                {
                    sql.Append(DataSupport.GetUpdate("itemPrice", details, primarys));
                }
                else
                {
                    sql.Append(DataSupport.GetInsert("itemPrice", details));
                }
            }
            DataSupport.RunNonQuery(sql.ToString(), IsolationLevel.ReadCommitted);
            MessageBox.Show("saved");
            DialogResult = DialogResult.OK;
        }