private void updateNewArrival()
        {
            BLLStockIn obj_BLLStockIn = new BLLStockIn();

            try
            {
                int int_Result = obj_BLLStockIn.UpdateData(arrival);

                if (int_Result > 0)
                {
                    MessageBox.Show(UIConstantMessage.Const_strSaveSuccessfully);
                    BindDataGridView();
                    clearScreen();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                arrival        = new DEStockIn();
                obj_BLLStockIn = null;
            }
        }
        private void BindDataGridView()
        {
            DEStockIn stockIn = new DEStockIn();

            stockIn.StockInDate = Convert.ToDateTime(dtp_FilteredInDate.Value.Date.ToString());

            BLLStockIn obj_BLLStockIn = new BLLStockIn();

            DataTable dt_StockIn;

            if (txt_FilteredCode.Text.Trim().Length <= 0)
            {
                dt_StockIn = obj_BLLStockIn.LoadStockTableForAllData(stockIn);
            }
            else
            {
                stockIn.Product_Code = txt_FilteredCode.Text;
                dt_StockIn           = obj_BLLStockIn.LoadStockTableForAllDataByInDateAndProductCode(stockIn);
            }

            dgv_ArrivalProduct.DataSource = dt_StockIn;

            NumberingTableForDataGridView(dt_StockIn);

            FormatDataGridView();
        }
        public void Search()
        {
            DateTime dateTime_From = Convert.ToDateTime(dtp_InDateFrom.Value);
            DateTime dateTime_To   = Convert.ToDateTime(dtp_InDateTo.Value.Date.AddHours(23.9));
            String   product_Code  = txt_ProductCode.Text;

            BLLStockIn obj_BLLStockIn = new BLLStockIn();

            DataTable dt_StockIn;

            dt_StockIn = obj_BLLStockIn.LoadStockTableForAllDataByInDateAndProductCode(dateTime_From, dateTime_To, product_Code);

            dgv_Result.DataSource = dt_StockIn;

            NumberingTableForDataGridView(dt_StockIn);

            FormatDataGridView();
        }
        private void dgv_ArrivalProduct_DoubleClick(object sender, EventArgs e)
        {
            arrival.StockInId = new Guid(Convert.ToString(dgv_ArrivalProduct.CurrentRow.Cells[1].Value));

            BLLStockIn obj_BLLStockIn = new BLLStockIn();
            bool       bool_Result    = obj_BLLStockIn.LoadStockInRow(arrival);

            if (bool_Result == true)
            {
                DisplayData(arrival);
            }
            else
            {
                MessageBox.Show("Record is not found.");
            }

            obj_BLLStockIn = null;
        }