예제 #1
0
        private void populateIncompletePO()
        {
            DataTable dtPOItems = new DataTable();

            Util.setGridviewDataSource(gridPOItems, dtPOItems = POItem.getIncompleteItems());
            lblTotalIncompletePO.Text = string.Format("{0:N0}", LIBUtil.Util.compute(dtPOItems, "SUM", POItem.COL_PENDINGQTYVALUE, ""));
        }
예제 #2
0
        public static void update(Guid userAccountID, Guid id, int priorityNo, int priorityQty, DateTime?expectedDeliveryDate)
        {
            POItem objOld = new POItem(id);

            //generate log description
            string log = "";

            log = ActivityLog.appendChange(log, objOld.ExpectedDeliveryDate, expectedDeliveryDate, "Expected Delivery: '{0}' to '{1}'");
            log = ActivityLog.appendChange(log, objOld.PriorityNo, priorityNo, "Priority No: '{0}' to '{1}'");
            log = ActivityLog.appendChange(log, objOld.PriorityQty, priorityQty, "Priority Qty: '{0}' to '{1}'");

            if (!string.IsNullOrEmpty(log))
            {
                SqlQueryResult result = DBConnection.query(
                    false,
                    DBConnection.ActiveSqlConnection,
                    QueryTypes.ExecuteNonQuery,
                    "poitem_update",
                    new SqlQueryParameter(COL_DB_ID, SqlDbType.UniqueIdentifier, id),
                    new SqlQueryParameter(COL_DB_PriorityNo, SqlDbType.SmallInt, Util.wrapNullable(priorityNo)),
                    new SqlQueryParameter(COL_DB_PriorityQty, SqlDbType.Int, Util.wrapNullable(priorityQty)),
                    new SqlQueryParameter(COL_DB_ExpectedDeliveryDate, SqlDbType.Date, Util.wrapNullable(expectedDeliveryDate))
                    );

                if (result.IsSuccessful)
                {
                    ActivityLog.submit(id, log);
                }
            }
        }
예제 #3
0
 private void BtnRemoveSO_Click(object sender, EventArgs e)
 {
     if (LIBUtil.Util.displayMessageBoxYesNo("Hapus SO?"))
     {
         POItem.updateSaleOrderItem((Guid)Util.getSelectedRowValue(gridPOItems, col_gridPOItems_id), null, null);
         populateIncompletePO();
     }
 }
예제 #4
0
        /*******************************************************************************************************/
        #region CONSTRUCTORS

        public PO(Guid id)
        {
            ID = id;
            DataRow row = get(ID).Rows[0];

            Timestamp  = DBUtil.parseData <DateTime>(row, COL_DB_TIMESTAMP);
            TargetDate = DBUtil.parseData <DateTime>(row, COL_DB_TARGETDATE);
            UserID     = DBUtil.parseData <Guid>(row, COL_DB_USERID);
            Notes      = DBUtil.parseData <string>(row, COL_DB_NOTES);
            VendorID   = DBUtil.parseData <Guid>(row, COL_DB_VENDORID);
            VendorInfo = DBUtil.parseData <string>(row, COL_DB_VENDORINFO);
            PONo       = DBUtil.parseData <string>(row, COL_DB_PONO);

            Items  = POItem.getItems(ID);
            Amount = Convert.ToDecimal(Items.Compute(String.Format("SUM({0})", POItem.COL_SUBTOTAL), ""));
        }
예제 #5
0
 private void gridPOItems_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (Util.isColumnMatch(sender, e, col_gridPOItems_SaleOrderItems_CustomerPONo))
     {
         Sales.SaleOrders_Form form = new Sales.SaleOrders_Form(FormMode.Browse, null);
         Tools.displayForm(form);
         if (form.DialogResult == DialogResult.OK)
         {
             POItem.updateSaleOrderItem((Guid)Util.getSelectedRowValue(sender, col_gridPOItems_id), form.browseItemSelection, form.browseItemDescription);
             populateIncompletePO();
         }
     }
     else if (e.RowIndex > -1 && GlobalData.UserAccount.role != Roles.User)
     {
         Tools.displayForm(new POs.Print_Form((Guid)gridPOItems.Rows[e.RowIndex].Cells[col_gridPOItems_poid.Name].Value));
     }
 }
예제 #6
0
        public static Guid?submitNew(Guid id, Guid vendorID, string vendorInfo, List <POItem> items, string notes, DateTime targetDate, string poNo)
        {
            //format notes
            if (string.IsNullOrWhiteSpace(notes))
            {
                notes = null;
            }
            else
            {
                notes = string.Format("{0:MM/dd/yy}-{1}: {2}", DateTime.Now, GlobalData.UserAccount.name, notes);
            }

            SqlQueryResult result = DBConnection.query(
                false,
                DBConnection.ActiveSqlConnection,
                QueryTypes.ExecuteNonQuery,
                "po_new",
                new SqlQueryParameter(COL_DB_ID, SqlDbType.UniqueIdentifier, id),
                new SqlQueryParameter(COL_DB_VENDORID, SqlDbType.UniqueIdentifier, vendorID),
                new SqlQueryParameter(COL_DB_VENDORINFO, SqlDbType.VarChar, vendorInfo),
                new SqlQueryParameter(COL_DB_TARGETDATE, SqlDbType.Date, targetDate),
                new SqlQueryParameter(COL_DB_PONO, SqlDbType.VarChar, poNo),
                new SqlQueryParameter(COL_DB_USERID, SqlDbType.UniqueIdentifier, GlobalData.UserAccount.id),
                new SqlQueryParameter(COL_DB_NOTES, SqlDbType.VarChar, Util.wrapNullable(notes)
                                      ));

            if (!result.IsSuccessful)
            {
                return(null);
            }
            else
            {
                ActivityLog.submitCreate(id);

                //submit items
                POItem.submitItems(items);

                return(id);
            }
        }
예제 #7
0
 public void changeStatus_Click(object sender, EventArgs args)
 {
     POItem.updateStatus(selectedPOItemsRowID(), Tools.parseEnum <POItemStatus>(sender.ToString()));
     populatePageData();
 }