コード例 #1
0
        private void DisplayItemDetail(int grp = 1)
        {
            MySqlConnection      conn = CMain.GetConnection(ApplicationSession.DBName);
            ItemDetailCollection col  = ApplicationSession.SalesMaster.CollectionSalesDetail().SelectedItem().ItemDetails(conn, ApplicationSession.StoreID, ApplicationSession.OutletID);
            List <CItemDetail>   lst  = col.ListBySelectionGroup(grp);

            lvwModalListDetail.DataSource = lst;
            lvwModalListDetail.DataBind();

            btnPrev.Enabled = (grp > col.LBoundIndex());
            btnPrev.Attributes.Add("idx", grp.ToString());
            btnNext.Enabled = (grp < col.UBoundIndex());
            btnNext.Attributes.Add("idx", grp.ToString());

            lblMasterName.InnerText = ApplicationSession.SalesMaster.CollectionSalesDetail().SelectedItem().TransName;
            ShowModalDialog_ListDetail();
        }
コード例 #2
0
        private CMiniItem CheckIfAnyItemDetailMissing()
        {
            CMiniItem            miniItem = new CMiniItem();
            MySqlConnection      conn     = CMain.GetConnection(ApplicationSession.DBName);
            ItemDetailCollection col      = ApplicationSession.SalesMaster.CollectionSalesDetail().SelectedItem().ItemDetails(conn, ApplicationSession.StoreID, ApplicationSession.OutletID);
            int lbound = col.LBoundIndex();
            int ubound = col.UBoundIndex();

            for (int grp = lbound; grp <= ubound; grp++)
            {
                List <CItemDetail> lst      = col.ListBySelectionGroup(grp);
                decimal            dTotItem = TotalItem_oneGroup(lst);
                decimal            dRmnQty  = ApplicationSession.SalesMaster.CollectionSalesDetail().SelectedItem().Qty - dTotItem;
                if (dRmnQty > 0)
                {
                    miniItem = new CMiniItem(grp, "", dRmnQty, 0);
                    break;
                }
            }

            return(miniItem);
        }