Esempio n. 1
0
        /// <summary>
        /// 设置为宝贝回家案例
        /// </summary>
        /// <param name="id">要设置的案例ID</param>
        /// <returns></returns>
        public bool Bbhj(string id)
        {
            using (var db = new SRISDBEntities())
            {
                var tran = db.Database.BeginTransaction();
                try
                {
                    // 修改案例状态为宝贝回家案例
                    RegisterInfo model = db.RegisterInfo.Find(id);
                    model.IsBBHJ = 1;

                    // 宝贝回家表添加数据
                    BBHJInfo bbModel = new BBHJInfo()
                    {
                        BBHJCode       = "",
                        BBHJInfoID     = System.Guid.NewGuid().ToString(),
                        CreateDateTime = DateTime.Now,
                        GuideTime      = DateTime.Now,
                        RegisterInfoID = id,
                        Remark         = "",
                        Volunteer      = ""
                    };
                    db.BBHJInfo.Add(bbModel);

                    db.SaveChanges();
                    tran.Commit();
                    return(true);
                }
                catch (Exception e)
                {
                    tran.Rollback();
                    return(false);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 创建一条案例信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool CreateRegister(RegisterInfo model)
        {
            using (var db = new SRISDBEntities())
            {
                db.RegisterInfo.Add(model);
                FollowDetails fdModel = new FollowDetails()
                {
                    CaseId         = model.RegisterInfoID,
                    CreateDataTime = DateTime.Now,
                    Id             = System.Guid.NewGuid().ToString(),
                    ImageUrl       = "",
                    MesText        = "添加案例"
                };
                db.FollowDetails.Add(fdModel);

                if (db.SaveChanges() > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
Esempio n. 3
0
 /// <summary>
 /// 新用户注册
 /// </summary>
 /// <param name="model">用户注册信息实体类</param>
 /// <returns></returns>
 public bool Register(UserInfo model)
 {
     using (var db = new SRISDBEntities())
     {
         db.UserInfo.Add(model);
         db.SaveChanges();
         return(true);
     }
 }
Esempio n. 4
0
 /// <summary>
 /// 删除案例登记信息
 /// </summary>
 /// <param name="id">案例登记ID</param>
 /// <returns></returns>
 public bool DelRegisterInfo(string id)
 {
     using (var db = new SRISDBEntities())
     {
         RegisterInfo model = db.RegisterInfo.Find(id);
         model.IsDelete = 1;
         db.SaveChanges();
         return(true);
     }
 }
Esempio n. 5
0
 /// <summary>
 /// 创建宝贝回家案例
 /// </summary>
 /// <param name="model">宝贝回家案例实体类</param>
 /// <returns></returns>
 public bool CreateBBHJCase(BBHJInfo model)
 {
     using (var db = new SRISDBEntities())
     {
         db.BBHJInfo.Add(model);
         RegisterInfo info = db.RegisterInfo.Find(model.RegisterInfoID);
         info.IsBBHJ = 1;
         db.SaveChanges();
         return(true);
     }
 }
Esempio n. 6
0
 /// <summary>
 /// 修改案例跟进信息
 /// </summary>
 /// <param name="model">案例跟进信息实体类</param>
 /// <returns></returns>
 public bool UpdateFollowDetails(FollowDetails model)
 {
     using (var db = new SRISDBEntities())
     {
         FollowDetails dfModel = db.FollowDetails.Find(model.Id);
         dfModel.ImageUrl = model.ImageUrl;
         dfModel.MesText  = model.MesText;
         db.SaveChanges();
         return(true);
     }
 }
Esempio n. 7
0
 /// <summary>
 /// 创建联系人信息
 /// </summary>
 /// <param name="model">联系人信息实体类</param>
 /// <returns></returns>
 public bool CreateLinkMan(LinkMan model)
 {
     using (var db = new SRISDBEntities())
     {
         db.LinkMan.Add(model);
         if (db.SaveChanges() > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Esempio n. 8
0
 /// <summary>
 /// 删除跟进信息
 /// </summary>
 /// <param name="id">跟进信息ID</param>
 /// <returns></returns>
 public bool DelFollowDetail(string id)
 {
     using (var db = new SRISDBEntities())
     {
         FollowDetails model = db.FollowDetails.Find(id);
         model.IsDel = 1;
         if (db.SaveChanges() > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Esempio n. 9
0
 /// <summary>
 /// 设置为成功案例
 /// </summary>
 /// <param name="id">案例ID</param>
 /// <returns></returns>
 public bool SetSuccess(string id)
 {
     using (var db = new SRISDBEntities())
     {
         RegisterInfo model = db.RegisterInfo.Find(id);
         if (model != null)
         {
             model.IsSuccess = 1;
             db.SaveChanges();
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Esempio n. 10
0
 /// <summary>
 /// 修改案例信息
 /// </summary>
 /// <param name="model">案例信息实体类</param>
 /// <returns></returns>
 public bool UpdateRegisterInfo(RegisterInfo model)
 {
     using (var db = new SRISDBEntities())
     {
         RegisterInfo md = db.RegisterInfo.Find(model.RegisterInfoID);
         md.BeSeekerName    = model.BeSeekerName;
         md.CaseCode        = model.CaseCode;
         md.GetTaskDateTime = model.GetTaskDateTime;
         md.PostLink        = model.PostLink;
         md.RegisterLink    = model.RegisterLink;
         md.Remarks         = model.Remarks;
         md.SRTypeID        = model.SRTypeID;
         md.Title           = model.Title;
         md.IsReturnTask    = model.IsReturnTask;
         md.ReturnReason    = model.ReturnReason;
         db.SaveChanges();
         return(true);
     }
 }
Esempio n. 11
0
 /// <summary>
 /// 新建跟进信息
 /// </summary>
 /// <param name="imageUrl">上传图片</param>
 /// <param name="gjxx">跟进信息</param>
 /// <param name="id">案例ID</param>
 /// <returns></returns>
 public bool CreateFollowDetail(string imageUrl, string gjxx, string id)
 {
     using (var db = new SRISDBEntities())
     {
         FollowDetails model = new FollowDetails()
         {
             CaseId         = id,
             CreateDataTime = DateTime.Now,
             Id             = Guid.NewGuid().ToString(),
             ImageUrl       = imageUrl,
             MesText        = gjxx
         };
         db.FollowDetails.Add(model);
         if (db.SaveChanges() > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Esempio n. 12
0
 /// <summary>
 /// 修改联系人信息
 /// </summary>
 /// <param name="model">联系人信息实体类</param>
 /// <returns></returns>
 public bool UpdateLinkMan(LinkMan model)
 {
     using (var db = new SRISDBEntities())
     {
         LinkMan linkManModel = db.LinkMan.Find(model.LinkManID);
         linkManModel.Address        = model.Address;
         linkManModel.Birthday       = model.Birthday;
         linkManModel.Career         = model.Career;
         linkManModel.CreateDateTime = model.CreateDateTime;
         linkManModel.Email          = model.Email;
         linkManModel.IdCardNo       = model.IdCardNo;
         linkManModel.LinkManName    = model.LinkManName;
         linkManModel.OtherLink      = model.OtherLink;
         linkManModel.Phone          = model.Phone;
         linkManModel.QQ             = model.QQ;
         linkManModel.Relationship   = model.Relationship;
         linkManModel.Remark         = model.Remark;
         linkManModel.Sex            = model.Sex;
         linkManModel.TelPhone       = model.TelPhone;
         linkManModel.WeiXin         = model.WeiXin;
         db.SaveChanges();
         return(true);
     }
 }