コード例 #1
0
        protected void GetSupplier()
        {
            List <Supplierstbl> lstSupplier = new List <Supplierstbl>();
            Supplierstbl        sup         = new Supplierstbl();
            SuppliersBL         objsupBL    = new SuppliersBL();

            sup.IsActive = 1;
            lstSupplier  = objsupBL.GetSuppliersByStatus(sup).ToList();
            foreach (var cnt in lstSupplier)
            {
                ListItem li = new ListItem();
                li.Text  = cnt.Supplier;
                li.Value = cnt.SupplierID.ToString();
                ddlSupplierID.Items.Add(li);
            }
        }
コード例 #2
0
        protected void GetSuppliers()
        {
            List <Supplierstbl> lstSuppliers   = new List <Supplierstbl>();
            Supplierstbl        sup            = new Supplierstbl();
            SuppliersBL         objSuppliersBL = new SuppliersBL();

            sup.IsActive = 1;
            lstSuppliers = objSuppliersBL.GetSuppliersByStatus(sup).ToList();
            ddlToAccount.Items.Clear();
            ListItem m = new ListItem();

            m.Text  = "--Select--";
            m.Value = 0.ToString();
            ddlToAccount.Items.Add(m);
            foreach (var cntt in lstSuppliers)
            {
                ListItem la = new ListItem();
                la.Text  = cntt.Supplier;
                la.Value = cntt.SupplierID.ToString();
                ddlToAccount.Items.Add(la);
            }
        }
コード例 #3
0
        protected string GetSuppliers(int spid)
        {
            List <Supplierstbl> lstSuppliers   = new List <Supplierstbl>();
            Supplierstbl        sps            = new Supplierstbl();
            SuppliersBL         objSuppliersBL = new SuppliersBL();

            sps.IsActive = 1;
            lstSuppliers = objSuppliersBL.GetSuppliersByStatus(sps).ToList();
            ListItem l = new ListItem();

            l.Text  = "--Select--";
            l.Value = 0.ToString();
            ddlToAccount.Items.Add(l);
            foreach (var cnt in lstSuppliers)
            {
                ListItem li = new ListItem();
                li.Text  = cnt.Supplier;
                li.Value = cnt.SupplierID.ToString();
                ddlToAccount.Items.Add(li);
            }
            var suppliers = lstSuppliers.OfType <Supplierstbl>().Where(a => a.SupplierID == spid);

            return(suppliers.Count() > 0 ? suppliers.First().Supplier : "");
        }