Exemple #1
0
        // GET: Dashboard
        public ActionResult Index()
        {
            var shistory = sesrepo.GetSessionById((User as CustomPrincipal).UserId);

            ViewBag.OrganizationId = new SelectList(ddl.GetOrganizationList().Where(c => c.Id != shistory.OrganizationId).ToList(), "Id", "Name");
            return(View());
        }
        // GET: Category
        public ActionResult Index()
        {
            var ses   = sesrepo.GetSessionById((User as CustomPrincipal).UserId);
            int orgid = ses.OrganizationId;

            return(View(db.GetAssetCategoryList(orgid)));
        }
Exemple #3
0
        // GET: AcademicSection
        public ActionResult Index()
        {
            var ses   = sesrepo.GetSessionById((User as CustomPrincipal).UserId);
            int orgid = ses.OrganizationId;

            return(View(db.GetAcademicSectionList(orgid, "", "")));
        }
Exemple #4
0
        // GET: Category
        public ActionResult Index()
        {
            var ses = sesrepo.GetSessionById((User as CustomPrincipal).UserId);

            //int orgid = ses.OrganizationId;
            //return View(db.GetUserList(orgid));
            return(View(db.GetUserList()));
        }
        public string DetailedSalesReport()
        //public List<DetailedSalesVM> DetailedSalesReport()
        {
            var ses    = sesrepo.GetSessionById((User as CustomPrincipal).UserId);
            int orgid  = ses.OrganizationId;
            var result = db.GetSalesDetail(orgid, null, null, null, null, "Both", 0, 0, 0, 0);

            return(JsonConvert.SerializeObject(result));
        }
Exemple #6
0
        // GET: InventorySales
        public ActionResult Index(string FromDate = "", string ToDate = "", string IsStaff = "Both", int BatchId = 0, int ClassId = 0, int SectionId = 0, int StudentId = 0, int StaffId = 0, string BillNo = "", string GroupNo = "")
        {
            var ses   = sesrepo.GetSessionById((User as CustomPrincipal).UserId);
            int orgid = ses.OrganizationId;
            //if (string.IsNullOrEmpty(FromDate))
            //{
            //    FromDate = DateTime.Today.ToString("yyyy-MM-dd");
            //}
            //if (string.IsNullOrEmpty(ToDate))
            //{
            //    ToDate = DateTime.Today.ToString("yyyy-MM-dd");
            //}
            //if (IsStaff == "No")
            //{
            //    StaffId = 0;
            //}
            //if (IsStaff == "Yes")
            //{
            //    StudentId = 0;
            //    BatchId = 0;
            //    ClassId = 0;
            //    SectionId = 0;
            //}
            var lst = db.GetSoldList(orgid, FromDate, ToDate, IsStaff, ClassId, StudentId, StaffId, BillNo, GroupNo);

            ViewBag.BatchId   = new SelectList(ddl.GetBatchList(orgid), "Id", "Name", BatchId);
            ViewBag.ClassId   = new SelectList(ddl.GetClassList(orgid), "Id", "Name", ClassId);
            ViewBag.SectionId = new SelectList(ddl.GetSectionList(orgid), "Id", "Name", SectionId);
            ViewBag.StaffId   = new SelectList(ddl.GetStaffList(orgid), "Id", "Name", StaffId);
            ViewBag.StudentId = new SelectList(ddl.GetStudentList(orgid, 0, 0, 0), "Id", "Name", StudentId);
            return(View(lst));
        }
        // GET: Category
        public ActionResult Index(int CategoryId = 0, int AssetItemId = 0, string AssetCode = "", int BranchId = 0, int LocationId = 0)
        {
            var ses   = sesrepo.GetSessionById((User as CustomPrincipal).UserId);
            int orgid = ses.OrganizationId;

            //var lst = db.Gey(orgid, FromDate);
            ViewBag.AssetItemId = new SelectList(ddl.GetAssetItemList(orgid), "Id", "Name", AssetItemId);
            ViewBag.CategoryId  = new SelectList(ddl.GetCategoryList(orgid), "Id", "Name", CategoryId);
            ViewBag.BranchId    = new SelectList(ddl.GetBranchList(orgid), "Id", "Name", BranchId);
            ViewBag.LocationId  = new SelectList(ddl.GetLocationList(orgid), "Id", "Name", LocationId);


            return(View(db.GetAssetList(orgid, CategoryId, AssetItemId, AssetCode, BranchId, LocationId)));
        }
