Ejemplo n.º 1
0
 /// <summary>
 /// 将DB中联系人的信息封装为TXT需要的模板
 /// </summary>
 /// <param name="person"></param>
 /// <param name="group"></param>
 /// <returns></returns>
 public static ViewModel.PersonModel getPersonModelFromDB(P_PersonInfo person, P_Group group)
 {
     ViewModel.PersonModel model = new ViewModel.PersonModel()
     {
         DepartmentName = person.P_DepartmentInfo.FirstOrDefault().DepartmentName,
         GroupName = group.GroupName,
         GroupSort = group.Sort,
         PersonName = person.PName,
         Phone = person.PhoneNum
     };
     return model;
 }
Ejemplo n.º 2
0
        public ActionResult DoAddGroupInfo(P_Group groupModel)
        {
            //创建一个新的Action方法,需要对未提交的属性进行初始化赋值
            //数据验证
            if (groupBLL.AddValidation(groupModel.GroupName)) { return Content("validation fails"); }
            groupModel.isDel = false;
            groupModel.SubTime = DateTime.Now;
            groupModel.ModifiedOnTime = DateTime.Now;

            try
            {
                groupBLL.Create(groupModel);
                return Content("ok");
            }
            catch
            {
                return Content("error");
            }
        }
Ejemplo n.º 3
0
        public ActionResult DoEditGroupInfo(P_Group groupModel)
        {
            if(groupBLL.EditValidation(groupModel.GID, groupModel.GroupName)) { return Content("validation fails"); }
            //创建一个新的Action方法,需要对未提交的属性进行初始化赋值
            groupModel.isDel = false;
            groupModel.ModifiedOnTime = DateTime.Now;

            try
            {
                groupBLL.Update(groupModel);
                return Content("ok");
            }
            catch
            {
                    return Content("error");
             }
        }