Exemple #1
0
        private void fillData()
        {
            try
            {
                DataGridViewButtonColumn col = new DataGridViewButtonColumn();
                col.DataPropertyName = "assetId";
                col.Name             = "assetId";
                col.HeaderText       = "Asset Id";
                grd_editAssets.Columns.Add(col);
                grd_editAssets.DataSource = MANAGEDB.getAssetDetails();
                grd_editAssets.Columns["deleteFlg"].Visible       = false;
                grd_editAssets.ColumnHeadersDefaultCellStyle.Font = new Font(DataGridView.DefaultFont, FontStyle.Bold);

                //set grid view column headers
                grd_editAssets.Columns["assetName"].HeaderText   = "Asset Name";
                grd_editAssets.Columns["value"].HeaderText       = "Value of Asset";
                grd_editAssets.Columns["description"].HeaderText = "Description";
                grd_editAssets.Columns["quantity"].HeaderText    = "Quantity";
                grd_editAssets.Columns["totalValue"].HeaderText  = "Total Value";

                cmb_search.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #2
0
        private void getAllFormData()
        {
            DataTable dt_userPermission = new DataTable();

            try
            {
                dt_userPermission             = MANAGEDB.getFormDetails();
                grd_userPermission.DataSource = dt_userPermission;

                DataGridViewCheckBoxColumn chkColView = new DataGridViewCheckBoxColumn();
                chkColView.Name       = "View_permision";
                chkColView.HeaderText = "View Permission";
                grd_userPermission.Columns.Add(chkColView);

                DataGridViewCheckBoxColumn chkCol_act = new DataGridViewCheckBoxColumn();
                chkCol_act.Name       = "act_permision";
                chkCol_act.HeaderText = "Action Permission";
                grd_userPermission.Columns.Add(chkCol_act);

                //hide columns
                grd_userPermission.Columns["isCommonForm"].Visible = false;
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #3
0
        private void filldropDownLists()
        {
            try
            {
                //fill data for itemType from db
                dropDown_itemType.DataSource     = MANAGEDB.getItemTypeList();
                dropDown_itemType.DisplayMember  = "itemType";
                dropDown_itemType.ValueMember    = "typeId";
                dropDown_itemType.BindingContext = this.BindingContext;
                dropDown_itemType.SelectedIndex  = -1;

                //fill data for stock unit
                dropDown_stockUnit.DataSource     = MANAGEDB.getUnitDetails();
                dropDown_stockUnit.DisplayMember  = "symbol";
                dropDown_stockUnit.ValueMember    = "unitId";
                dropDown_stockUnit.BindingContext = this.BindingContext;
                dropDown_stockUnit.SelectedIndex  = -1;

                //fill data for shop unit
                dropDown_shopUnit.DataSource     = MANAGEDB.getUnitDetails();
                dropDown_shopUnit.DisplayMember  = "symbol";
                dropDown_shopUnit.ValueMember    = "unitId";
                dropDown_shopUnit.BindingContext = this.BindingContext;
                dropDown_shopUnit.SelectedIndex  = -1;
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #4
0
        private void fillData()
        {
            try
            {
                DataGridViewButtonColumn col = new DataGridViewButtonColumn();
                col.DataPropertyName = "unitId";
                col.Name             = "unitId";
                col.HeaderText       = "Unit Id";
                grd_editUnits.Columns.Add(col);
                grd_editUnits.DataSource = MANAGEDB.getUnitDetails();
                grd_editUnits.Columns["deleteFlg"].Visible       = false;
                grd_editUnits.ColumnHeadersDefaultCellStyle.Font = new Font(DataGridView.DefaultFont, FontStyle.Bold);

                //set grid view column headers
                grd_editUnits.Columns["unitId"].HeaderText      = "Unit Id";
                grd_editUnits.Columns["description"].HeaderText = "Description";
                grd_editUnits.Columns["symbol"].HeaderText      = "Symbol";

                cmb_search.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #5
0
        private void fillData()
        {
            try
            {
                txt_entryId.Text            = STOCKDATA._stockEntryId.ToString();
                txt_itemCode.Text           = STOCKDATA._itemCode;
                txt_itemId.Text             = STOCKDATA._itemId.ToString();
                txt_itemName.Text           = STOCKDATA._itemName;
                txt_quantity.Text           = STOCKDATA._quantity.ToString();
                txt_buyUnitPrice.Text       = STOCKDATA._buyUnitPrice.ToString();
                txt_sellUnitPrice.Text      = STOCKDATA._sellUnitPrice.ToString();
                dateTime_stockEntry.Value   = STOCKDATA._stockEntryDate;
                dateTime_expire.Value       = STOCKDATA._expireDate;
                txt_totalValue.Text         = STOCKDATA._totalValue.ToString();
                txt_priceAfterDiscount.Text = STOCKDATA._priceAfterDiscount.ToString();
                txt_comment.Text            = STOCKDATA._comment;
                txt_remainQuantity.Text     = STOCKDATA._remainQuantity.ToString();
                txt_misPlaced.Text          = STOCKDATA._misPlacedQty.ToString();
                txt_dealerId.Text           = STOCKDATA._dealerId.ToString();
                txt_dealer.Text             = STOCKDATA._dealerName;

                dropDown_stockUnit.DataSource     = MANAGEDB.getUnitDetails();
                dropDown_stockUnit.DisplayMember  = "symbol";
                dropDown_stockUnit.ValueMember    = "unitId";
                dropDown_stockUnit.BindingContext = this.BindingContext;
                dropDown_stockUnit.SelectedIndex  = dropDown_stockUnit.FindString(STOCKDATA._stockUnitSymbol);
            }

            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #6
0
 private void fillData(BLL.ClsUnitData unitData)
 {
     try
     {
         txt_unitId.Text      = unitData._unitId.ToString();
         txt_description.Text = unitData._description;
         txt_symbol.Text      = unitData._symbol;
     }
     catch (Exception ex)
     {
         COM_MESSAGE.exceptionMessage(ex.Message);
     }
 }
Exemple #7
0
        private void btn_create_Click(object sender, EventArgs e)
        {
            try
            {
                //check for do action
                if (COMM_METHODS.checkActPermission(this.Name, USERNAME))
                {
                    bool   isError  = false;
                    string itemId   = txt_itemID.Text;
                    string itemCode = txt_itemCode.Text;
                    string itemName = txt_itemName.Text;
                    string altName  = txt_altName.Text;
                    string itemType = (dropDown_itemType.SelectedIndex != -1) ? dropDown_itemType.SelectedItem.ToString() : string.Empty;

                    var dataList = new List <Tuple <string, string> >();

                    dataList.Add(new Tuple <string, string>("itemCode", itemCode));
                    dataList.Add(new Tuple <string, string>("itemName", itemName));
                    dataList.Add(new Tuple <string, string>("altName", altName));
                    dataList.Add(new Tuple <string, string>("itemType", itemType));

                    isError = checkInsertedItemData(dataList);

                    if (!isError)
                    {
                        //insert data to db
                        CREATEITEM._itemId     = Convert.ToInt32(itemId);
                        CREATEITEM._itemCode   = itemCode;
                        CREATEITEM._itemName   = itemName;
                        CREATEITEM._altName    = altName;
                        CREATEITEM._itemTypeId = Convert.ToInt32(dropDown_itemType.SelectedValue);

                        if (MANAGEDB.insertData_item(CREATEITEM))
                        {
                            COM_MESSAGE.successfullMessage("Successfully created the Item ");
                            COMM_METHODS.clearAllText(this);
                            dropDown_itemType.SelectedIndex = -1;
                            txt_itemID.Text = MANAGEDB.getMaxItemId().ToString();
                        }
                    }
                }
                else
                {
                    COM_MESSAGE.permissionMessage("Sorry You dont have permission to do action !!!");
                }
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #8
0
 private void fillData(BLL.ClsTaxData taxData)
 {
     try
     {
         txt_taxId.Text         = taxData._taxId.ToString();
         txt_symbol.Text        = taxData._symbol;
         txt_description.Text   = taxData._description;
         txt_taxPercentage.Text = taxData._taxPercentage.ToString();
         if (!taxData._effectFrom.Equals(DateTime.MinValue))
         {
             chk_timePeriod.Checked = true;
             grp_duration.Enabled   = true;
             dateTime_from.Value    = taxData._effectFrom;
             dateTime_to.Value      = taxData._effectTo;
         }
         else
         {
             chk_timePeriod.Checked = false;
             grp_duration.Enabled   = false;
         }
     }
     catch (Exception ex)
     {
         COM_MESSAGE.exceptionMessage(ex.Message);
     }
 }
Exemple #9
0
        private void btn_add_Click(object sender, EventArgs e)
        {
            bool   isError      = false;
            int    itemTypeIdId = Convert.ToInt16(txt_itemTypeID.Text);
            string itemType     = txt_itemType.Text;

            try
            {
                //check for do action
                if (COMM_METHODS.checkActPermission(this.Name, USERNAME))
                {
                    //validate item Type name
                    if (VALIDATION.isEmptyTextBox(itemType))
                    {
                        COM_MESSAGE.validationMessage("Item Type Cannot be Empty !!!");
                        isError = true;
                    }
                    else
                    {
                        if (!VALIDATION.isLetterAndNumberOnly(itemType))
                        {
                            COM_MESSAGE.validationMessage("Item Type should contains only Letters and Numbers !!!");
                            isError = true;
                        }
                    }

                    if (!isError)
                    {
                        //insert data to tbl_itemtype
                        if (MANAGEDB.insertData_itemType(itemTypeIdId, itemType))
                        {
                            IS_SUCCESS_MESSAGE = true;
                            COM_MESSAGE.successfullMessage("Successfully created the Item Type !!!");
                            clearAllText(this);
                            txt_itemTypeID.Text = MANAGEDB.getMaxItemTypeID().ToString();
                            txt_itemType.Focus();
                        }
                    }
                }
                else
                {
                    COM_MESSAGE.permissionMessage("Sorry You dont have permission to do action !!!");
                }
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #10
0
 private void fillData(BLL.ClsDestinationData destinationData)
 {
     try
     {
         txt_destinationId.Text   = destinationData._destId.ToString();
         txt_destinationName.Text = destinationData._destName;
         txt_ownerName.Text       = destinationData._ownerName;
         txt_address.Text         = destinationData._address;
         txt_phoneNo.Text         = destinationData._phoneNo;
         txt_mobile.Text          = destinationData._mobile;
     }
     catch (Exception ex)
     {
         COM_MESSAGE.exceptionMessage(ex.Message);
     }
 }
Exemple #11
0
        public FrmAddUnits(BLL.ClsUnitData unit, string userName)
        {
            try
            {
                COM_MESSAGE  = new CommonControls.Classes.ClsMessages();
                VALIDATION   = new CommonControls.Classes.ClsValidation();
                COMM_METHODS = new CommonControls.Classes.ClsCommonMethods();
                ADD_UNIT     = new BLL.ClsUnitData();
                MANAGEDB     = new BLL.ClsMetaDataDbChanges();

                InitializeComponent();

                IS_UPDATING        = true;
                USERNAME           = userName;
                btn_cancel.Visible = true;
                btn_create.Visible = false;
                btn_delete.Visible = true;
                btn_update.Visible = true;

                fillData(unit);

                this.StartPosition = FormStartPosition.CenterScreen;
                this.ActiveControl = txt_description;
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #12
0
        public FrmAddTax(BLL.ClsTaxData tax, string userName)
        {
            try
            {
                COM_MESSAGE  = new CommonControls.Classes.ClsMessages();
                VALIDATION   = new CommonControls.Classes.ClsValidation();
                COMM_METHODS = new CommonControls.Classes.ClsCommonMethods();
                ADD_TAX      = new BLL.ClsTaxData();
                MANAGEDB     = new BLL.ClsMetaDataDbChanges();

                InitializeComponent();

                IS_UPDATING        = true;
                USERNAME           = userName;
                btn_add.Visible    = false;
                btn_delete.Visible = true;
                btn_update.Visible = true;

                fillData(tax);

                this.StartPosition = FormStartPosition.CenterScreen;
                this.ActiveControl = txt_symbol;
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #13
0
        private int createUserId()
        {
            int ret = 0;

            //get the maximum userId
            try
            {
                CONNECTION.maxUserID(out ret);

                if (ret <= 0)
                {
                    ret = COMID + 1;
                }
                else
                {
                    ret = ret + 1;
                }
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }

            return(ret);
        }
Exemple #14
0
 private void fillData()
 {
     try
     {
         DataGridViewButtonColumn col = new DataGridViewButtonColumn();
         col.DataPropertyName = "typeId";
         col.Name             = "typeId";
         col.HeaderText       = "Item Type Id";
         grd_editItemType.Columns.Add(col);
         grd_editItemType.DataSource = MANAGEDB.getItemTypeDetails();
     }
     catch (Exception ex)
     {
         COM_MESSAGE.exceptionMessage(ex.Message);
     }
 }
Exemple #15
0
        public FrmAddDealers(string userName)
        {
            try
            {
                COM_MESSAGE  = new CommonControls.Classes.ClsMessages();
                VALIDATION   = new CommonControls.Classes.ClsValidation();
                COMM_METHODS = new CommonControls.Classes.ClsCommonMethods();
                ADD_DEALER   = new BLL.ClsDealerData();
                MANAGEDB     = new BLL.ClsMetaDataDbChanges();

                InitializeComponent();

                USERNAME           = userName;
                btn_cancel.Visible = true;
                btn_create.Visible = true;
                btn_delete.Visible = false;
                btn_update.Visible = false;

                this.WindowState   = FormWindowState.Maximized;
                this.ActiveControl = txt_dealerName;
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #16
0
 private void fillData(BLL.ClsDealerData dealerData)
 {
     try
     {
         txt_dealerID.Text    = dealerData._dealerId.ToString();
         txt_dealerName.Text  = dealerData._dealerName;
         txt_companyName.Text = dealerData._companyName;
         txt_address.Text     = dealerData._address;
         txt_phoneNo.Text     = dealerData._phoneNo;
         txt_mobile.Text      = dealerData._mobile;
     }
     catch (Exception ex)
     {
         COM_MESSAGE.exceptionMessage(ex.Message);
     }
 }
Exemple #17
0
        public FrmAddTax(string userName)
        {
            try
            {
                COM_MESSAGE  = new CommonControls.Classes.ClsMessages();
                VALIDATION   = new CommonControls.Classes.ClsValidation();
                COMM_METHODS = new CommonControls.Classes.ClsCommonMethods();
                ADD_TAX      = new BLL.ClsTaxData();
                MANAGEDB     = new BLL.ClsMetaDataDbChanges();

                InitializeComponent();

                USERNAME             = userName;
                btn_add.Visible      = true;
                btn_delete.Visible   = false;
                btn_update.Visible   = false;
                grp_duration.Enabled = false;
                IS_UPDATING          = false;
                IS_SUCCESS_MESSAGE   = false;

                this.WindowState   = FormWindowState.Maximized;
                this.ActiveControl = txt_symbol;
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #18
0
 private void fillData()
 {
     try
     {
         DataGridViewButtonColumn col = new DataGridViewButtonColumn();
         col.DataPropertyName = "userId";
         col.Name             = "userId";
         col.HeaderText       = "userId";
         grd_editUser.Columns.Add(col);
         grd_editUser.DataSource = MANAGEDB.getUserDetails();
         grd_editUser.Columns["deleteFlg"].Visible = false;
     }
     catch (Exception ex)
     {
         COM_MESSAGE.exceptionMessage(ex.Message);
     }
 }
Exemple #19
0
        private void fillData()
        {
            try
            {
                DataGridViewButtonColumn col = new DataGridViewButtonColumn();
                col.DataPropertyName = "dealerId";
                col.Name             = "dealerId";
                col.HeaderText       = "Dealer Id";
                grd_selectDealer.Columns.Add(col);
                grd_selectDealer.DataSource = MANAGEDB.getDealerDetails();

                cmb_search.SelectedIndex = 1;
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #20
0
        private void fillData()
        {
            try
            {
                DataGridViewButtonColumn col = new DataGridViewButtonColumn();
                col.DataPropertyName = "taxId";
                col.Name             = "taxId";
                col.HeaderText       = "Tax Id";
                grd_editTax.Columns.Add(col);
                grd_editTax.DataSource = MANAGEDB.getTaxDetails();
                grd_editTax.Columns["deleteFlg"].Visible = false;

                //cmb_search.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #21
0
        private void fillData(string itemCode, string releaseQty, string stockIdQty)
        {
            try
            {
                DataGridViewCheckBoxColumn select = new DataGridViewCheckBoxColumn();
                select.DataPropertyName = "select";
                select.Name             = "select";
                select.HeaderText       = "Select";
                select.TrueValue        = true;
                select.FalseValue       = false;
                grd_selectStockEntry.Columns.Add(select);

                DataGridViewButtonColumn col = new DataGridViewButtonColumn();
                col.DataPropertyName = "stockEntryId";
                col.Name             = "stockEntryId";
                col.HeaderText       = "Stock Id";
                grd_selectStockEntry.Columns.Add(col);

                grd_selectStockEntry.DataSource = MANAGEDB.getStockEntryDetailsForItem(itemCode);
                grd_selectStockEntry.Columns["itemName"].ReadOnly         = true;
                grd_selectStockEntry.Columns["itemName"].AutoSizeMode     = DataGridViewAutoSizeColumnMode.Fill;
                grd_selectStockEntry.Columns["itemCode"].ReadOnly         = true;
                grd_selectStockEntry.Columns["remainQuantity"].ReadOnly   = true;
                grd_selectStockEntry.Columns["sellingUnitPrice"].ReadOnly = true;

                grd_selectStockEntry.Columns["stockEntryId"].DisplayIndex     = 0;
                grd_selectStockEntry.Columns["itemName"].DisplayIndex         = 1;
                grd_selectStockEntry.Columns["itemCode"].DisplayIndex         = 2;
                grd_selectStockEntry.Columns["remainQuantity"].DisplayIndex   = 3;
                grd_selectStockEntry.Columns["sellingUnitPrice"].DisplayIndex = 4;
                grd_selectStockEntry.Columns["select"].DisplayIndex           = 5;

                lbl_totalQty.Text   = MANAGEDB.getTotalStockAmountForItem(itemCode).ToString();
                lbl_releaseQty.Text = releaseQty;
                lbl_shortage.Text   = (!string.IsNullOrEmpty(releaseQty)) ? (Convert.ToDouble(stockIdQty) - Convert.ToDouble(releaseQty)).ToString() : 0.ToString();
                //grd_selectStockEntry.Columns["QTY"].Visible = false;
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #22
0
 private void fillData(BLL.ClsAssetData assetData)
 {
     try
     {
         txt_assetId.Text     = assetData._assetId.ToString();
         txt_assetName.Text   = assetData._assetName;
         txt_description.Text = assetData._descrption;
         txt_value.Text       = assetData._value.ToString();
         txt_quantity.Text    = assetData._quantity.ToString();
         txt_total.Text       = assetData._totalValue.ToString();
     }
     catch (Exception ex)
     {
         COM_MESSAGE.exceptionMessage(ex.Message);
     }
 }
Exemple #23
0
        private void setStockEntryId()
        {
            try
            {
                string curr_date = DateTime.Today.ToString("yyyy/MM/dd").Replace("/", "");
                int    prefix    = MANAGEDB.getIdPrefix("stockEntryId");
                string newId     = string.Concat(curr_date, prefix.ToString(), "0001");

                //get max item Id
                long maxId = MANAGEDB.getMaxId("stockEntryId", "tbl_stockentry");

                //if there are no any id in db
                if (maxId <= 1)
                {
                    //set the start Id
                    txt_entryId.Text = newId;
                }
                else
                {
                    string tmp = maxId.ToString().Substring(0, 8);

                    //same day stock entry
                    if (string.Equals(curr_date, tmp))
                    {
                        txt_entryId.Text = maxId.ToString();
                    }
                    //different day stock entry
                    else
                    {
                        txt_entryId.Text = newId;
                    }
                }
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #24
0
        private void btn_create_Click(object sender, EventArgs e)
        {
            try
            {
                //check for do action
                if (COMM_METHODS.checkActPermission(this.Name, USERNAME))
                {
                    bool   isError   = false;
                    string userName  = txt_userName.Text;
                    string firstName = txt_firstName.Text;
                    string lastName  = txt_lastName.Text;
                    string idNumber  = txt_nic.Text;
                    string email     = txt_email.Text;
                    string userRole  = (dropDown_userRole.SelectedIndex != -1) ? dropDown_userRole.SelectedItem.ToString() : string.Empty;
                    string phoneNo   = txt_phoneNumber.Text;

                    var dataList = new List <Tuple <string, string> >();

                    dataList.Add(new Tuple <string, string>("userName", userName));
                    dataList.Add(new Tuple <string, string>("firstName", firstName));
                    dataList.Add(new Tuple <string, string>("lastName", lastName));
                    dataList.Add(new Tuple <string, string>("idNumber", idNumber));
                    dataList.Add(new Tuple <string, string>("email", email));
                    dataList.Add(new Tuple <string, string>("userRole", userRole));
                    dataList.Add(new Tuple <string, string>("phoneNo", phoneNo));

                    isError = checkInsertedUserData(dataList);

                    if (!isError)
                    {
                        //insert data to db
                        CREATEUSER._userId    = Convert.ToInt16(txt_userID.Text);
                        CREATEUSER._userName  = userName;
                        CREATEUSER._firstName = firstName;
                        CREATEUSER._lastName  = lastName;
                        CREATEUSER._dob       = Convert.ToDateTime(txt_dob.Text);
                        CREATEUSER._idNumber  = idNumber;
                        CREATEUSER._address   = txt_address.Text;
                        CREATEUSER._email     = email;
                        CREATEUSER._userRole  = userRole;
                        CREATEUSER._roleId    = Convert.ToInt16(dropDown_userRole.SelectedValue);
                        CREATEUSER._phoneNo   = phoneNo;

                        //insert to tbl_userDetail and tbl_login
                        if (MANAGEDB.InsertData_userDetail(CREATEUSER))
                        {
                            COM_MESSAGE.successfullMessage("Successfully created the user ");
                            COMM_METHODS.clearAllText(this);
                            dropDown_userRole.SelectedIndex = -1;
                            txt_userID.Text = MANAGEDB.getMaxUserID().ToString();
                        }
                    }
                }
                else
                {
                    COM_MESSAGE.permissionMessage("Sorry You dont have permission to do action !!!");
                }
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #25
0
        private void fillGrid(string str)
        {
            try
            {
                //clear the gridview if there are any rows
                grd_editStockEntry.DataSource = null;
                grd_editStockEntry.Refresh();

                DataGridViewButtonColumn col = new DataGridViewButtonColumn();
                col.DataPropertyName = "stockEntryId";
                col.Name             = "stockEntryId";
                col.HeaderText       = "Stock Entry Id";
                grd_editStockEntry.Columns.Add(col);
                grd_editStockEntry.DataSource = MANAGEDB.getStockDetails(str);
                grd_editStockEntry.ColumnHeadersDefaultCellStyle.Font = new Font(DataGridView.DefaultFont, FontStyle.Bold);

                //arrange the gridview
                grd_editStockEntry.Columns["stockEntryId"].DisplayIndex     = 0;
                grd_editStockEntry.Columns["itemCode"].DisplayIndex         = 1;
                grd_editStockEntry.Columns["itemName"].DisplayIndex         = 2;
                grd_editStockEntry.Columns["quantity"].DisplayIndex         = 3;
                grd_editStockEntry.Columns["remainQuantity"].DisplayIndex   = 4;
                grd_editStockEntry.Columns["misPlacedQty"].DisplayIndex     = 5;
                grd_editStockEntry.Columns["buyingUnitPrice"].DisplayIndex  = 6;
                grd_editStockEntry.Columns["totalValue"].DisplayIndex       = 7;
                grd_editStockEntry.Columns["sellingUnitPrice"].DisplayIndex = 8;
                grd_editStockEntry.Columns["createDate"].DisplayIndex       = 9;
                //grd_editStockEntry.Columns["updateDate"].DisplayIndex = 10;
                //grd_editStockEntry.Columns["stockEntryDate"].DisplayIndex = 11;
                //grd_editStockEntry.Columns["expirationDate"].DisplayIndex = 12;
                grd_editStockEntry.Columns["dealerName"].DisplayIndex = 10;

                //change headers
                grd_editStockEntry.Columns["stockEntryId"].HeaderText     = "Stock_Entry_ID";
                grd_editStockEntry.Columns["itemCode"].HeaderText         = "Item_Code";
                grd_editStockEntry.Columns["itemName"].HeaderText         = "Item_Name";
                grd_editStockEntry.Columns["quantity"].HeaderText         = "Qty";
                grd_editStockEntry.Columns["remainQuantity"].HeaderText   = "Remain_Qty";
                grd_editStockEntry.Columns["misPlacedQty"].HeaderText     = "MIsplaced_Qty";
                grd_editStockEntry.Columns["buyingUnitPrice"].HeaderText  = "Unit_Price(Buy)";
                grd_editStockEntry.Columns["totalValue"].HeaderText       = "Total_Val";
                grd_editStockEntry.Columns["sellingUnitPrice"].HeaderText = "Unit_Price(Sell)";
                grd_editStockEntry.Columns["createDate"].HeaderText       = "Create_Date";
                //grd_editStockEntry.Columns["updateDate"].HeaderText = "Update";
                //grd_editStockEntry.Columns["stockEntryDate"].HeaderText = "Entry_Date";
                //grd_editStockEntry.Columns["expirationDate"].HeaderText = "Expire";
                grd_editStockEntry.Columns["dealerName"].HeaderText = "Dealer";

                //hide columns
                grd_editStockEntry.Columns["updateDate"].Visible         = false;
                grd_editStockEntry.Columns["stockEntryDate"].Visible     = false;
                grd_editStockEntry.Columns["expirationDate"].Visible     = false;
                grd_editStockEntry.Columns["itemId"].Visible             = false;
                grd_editStockEntry.Columns["priceAfterDiscount"].Visible = false;
                grd_editStockEntry.Columns["comment"].Visible            = false;
                grd_editStockEntry.Columns["releaseFlg"].Visible         = false;
                grd_editStockEntry.Columns["dealerId"].Visible           = false;
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #26
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            lbl_userNameEmpty.Visible    = false;
            lbl_passwdEmpty.Visible      = false;
            lbl_invalidUser.Visible      = false;
            pnl_userName.BackgroundImage = null;
            pnl_pass.BackgroundImage     = null;
            bool isError = false;

            try
            {
                //validate userName
                if (VALIDATION.isEmptyTextBox(txtUserName.Text))
                {
                    lbl_userNameEmpty.Visible    = true;
                    lbl_userNameEmpty.Text       = "User Name is empty";
                    lbl_userNameEmpty.ForeColor  = Color.Red;
                    pnl_userName.BackgroundImage = (Image)CommonControls.Properties.Resources.ng;
                    txtUserName.Focus();
                    isError = true;
                }
                else
                {
                    if (VALIDATION.isSpecialChars(txtUserName.Text))
                    {
                        lbl_userNameEmpty.Visible    = true;
                        lbl_userNameEmpty.Text       = "User Name Cannot contains special characters";
                        lbl_userNameEmpty.ForeColor  = Color.Red;
                        pnl_userName.BackgroundImage = (Image)CommonControls.Properties.Resources.ng;
                        txtUserName.Focus();
                        isError = true;
                    }
                }

                if (VALIDATION.isEmptyTextBox(txtPassword.Text))
                {
                    lbl_passwdEmpty.Visible   = true;
                    lbl_passwdEmpty.Text      = "Password is empty";
                    lbl_passwdEmpty.ForeColor = Color.Red;
                    pnl_pass.BackgroundImage  = (Image)CommonControls.Properties.Resources.ng;
                    txtPassword.Focus();
                    isError = true;
                }
                else
                {
                    if (VALIDATION.isSpecialChars(txtPassword.Text))
                    {
                        lbl_passwdEmpty.Visible   = true;
                        lbl_passwdEmpty.Text      = "Password cannot contains special characters";
                        lbl_passwdEmpty.ForeColor = Color.Red;
                        pnl_pass.BackgroundImage  = (Image)CommonControls.Properties.Resources.ng;
                        txtPassword.Focus();
                        isError = true;
                    }
                }

                if (!isError)
                {
                    if (isValidUser())
                    {
                        USERNAME = txtUserName.Text;
                        this.Hide();
                        Frm_Main MainForm = new Frm_Main();
                        MainForm.Show();
                    }
                    else
                    {
                        lbl_invalidUser.Visible   = true;
                        lbl_invalidUser.Text      = "Invalid userName or Password";
                        lbl_invalidUser.ForeColor = Color.Red;
                        txtPassword.Text          = String.Empty;
                        txtUserName.Text          = String.Empty;
                        txtUserName.Focus();
                    }
                }
            }
            catch (Exception ex)
            {
                COMM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
Exemple #27
0
        private int checkViewPermission_inventoryManage()
        {
            //btn_stockIntake.Visible = false;
            //btn_adjustStock.Visible = false;
            //btn_releaseStock.Visible = false;
            //btn_adjustReleasedStock.Visible = false;
            //btn_editStockEntry.Visible = false;

            int       buttonCnt = 0;
            int       userRoleId;
            DataTable dt = new DataTable();

            try
            {
                //get userId
                userRoleId = CONN.getUserRoleId(lbl_loggedUser.Text);

                //check the permission
                dt = CONN.getformPermissionPerUser(userRoleId);

                foreach (DataRow row in dt.Rows)
                {
                    if (Convert.ToInt16(row["viewPermission"]) == 1)
                    {
                        switch (row["btnName"].ToString())
                        {
                        case "btn_stockIntake":
                            btn_stockIntake.Visible = true;
                            buttonCnt++;
                            break;

                        case "btn_adjustStock":
                            btn_adjustStock.Visible = true;
                            buttonCnt++;
                            break;

                        case "btn_releaseStock":
                            btn_releaseStock.Visible = true;
                            buttonCnt++;
                            break;

                        case "btn_adjustReleasedStock":
                            btn_adjustReleasedStock.Visible = true;
                            buttonCnt++;
                            break;

                        case "btn_editStockEntry":
                            btn_editStockEntry.Visible = true;
                            buttonCnt++;
                            break;

                        default:
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }

            return(buttonCnt + 1);
        }
Exemple #28
0
        private void FrmReleaseStock_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IS_UPDATING)
                {
                    setReleaseId();

                    this.WindowState = FormWindowState.Maximized;
                }
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }