Esempio n. 1
0
        public ActionResult ViewAccounts()
        {
            int AccountCode = -1;
            dynamic values = new ExpandoObject();
            ViewBag.PageCaption = "View/Edit Account Details";
            Accounts objAccounts = new Accounts();
            int? CSNID = Convert.ToInt32(Session["CSNID"]);
            DataSet dsAccountsddl = objAccounts.getAccounsDDL(AccountCode, Convert.ToInt32(Session["CSNID"].ToString()));


            dsAccountsddl.Tables[0].TableName = "AccountList";
            ViewBag.AccountList = dsAccountsddl.Tables["AccountList"];

            dsAccountsddl.Tables[1].TableName = "AccountType";
            ViewBag.AccountType = dsAccountsddl.Tables["AccountType"];

            dsAccountsddl.Tables[2].TableName = "States";
            ViewBag.States = dsAccountsddl.Tables["States"];


            //dsAccountsddl.Tables[3].TableName = "csnlist";
            // ViewBag.csnlist = dsAccountsddl.Tables["csnlist"];


            dsAccountsddl.Tables[4].TableName = "AcctStatus";
            ViewBag.AcctStatus = dsAccountsddl.Tables["AcctStatus"];


            dsAccountsddl.Tables[5].TableName = "AccountsDetails";
            ViewBag.AccountsDetails = dsAccountsddl.Tables["AccountsDetails"];


            dsAccountsddl.Tables[6].TableName = "AcctType";
            ViewBag.AcctType = dsAccountsddl.Tables["AcctType"];


            ViewBag.PageCaption = "View Account Details";


            IList<TblAccountList> objAcccount;

            dynamic vCsnList;
            using (var db = new CSN.DAL.CSNDBEntities())
            {

                if (Session["RoleID"].ToString() == "1" || Session["RoleId"].ToString() == "28")
                {
                    objAcccount = db.TblAccountLists//.Include("TblCSNLists")
                        .OrderBy(e => e.Company)
                        .ToList();



                    vCsnList = (from x1 in db.TblCSNLists.OrderBy(e => e.FullName)
                                select new
                                {
                                    Text = x1.FullName,
                                    Value = x1.CSNID
                                }).ToList();

                }
                else
                {
                    objAcccount = db.TblAccountLists//.Include("TblCSNLists")
                                   .Where(e => e.CSNDirID == CSNID)
                                          .OrderBy(e => e.Company)
                                          .ToList();

                    vCsnList = (from x1 in db.TblCSNLists.Where(e => e.CSNID == CSNID).OrderBy(e => e.FullName)
                                select new
                                {
                                    Text = x1.FullName,
                                    Value = x1.CSNID
                                }).ToList();
                }


            }


            ViewBag.AccountList1 = objAcccount;
            ViewBag.csnlist = vCsnList;
            return View("~/Views/Accounts/ViewAccounts.cshtml");

        }
Esempio n. 2
0
        public ActionResult AccountInfo(int AccountCode)
        {
            dynamic values = new ExpandoObject();
            ViewBag.PageCaption = "View/Edit Account Details";
            Accounts objAccounts = new Accounts();
            DataSet dsAccountsddl = objAccounts.getAccounsDDL(AccountCode, Convert.ToInt32(Session["CSNID"]));

            dsAccountsddl.Tables[0].TableName = "AccountList";
            ViewBag.AccountList = dsAccountsddl.Tables["AccountList"];

            dsAccountsddl.Tables[1].TableName = "AccountType";
            ViewBag.AccountType = dsAccountsddl.Tables["AccountType"];

            dsAccountsddl.Tables[2].TableName = "States";
            ViewBag.States = dsAccountsddl.Tables["States"];


            dsAccountsddl.Tables[3].TableName = "csnlist";
            ViewBag.csnlist = dsAccountsddl.Tables["csnlist"];


            dsAccountsddl.Tables[4].TableName = "AcctStatus";
            ViewBag.AcctStatus = dsAccountsddl.Tables["AcctStatus"];


            dsAccountsddl.Tables[5].TableName = "AccountsDetails";
            ViewBag.AccountsDetails = dsAccountsddl.Tables["AccountsDetails"];


            dsAccountsddl.Tables[6].TableName = "AcctType";
            ViewBag.AcctType = dsAccountsddl.Tables["AcctType"];

            //  ContactList
            dynamic values1;
            using (var db = new CSN.DAL.CSNDBEntities())
            {
                values1 = db.TblContactMasters.Include("TblAccountList")
               .Where(e => e.AccountCode == AccountCode)
               .OrderBy(e => e.FirstName)
               .ToList();
            }

            ViewBag.ContactList = values1;
            ViewBag.AccountCode = AccountCode;
            return PartialView("~/Views/Shared/Partial/Accounts/AccountInfo.cshtml");
        }
Esempio n. 3
0
        public ActionResult SearchBuyers()
        {

            dynamic values1;

            dynamic values = new ExpandoObject();
            ViewBag.PageCaption = "View/Edit Buyers List";
            Accounts objAccounts = new Accounts();
            DataSet dsAccountsddl = objAccounts.getAccounsDDL(-1, Convert.ToInt32(Session["CSNID"]));

            dsAccountsddl.Tables[0].TableName = "AccountList";
            ViewBag.AccountList = dsAccountsddl.Tables["AccountList"];

            dsAccountsddl.Tables[1].TableName = "AccountType";
            ViewBag.AccountType = dsAccountsddl.Tables["AccountType"];

            dsAccountsddl.Tables[2].TableName = "States";
            ViewBag.States = dsAccountsddl.Tables["States"];


            dsAccountsddl.Tables[3].TableName = "csnlist";
            ViewBag.csnlist = dsAccountsddl.Tables["csnlist"];


            dsAccountsddl.Tables[4].TableName = "AcctStatus";
            ViewBag.AcctStatus = dsAccountsddl.Tables["AcctStatus"];


            dsAccountsddl.Tables[5].TableName = "AccountsDetails";
            ViewBag.AccountsDetails = dsAccountsddl.Tables["AccountsDetails"];


            dsAccountsddl.Tables[6].TableName = "AcctType";
            ViewBag.AcctType = dsAccountsddl.Tables["AcctType"];

            using (var db = new CSN.DAL.CSNDBEntities())
            {
                values1 = db.TblContactMasters.Include("TblAccountList")
               //.OrderBy(e => e.TblAccountList.Company)
               .ToList();
            }

            ViewBag.ContactList = values1;
            return View("~/Views/Contacts/ViewContacts.cshtml");
        }