Exemple #8
0
        // GET: AcademicStudent
        public ActionResult Index(int BatchId = 0, int ClassId = 0, int SectionId = 0, string StudentRegNo = "")
        {
            var ses   = sesrepo.GetSessionById((User as CustomPrincipal).UserId);
            int orgid = ses.OrganizationId;

            ViewBag.BatchId   = new SelectList(ddl.GetBatchList(orgid), "Id", "Name", BatchId);
            ViewBag.ClassId   = new SelectList(ddl.GetClassList(orgid), "Id", "Name", ClassId);
            ViewBag.SectionId = new SelectList(ddl.GetSectionList(orgid), "Id", "Name", SectionId);

            return(View(db.GetAcademicStudentList(orgid, BatchId, ClassId, SectionId, StudentRegNo)));
        }
Exemple #9
0
        // GET: Category
        public ActionResult Index(string FromDate = "", string ToDate = "")
        {
            var ses   = sesrepo.GetSessionById((User as CustomPrincipal).UserId);
            int orgid = ses.OrganizationId;

            if (string.IsNullOrEmpty(FromDate))
            {
                FromDate = DateTime.Today.ToString("yyyy-MM-dd");
            }
            if (string.IsNullOrEmpty(ToDate))
            {
                ToDate = DateTime.Today.ToString("yyyy-MM-dd");
            }
            return(View(db.GetAssetItemList(orgid)));
        }
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            if ((CurrentUser != null && string.IsNullOrEmpty(Roles)))
            {
                return(true);
            }
            else
            if ((CurrentUser != null && !string.IsNullOrEmpty(Roles)))
            {
                var      fo       = false;
                string[] rolelist = Roles.Split(',');

                var sesssion1 = sesrepo.GetSessionById(CurrentUser.UserId);
                foreach (var r in rolelist)
                {
                    if (r == sesssion1.RoleId.ToString())
                    {
                        fo = true;
                        break;
                    }
                }
                return(fo);
            }
            else if (CurrentUser == null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
            //return ((CurrentUser != null && !CurrentUser.IsInRole(Roles)) || CurrentUser == null) ? false : true;
        }
        // GET: AssetTransfer
        public ActionResult Index()
        {
            var ses   = sesrepo.GetSessionById((User as CustomPrincipal).UserId);
            int orgid = ses.OrganizationId;
            var lst   = db.GetAssetTransferList();

            return(View(lst));
        }
        public ActionResult Create(FormCollection frm)
        {
            var ses = sesrepo.GetSessionById((User as CustomPrincipal).UserId);
            int orgid = ses.OrganizationId;
            MS_Category mS_Category = new MS_Category();
            mS_Category.CategoryName = frm["CategoryName"];
            mS_Category.CategoryCode = frm["CategoryCode"];
            mS_Category.OrganizationId = orgid;// Convert.ToInt32(frm["OrganizationId"]);
            mS_Category.EnteredBy = (User as CustomPrincipal).UserId;
            mS_Category.EnteredDate = DateTime.Now;
            if (ModelState.IsValid)
            {
                db.InsertCategory(mS_Category);
                return RedirectToAction("Index");
            }

            ViewBag.OrganizationId = new SelectList(ddl.GetOrganizationList(), "Id", "Name", mS_Category.OrganizationId);
            return View(mS_Category);
        }
