Esempio n. 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();
        }
Esempio n. 2
0
        private decimal GetRemainingQty_currentGroup()
        {
            List <CItemDetail> lst = new List <CItemDetail>();

            string sGrp      = btnNext.Attributes["idx"];
            bool   isNumeric = int.TryParse(sGrp, out int iGrp);

            if (isNumeric)
            {
                MySqlConnection      conn = CMain.GetConnection(ApplicationSession.DBName);
                ItemDetailCollection col  = ApplicationSession.SalesMaster.CollectionSalesDetail().SelectedItem().ItemDetails(conn, ApplicationSession.StoreID, ApplicationSession.OutletID);
                lst = col.ListBySelectionGroup(iGrp);
            }

            decimal dTotItem = TotalItem_oneGroup(lst);
            decimal dRmnQty  = ApplicationSession.SalesMaster.CollectionSalesDetail().SelectedItem().Qty - dTotItem;

            return(dRmnQty);
        }
Esempio n. 3
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);
        }