public ActionResult Add(Pushmessage_Lv model, List<string> sendPlatForm, int chooseType, bool isRedirect)
        {
            ViewData.Model = model;
            int id = model.Id;

            //todo 为什么这个不能直接拼接呢?
            model.SendPlatForm = sendPlatForm.ConvertToString();
            model.CreateBy = model.UpdateBy = userId;

            if (chooseType == 1)//==1 表示報團,需要加上改地址
            {
                if (!model.Link.Contains("http://apps.bigline.com.hk/api/mssage.php?typeId=1&categoryID=&categoryName=&tourId="))
                    model.Link = "http://apps.bigline.com.hk/api/mssage.php?typeId=1&categoryID=&categoryName=&tourId=" + model.Link;
            }
            service.AddOrUpdate(model);
            if (isRedirect)
            {
                return RedirectToAction("Index");
            }
            else
            {
                if (id > 0)
                {
                    AddAlertMsg("修改成功");
                }
                else
                {
                    AddAlertMsg("新增成功");
                }
            }

            return View(model);
        }
Example #2
0
        protected void add_buletin(object sender, EventArgs e)
        {
            if (selectedVals.InnerText == "")
            {
                System.Web.HttpContext.Current.Response.Write("<SCRIPT LANGUAGE=\"JavaScript\">alert(\"Немае отримувачів. Потрібно вибрати отримувача та натиснути кнопку Вибрати\")</SCRIPT>");
                return;
            }
            var list = new List<BulletinLink>();
            var split = Result.Split(new[] { " | " }, StringSplitOptions.RemoveEmptyEntries);
            Result = "";
            selectedVals.InnerText = Result;
            foreach (var s in split)
            {
                var link = new BulletinLink(-1, _allowedProfile.First(a => a.Name == s).Id, -1, -1);
                list.Add(link);
            }

            var t = DateTime.Today.ToShortDateString();
            CampusClient.DeskAddBulletein(
                CurrentUser.UserAccountId,
                CurrentUser.FullName,
                DateTime.Today.ToShortDateString(),
                DateTime.Parse(dateStart_d.Text + "/" + dateStart_m.Text + "/" + dateStart_y.Text)
                    .ToShortDateString(),
                DateTime.Parse(dateEnd_d.Text + "/" + dateEnd_m.Text + "/" + dateEnd_y.Text).ToShortDateString(),
                sub_text.Text,
                text_text.Text,
                list.ConvertToString()
                );
            ResetBoard();

        }