Ejemplo n.º 1
0
        //update SecurityForm object
        public bool Update(SecurityFormAction pSecurityFormAction)
        {
            try
            {
                if (pSecurityFormAction.ID > 0)
                {
                    SecurityFormAction vSecurityFormAction = rep.Find(pSecurityFormAction.ID);
                    if (vSecurityFormAction != null)
                    {
                        //vSecurityFormAction.ID = pSecurityFormAction.ID;
                        //vSecurityFormAction.ApplicationCode = pSecurityFormAction.ApplicationCode;
                        //vSecurityFormAction.FormCode = pSecurityFormAction.FormCode;
                        //vSecurityFormAction.FormActionCode = pSecurityFormAction.FormActionCode;
                        vSecurityFormAction.FormActionName = pSecurityFormAction.FormActionName;
                        vSecurityFormAction.Remarks        = pSecurityFormAction.Remarks;
                        vSecurityFormAction.ActiveFlag     = pSecurityFormAction.ActiveFlag;
                        //vSecurityFormAction.ApplicationID = pSecurityFormAction.ApplicationID;
                        //vSecurityFormAction.FormID = pSecurityFormAction.FormID;

                        rep.Edit(vSecurityFormAction);
                        rep.SaveChanges();
                        return(true);
                    }
                }
                return(false);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
        //insert SecurityForm object
        public bool Insert(SecurityFormAction pSecurityFormAction)
        {
            try
            {
                //pSecurityFormAction.ID = GetMaxID();

                pSecurityFormAction.ApplicationCode = pSecurityFormAction.ApplicationCode;
                pSecurityFormAction.FormCode        = pSecurityFormAction.FormCode;

                pSecurityFormAction.FormActionCode = GetMaxCode(pSecurityFormAction.ApplicationCode, pSecurityFormAction.FormCode);

                pSecurityFormAction.FormActionName = pSecurityFormAction.FormActionName;
                pSecurityFormAction.Remarks        = pSecurityFormAction.Remarks;
                pSecurityFormAction.ActiveFlag     = pSecurityFormAction.ActiveFlag;

                rep.Add(pSecurityFormAction);
                rep.SaveChanges();

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public ActionResult Edit(SecurityFormAction pFormAction)
 {
     if (ModelState.IsValid)
     {
         if (oFormActionBLL.Update(pFormAction))
         {
             return(RedirectToAction("Index", new { pApplicationCode = pFormAction.ApplicationCode, pFormCode = pFormAction.FormCode }));
         }
     }
     return(View());
 }
        //POST: /User/Create

        public ActionResult Create(string pApplicationCode, string pFormCode)
        {
            SecurityForm       vForm       = oFormBLL.GetByCode(pApplicationCode, pFormCode);
            SecurityFormAction vFormAction = new SecurityFormAction();

            vFormAction.ApplicationCode = vForm.ApplicationCode;
            vFormAction.ApplicationName = vForm.ApplicationName;
            vFormAction.FormCode        = vForm.FormCode;
            vFormAction.FormName        = vForm.FormName;
            vFormAction.ActiveFlag      = "Y";

            return(View(vFormAction));
        }
Ejemplo n.º 5
0
        public SecurityFormAction GetBasic_SecurityFormAction(SecurityForm pSecurityForm, string pFormActionCode, string pFormActionName)
        {
            SecurityFormAction vAction = new SecurityFormAction();

            vAction.ID = 0;
            vAction.ApplicationCode = pSecurityForm.ApplicationCode;
            vAction.FormCode        = pSecurityForm.FormCode;
            vAction.FormActionCode  = pFormActionCode; //<<<<<<<<<<<<<<<<<
            vAction.FormActionName  = pFormActionName; //<<<<<<<<<<<<<<<<<
            vAction.Remarks         = string.Empty;
            vAction.ActiveFlag      = "Y";
            return(vAction);
        }
        public ActionResult Edit(string pApplicationCode, string pFormCode, string pFormActionCode)
        {
            SecurityFormAction vFormAction = oFormActionBLL.GetByCode(pApplicationCode, pFormCode, pFormActionCode);

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

            SecurityForm vForm = oFormBLL.GetByCode(pApplicationCode, pFormCode);

            vFormAction.ApplicationName = vForm.ApplicationName;
            vFormAction.FormName        = vForm.FormName;

            return(View(vFormAction));
        }