예제 #1
0
 private void gridReceivables_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     if (Tools.isCorrectColumn(sender, e, typeof(DataGridViewLinkColumn), col_gridReceivables_saleBarcode.Name))
     {
         Tools.displayForm(new Sales.Invoice_Form((Guid)gridReceivables.Rows[e.RowIndex].Cells[col_gridReceivables_saleID.Name].Value));
     }
     else if (Tools.isCorrectColumn(sender, e, typeof(DataGridViewLinkColumn), col_gridReceivables_amount.Name))
     {
         //var form = new Sales.Payment_Form(new Guid(gridReceivables.Rows[e.RowIndex].Cells[col_gridReceivables_saleID.Name].Value.ToString()));
         var form = new Invoices.Payment_Form(typeof(Sale), new Guid(gridReceivables.Rows[e.RowIndex].Cells[col_gridReceivables_saleID.Name].Value.ToString()));
         Tools.displayForm(form);
         if (form.DialogResult == DialogResult.OK)
         {
             populatePageData();
         }
     }
 }
예제 #2
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));
     }
 }
        public static string submitNew(string barcodeWithoutPrefix, bool isManualInput, bool rescanToday, bool ignoreSold, string itemLocation)
        {
            if (barcodeWithoutPrefix.Length != Settings.itemBarcodeLength)
            {
                return(barcodeWithoutPrefix + " is not a valid item barcode");
            }

            try
            {
                using (SqlCommand cmd = new SqlCommand("inventoryitemcheck_new", DBConnection.ActiveSqlConnection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add("@id", SqlDbType.UniqueIdentifier).Value            = Guid.NewGuid();
                    cmd.Parameters.Add("@BarcodeWithoutPrefix", SqlDbType.VarChar).Value   = barcodeWithoutPrefix;
                    cmd.Parameters.Add("@user_id", SqlDbType.UniqueIdentifier).Value       = GlobalData.UserAccount.id;
                    cmd.Parameters.Add("@" + COL_DB_MANUALINPUT, SqlDbType.Bit).Value      = isManualInput;
                    cmd.Parameters.Add("@" + FILTER_RescanToday, SqlDbType.Bit).Value      = rescanToday;
                    cmd.Parameters.Add("@" + COL_DB_IgnoreSold, SqlDbType.Bit).Value       = ignoreSold;
                    cmd.Parameters.Add("@" + COL_DB_ItemLocation, SqlDbType.VarChar).Value = itemLocation;
                    SqlParameter InventoryItems_id = cmd.Parameters.Add("@InventoryItems_id", SqlDbType.UniqueIdentifier);
                    InventoryItems_id.Direction = ParameterDirection.Output;
                    SqlParameter opnameMarker = cmd.Parameters.Add("@opnameMarker", SqlDbType.Bit);
                    opnameMarker.Direction = ParameterDirection.Output;
                    SqlParameter inventoryCode = cmd.Parameters.Add("@inventory_code", SqlDbType.VarChar, 10);
                    inventoryCode.Direction = ParameterDirection.Output;
                    SqlParameter itemLength = cmd.Parameters.Add("@item_length", SqlDbType.Int);
                    itemLength.Direction = ParameterDirection.Output;
                    SqlParameter errorcodevalue = cmd.Parameters.Add("@errorcode", SqlDbType.TinyInt);
                    errorcodevalue.Direction = ParameterDirection.Output;

                    cmd.ExecuteNonQuery();

                    int errorcode = Convert.ToInt32(errorcodevalue.Value);
                    if (errorcode > 0)
                    {
                        if (errorcode == 1)
                        {
                            return(barcodeWithoutPrefix + " is not found in database");
                        }
                        if (errorcode == 2)
                        {
                            return(barcodeWithoutPrefix + " is already scanned today");
                        }
                        if (errorcode == 3 && !ignoreSold)
                        {
                            return(barcodeWithoutPrefix + " is already sold");
                        }
                    }

                    ActivityLog.submit(new Guid(InventoryItems_id.Value.ToString()), "Opname");

                    Tools.displayForm(new SharedForms.Verify_Form(inventoryCode.Value.ToString(), itemLength.Value.ToString(), (decimal)(.5)));
                    if (Convert.ToBoolean(opnameMarker.Value))
                    {
                        Settings.opnameMarkerSound.Play();
                    }
                    else
                    {
                        Settings.notificationSound.Play();
                    }
                }
            }
            catch (Exception ex) { return(ex.Message); }

            return(string.Empty);
        }
예제 #4
0
        /*******************************************************************************************************/
        #region CLASS METHODS

        private void btnNewSale_Click(object sender, EventArgs e)
        {
            Tools.displayForm(this, new Sales.Add_Edit_Form());
        }
 private void btnLog_Click(object sender, EventArgs e)
 {
     Tools.displayForm(new Logs.Main_Form(selectedRowID()));
     DefaultInputToFocus.focus();
 }