예제 #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);
            }
        }
예제 #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));
        }
예제 #3
0
        public void AddFlag(long siteId, long[] formItemIds, string[] flags)
        {
            if (formItemIds == null || formItemIds.Length == 0 || flags == null || flags.Length == 0)
            {
                return;
            }

            IEnumerable <FormItem> formItems = FormItemDAO.GetItems(formItemIds);

            foreach (FormItem item in formItems)
            {
                foreach (string flag in flags)
                {
                    UserFlagDAO.SetItem(siteId, flag, item.Email, item.Mobile, item.Phone, item.IDCard);
                }
            }
        }
예제 #4
0
 public ActionResult AddFlag(long siteId)
 {
     ViewBag.SiteID = siteId;
     ViewBag.Flags  = UserFlagDAO.GetFlags(siteId);
     return(View());
 }