Exemple #13
0
        // GET: Category/Edit/5
        public ActionResult Edit()
        {
            int userid = (User as CustomPrincipal).UserId;
            //if (id == null)
            //{
            //    return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            //}
            var     ses   = sesrepo.GetSessionById((User as CustomPrincipal).UserId);
            int     orgid = ses.OrganizationId;
            SC_User user  = db.GetUserById(userid);

            if (user == null)
            {
                return(HttpNotFound());
            }
            ViewBag.OrganizationId = new SelectList(ddl.GetOrganizationList(), "Id", "Name");
            //  ViewBag.UserId = new SelectList(ddl.GetAssetCategoryList(orgid), "Id", "Name", user.UserId);
            return(View(user));
        }
        // GET: AcademicClassSection/Details/5
        public ActionResult Details(int?id)
        {
            var ses   = sesrepo.GetSessionById((User as CustomPrincipal).UserId);
            int orgid = ses.OrganizationId;

            if (id == null || id == 0)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ACD_ClassSection aCD_ClassSection = db.GetAcademicClassSectionById((int)id);

            if (aCD_ClassSection == null)
            {
                return(HttpNotFound());
            }

            ViewBag.ClassId   = new SelectList(ddl.GetClassList(orgid), "Id", "Name", aCD_ClassSection.ClassId);
            ViewBag.SectionId = new SelectList(ddl.GetSectionList(orgid), "Id", "Name", aCD_ClassSection.SectionId);
            ViewBag.BatchId   = new SelectList(ddl.GetBatchList(orgid), "Id", "Name", aCD_ClassSection.BatchId);
            return(View(aCD_ClassSection));
        }
        public ActionResult Create(FormCollection frm)
        {
            var ses = sesrepo.GetSessionById((User as CustomPrincipal).UserId);
            int orgid = ses.OrganizationId;
            FA_DepreciationMethod method = new FA_DepreciationMethod();
            method.MethodName = frm["MethodName"];
            method.DepreciationRate = Convert.ToDecimal(frm["DepreciationRate"]);
            method.Description = frm["Description"];
            method.OrganizationId = orgid;// Convert.ToInt32(frm["OrganizationId"]);
            method.EnteredBy = (User as CustomPrincipal).UserId;
            method.EnteredDate = DateTime.Now;
            method.IsDeleted = false;

            if (ModelState.IsValid)
            {
                db.InsertDepreciationMethod(method);
                return RedirectToAction("Index");
            }

            //ViewBag.OrganizationId = new SelectList(ddl.GetOrganizationList(), "Id", "Name", mS_Category.OrganizationId);
            return View(method);
        }
        // GET: StockItem
        public ActionResult Index()
        {
            var ses   = sesrepo.GetSessionById((User as CustomPrincipal).UserId);
            int orgid = ses.OrganizationId;

            var lst = db.GetStockItemList(orgid);

            //ViewBag.BatchId = new SelectList(ddl.GetBatchList(orgid), "Id", "Name", BatchId);
            //ViewBag.ClassId = new SelectList(ddl.GetClassList(orgid), "Id", "Name", ClassId);
            //ViewBag.SectionId = new SelectList(ddl.GetSectionList(orgid), "Id", "Name", SectionId);
            //ViewBag.StaffId = new SelectList(ddl.GetStaffList(orgid), "Id", "Name", StaffId);
            //ViewBag.StudentId = new SelectList(ddl.GetStudentList(orgid, 0, 0, 0), "Id", "Name", StudentId);
            return(View(lst));
        }
Exemple #17
0
        // GET: Item
        public ActionResult Index(string ItemName = "", string ItemCode = "", int CategoryName = 0)
        {
            var ses   = sesrepo.GetSessionById((User as CustomPrincipal).UserId);
            int orgid = ses.OrganizationId;

            ViewBag.CategoryId = new SelectList(ddl.GetCategoryList(orgid), "Id", "Name");
            //ViewBag.ItemName = new SelectList(ddl.GetItemList(orgid), "Id", "Name", ItemName);
            //ViewBag.ItemCode = new SelectList(ddl.GetCategoryList(orgid), "Id", "Name", Category);
            return(View(db.GetItemList(orgid, ItemName, ItemCode, CategoryName)));
        }
        // GET: InventorySales
        public ActionResult Index(string FromDate = "", string ToDate = "", string BillNo = "", int VendorId = 0)
        {
            var ses   = sesrepo.GetSessionById((User as CustomPrincipal).UserId);
            int orgid = ses.OrganizationId;
            //if (string.IsNullOrEmpty(FromDate))
            //{
            //    FromDate = DateTime.Today.ToString("yyyy-MM-dd");
            //}
            //if (string.IsNullOrEmpty(ToDate))
            //{
            //    ToDate = DateTime.Today.ToString("yyyy-MM-dd");
            //}

            var lst = db.GetPurchaseList(orgid, FromDate, ToDate, BillNo, VendorId);

            ViewBag.VendorId = new SelectList(ddl.GetInvVenodrList(orgid), "Id", "Name", VendorId);

            return(View(lst));
        }
        public JsonResult GetStudentByBatchClassSection(int batchid = 0, int classid = 0, int sectionid = 0)
        {
            var        ses      = sesrepo.GetSessionById((User as CustomPrincipal).UserId);
            int        orgid    = ses.OrganizationId;
            JsonResult result   = new JsonResult();
            var        matching = ddl.GetStudentList(orgid, batchid, classid, sectionid);


            string msg = "<option value=''>-- Select --</option>";// "<option>-- Select --</option>";

            foreach (var item in matching)
            {
                msg += "<option value='" + item.Id + "'>" + item.Name + "</option>";
            }

            result.Data = msg;

            return(result);
        }
