Exemple #1
0
        public ActionResult Dist_Deal(bool isDistributor = true)
        {
            Distributor    oDist = new Distributor();
            clsSubmitModel oCon  = new clsSubmitModel();

            var vwCate = from a in db.tblDistributors where a.DistributorID == 0 select new { a.DisName, a.MstCode };

            ViewBag.vwDistributor = new SelectList(vwCate, "MstCode", "DisName");

            ViewBag.isDistributor = isDistributor;

            var vwState = from a in db.citydets where a.cityType == 67 && a.cityrute == 3 orderby a.cityname select new { a.citycode, a.cityname };

            ViewBag.vwState = new SelectList(vwState, "citycode", "cityname");

            if (isDistributor == true)
            {
                oDist.Dis_ID = (db.tblDistributors.Where(x => x.DistributorID == 0).Count()).ToString();
            }
            else
            {
                oDist.Dis_ID = (db.tblDistributors.Where(x => x.DistributorID != 0).Count()).ToString();
            }

            oDist.IsDistributor = isDistributor;

            oDist.lstBrand   = oCon.GetList(61);
            oDist.lstProduct = oCon.GetProduct();
            return(View(oDist));
        }