Exemplo n.º 1
0
        private void grd_editStockEntry_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var  senderGrid   = (DataGridView)sender;
            long stockEctryId = 0;

            BLL.ClsStockData stockData = new BLL.ClsStockData();

            try
            {
                //check permission for do action
                if (COMM_METHODS.checkActPermission(this.Name, USERNAME))
                {
                    if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0)
                    {
                        stockEctryId = Convert.ToInt64(senderGrid.SelectedCells[e.ColumnIndex].Value);
                        stockData    = MANAGEDB.getSingleStockDetail(stockEctryId);

                        FrmAdjustStock frmUser = new FrmAdjustStock(stockData, USERNAME);
                        frmUser.WindowState = FormWindowState.Normal;
                        frmUser.ShowDialog();
                        fillGrid(SEARCH);
                        //grd_editStockEntry.DataSource = MANAGEDB.getStockDetails(SEARCHTYPE);
                    }
                }
                else
                {
                    COM_MESSAGE.permissionMessage("Sorry You dont have permission to do action !!!");
                }
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemplo n.º 2
0
        private void btn_update_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            try
            {
                //check for do action
                if (COMM_METHODS.checkActPermission(this.Name, USERNAME))
                {
                    bool             isError      = false;
                    BLL.ClsStockData newStockData = new BLL.ClsStockData();
                    var dataList = new List <Tuple <string, string> >();

                    dataList.Add(new Tuple <string, string>("quantity", txt_quantity.Text));
                    dataList.Add(new Tuple <string, string>("buyingUnitPrice", txt_buyUnitPrice.Text));
                    dataList.Add(new Tuple <string, string>("sellingUnitPrice", txt_sellUnitPrice.Text));
                    dataList.Add(new Tuple <string, string>("priceAfterDiscount", txt_sellUnitPrice.Text));

                    isError = checkInsertedStockEntry(dataList);

                    if (!isError)
                    {
                        newStockData._stockEntryId   = Convert.ToInt64(txt_entryId.Text);
                        newStockData._itemCode       = txt_itemCode.Text;
                        newStockData._itemId         = Convert.ToInt32(txt_itemId.Text);
                        newStockData._quantity       = Convert.ToDouble(txt_quantity.Text);
                        newStockData._buyUnitPrice   = Convert.ToDouble(txt_buyUnitPrice.Text);
                        newStockData._sellUnitPrice  = Convert.ToDouble(txt_sellUnitPrice.Text);
                        newStockData._stockEntryDate = dateTime_stockEntry.Value; //Convert.ToDateTime(txt_stockEntryDate.Text);
                        newStockData._expireDate     = dateTime_expire.Value;     //Convert.ToDateTime(txt_expireDate.Text);
                        //newStockData._createDate = DateTime.Today;
                        newStockData._totalValue         = Convert.ToDouble(txt_totalValue.Text);
                        newStockData._updateDate         = DateTime.Today;
                        newStockData._remainQuantity     = Convert.ToDouble(txt_remainQuantity.Text);
                        newStockData._priceAfterDiscount = Convert.ToDouble(txt_priceAfterDiscount.Text);
                        newStockData._comment            = txt_comment.Text;
                        newStockData._misPlacedQty       = Convert.ToDouble(txt_misPlaced.Text);
                        newStockData._dealerId           = Convert.ToInt32(txt_dealerId.Text);
                        newStockData._stockUnitId        = dropDown_stockUnit.SelectedIndex;

                        if (MANAGEDB.updateData_stockEntry(newStockData))
                        {
                            COM_MESSAGE.successfullMessage("Successfully Updated the Stock Entry ");
                            IS_SUCCESS_MESSAGE = true;
                            this.Close();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }

            Cursor.Current = Cursors.Default;
        }
Exemplo n.º 3
0
        public FrmAdjustStock(string userName)
        {
            COM_MESSAGE  = new CommonControls.Classes.ClsMessages();
            VALIDATION   = new CommonControls.Classes.ClsValidation();
            COMM_METHODS = new CommonControls.Classes.ClsCommonMethods();
            STOCKDATA    = new BLL.ClsStockData();
            MANAGEDB     = new BLL.ClsInventoryManageDbChanges();

            InitializeComponent();

            this.WindowState   = FormWindowState.Maximized;
            this.ActiveControl = txt_itemCode;
        }
Exemplo n.º 4
0
        public FrmStockIntake(BLL.ClsStockData stockData, string userName)
        {
            COM_MESSAGE  = new CommonControls.Classes.ClsMessages();
            VALIDATION   = new CommonControls.Classes.ClsValidation();
            COMM_METHODS = new CommonControls.Classes.ClsCommonMethods();
            STOCKDATA    = new BLL.ClsStockData();
            MANAGEDB     = new BLL.ClsInventoryManageDbChanges();

            InitializeComponent();

            IS_UPDATING = true;
            USERNAME    = userName;

            this.StartPosition = FormStartPosition.CenterScreen;
            this.ActiveControl = txt_itemCode;
        }
Exemplo n.º 5
0
        public FrmStockIntake(string userName)
        {
            COM_MESSAGE  = new CommonControls.Classes.ClsMessages();
            VALIDATION   = new CommonControls.Classes.ClsValidation();
            COMM_METHODS = new CommonControls.Classes.ClsCommonMethods();
            STOCKDATA    = new BLL.ClsStockData();
            MANAGEDB     = new BLL.ClsInventoryManageDbChanges();

            InitializeComponent();

            dateTime_stockEntry.Value = DateTime.Today;
            USERNAME = userName;
            fillGrid();

            this.WindowState   = FormWindowState.Maximized;
            this.ActiveControl = txt_itemCode;
        }
Exemplo n.º 6
0
        private void grd_stockCurrent_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var  senderGrid   = (DataGridView)sender;
            long stockEntryId = 0;

            BLL.ClsStockData stockData = new BLL.ClsStockData();

            try
            {
                //check for do action
                if (COMM_METHODS.checkActPermission(this.Name, USERNAME))
                {
                    if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0)
                    {
                        stockEntryId = Convert.ToInt64(senderGrid.SelectedCells[e.ColumnIndex].Value);
                        stockData    = MANAGEDB.getSingleStockDetail(stockEntryId);

                        if (stockData._releaseFlg == 0)
                        {
                            FrmAdjustStock frmUser = new FrmAdjustStock(stockData, USERNAME);
                            frmUser.WindowState = FormWindowState.Normal;
                            frmUser.ShowDialog();
                            fillGrid();
                        }
                        else
                        {
                            COM_MESSAGE.warningMessage("The Entry you are trying to edit is released !!!", "Released Entry");
                        }
                    }
                }
                else
                {
                    COM_MESSAGE.permissionMessage("Sorry You dont have permission to do action !!!");
                }
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }