public static PassIssueHed MapModelToHed(PassRequestHed passReq)
        {
            PassIssueHed Obj = new PassIssueHed();

            Obj.PassReqNo = passReq.PassReqNo;
            Obj.ValidFrom = passReq.RequiredFrom;
            Obj.ValidTo   = passReq.RequiredTo;
            Obj.IssueDate = DateTime.Today.Date;

            return(Obj);
        }
Exemple #2
0
        public int SavePassIssueHed(PassIssueHed Hed)
        {
            Hed.AddDate = DateTime.Now;
            Hed.AddUser = WebSecurity.CurrentUserName;

            if (ModelState.IsValid)
            {
                db.PassIssueHeds.Add(Hed);
                db.SaveChanges();
            }

            return(Hed.PassNo);
        }