Example #1
0
 private void listStockGroup(int lvl)
 {
     try
     {
         grdList.Rows.Clear();
         StockGroupDB      sgdb   = new StockGroupDB();
         List <stockgroup> sgroup = sgdb.getStockGroupDetails(lvl);
         int i = 1;
         foreach (stockgroup sg in sgroup)
         {
             grdList.Rows.Add();
             grdList.Rows[grdList.RowCount - 1].Cells["LineNo"].Value           = i;
             grdList.Rows[grdList.RowCount - 1].Cells["GroupCode"].Value        = sg.GroupCode;
             grdList.Rows[grdList.RowCount - 1].Cells["GroupDescription"].Value = sg.GroupDescription;
             grdList.Rows[grdList.RowCount - 1].Cells["CreateTime"].Value       = sg.CreateTime;
             grdList.Rows[grdList.RowCount - 1].Cells["Creator"].Value          = sg.CreateUser;
             i++;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error in Stock Group  Listing");
     }
     try
     {
         enableBottomButtons();
         pnlList.Visible = true;
         btnNew.Visible  = false;
     }
     catch (Exception ex)
     {
     }
 }
Example #2
0
        public string getGroupCode()
        {
            string gc = "";

            StockGroupDB       sdb     = new StockGroupDB();
            List <stockgroup>  LSGroup = sdb.getStockGroupDetails(lvl);
            SortedSet <string> set     = new SortedSet <string>();

            try
            {
                foreach (stockgroup sg in LSGroup)
                {
                    set.Add(sg.GroupCode);
                }
                gc = set.Max;
            }
            catch (Exception ex)
            {
            }
            if (Convert.ToInt32(gc) == 0)
            {
                gc = "10";// group coe start with 10
            }
            return((Convert.ToInt32(gc) + 1).ToString());
        }