Exemple #20
0
        public ActionResult Index(string Email, string Password, string OrganizationId, string returnUrl)
        {
            ViewBag.Message        = "";
            ViewBag.SuccessMessage = "";
            if (Membership.ValidateUser(Email, Password))
            // if (userrepo.ValidateUser(loginView.Email, loginView.Password))
            {
                var user       = (CustomMembershipUser)Membership.GetUser(Email, false);
                var userdetail = db.getPersonalDetail(user.UserId);
                if (user != null)
                {
                    SessionVM userModel = new SessionVM()
                    {
                        UserId   = user.UserId,
                        FullName = user.FullName,
                        Email    = user.Email,
                        //ActualRoleId = user.RoleId,
                        RoleId  = user.RoleId,
                        IsAdmin = user.IsAdmin,

                        //IsManager= confirmer.IsReportingManager(user.PersonalId);
                    };
                    SessionRepo sesrepo = new SessionRepo();
                    var         ses     = sesrepo.GetSessionById(user.UserId);
                    if (ses == null)
                    {
                        sesrepo.AddSession(new SC_LoginHistory()
                        {
                            UserId               = user.UserId,
                            LoginDate            = DateTime.Now,
                            RoleId               = 0,
                            OrganizationId       = (int)userdetail.OrganizationId, //Convert.ToInt32(OrganizationId),
                            ActualOrganizationId = (int)userdetail.OrganizationId, // Convert.ToInt32(OrganizationId),
                            LogOutDate           = DateTime.Now.AddMinutes(1200),
                        });
                    }
                    else
                    {
                        sesrepo.EditSession(new SC_LoginHistory()
                        {
                            UserId               = user.UserId,
                            LoginDate            = DateTime.Now,
                            RoleId               = 0,
                            OrganizationId       = (int)userdetail.OrganizationId, //Convert.ToInt32(OrganizationId),
                            ActualOrganizationId = (int)userdetail.OrganizationId, // Convert.ToInt32(OrganizationId),
                            LogOutDate           = DateTime.Now.AddMinutes(1200),
                            LoginId              = ses.LoginId
                        });
                    }
                    string userData = JsonConvert.SerializeObject(userModel);
                    FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket
                                                           (
                        1, user.Email, DateTime.Now, DateTime.Now.AddMinutes(1200), false, userData
                                                           );

                    string     enTicket = FormsAuthentication.Encrypt(authTicket);
                    HttpCookie faCookie = new HttpCookie("CookieUNITED1", enTicket);
                    faCookie.Expires = DateTime.Now.AddMinutes(1200);
                    Response.Cookies.Add(faCookie);
                }

                if (Url.IsLocalUrl(returnUrl))
                {
                    return(Redirect(returnUrl));
                }
                else
                {
                    if (Password == "password")
                    {
                        return(RedirectToAction("ChangePassword", "Profile"));
                    }
                    return(RedirectToAction("Index", "Dashboard"));
                    //return RedirectToAction("Index", "Dashboard");
                }
            }
            else
            {
                ViewBag.Message = "Specified User doesn't exists";
            }
            return(View());
        }