Ejemplo n.º 1
0
        public void ModifyFlag(long siteId, long formItemId, string[] flags)
        {
            FormItem             formItem = FormItemDAO.GetItem(formItemId);
            IEnumerable <string> oldFlags = UserFlagDAO.GetFlags(siteId, formItem.Email, formItem.Mobile, formItem.Phone, formItem.IDCard);

            if (flags == null)
            {
                flags = new string[] { }
            }
            ;
            if (oldFlags == null)
            {
                oldFlags = new string[] { }
            }
            ;

            IEnumerable <string> addFlags = flags.Except(oldFlags);

            foreach (string flag in addFlags)
            {
                UserFlagDAO.SetItem(siteId, flag, formItem.Email, formItem.Mobile, formItem.Phone, formItem.IDCard);
            }

            IEnumerable <string> delFlags = oldFlags.Except(flags);

            foreach (string flag in delFlags)
            {
                UserFlagDAO.Delete(siteId, flag, formItem.Email, formItem.Mobile, formItem.Phone, formItem.IDCard);
            }
        }
Ejemplo n.º 2
0
        public ActionResult ModifyFlag(long siteId, long formItemId)
        {
            FormItem             formItem = FormItemDAO.GetItem(formItemId);
            IEnumerable <string> flags    = UserFlagDAO.GetFlags(siteId, formItem.Email, formItem.Mobile, formItem.Phone, formItem.IDCard);

            ViewBag.SiteID     = siteId;
            ViewBag.FormItemID = formItemId;
            ViewBag.AllFlags   = UserFlagDAO.GetFlags(siteId);
            return(View(flags));
        }
Ejemplo n.º 3
0
 public ActionResult AddFlag(long siteId)
 {
     ViewBag.SiteID = siteId;
     ViewBag.Flags  = UserFlagDAO.GetFlags(siteId);
     return(View());
 }