protected void init_form(string ctrID)
        {
            if (!string.IsNullOrEmpty(ctrID))
            {
                _WG_MenberEntity = DataProvider.GetInstance().GetWG_MenberEntity(int.Parse(ctrID));

                TextBox_NickName.Text = _WG_MenberEntity.NickName.ToString();
                TextBox_Name.Text = _WG_MenberEntity.Name.ToString();
                //TextBox_Psw.Text = _WG_MenberEntity.Psw.ToString();
                TextBox_Scores.Text = _WG_MenberEntity.Scores.ToString();
                TextBox_Sex.Text = _WG_MenberEntity.Sex.ToString();
                TextBox_Birthday.Text = _WG_MenberEntity.Birthday.ToString();
                TextBox_Email.Text = _WG_MenberEntity.Email.ToString();
                TextBox_Flag.Text = _WG_MenberEntity.Flag.ToString();
                TextBox_PhotoUrl.Text = _WG_MenberEntity.PhotoUrl.ToString();
                TextBox_Country.Text = _WG_MenberEntity.Country.ToString();
                TextBox_Province.Text = _WG_MenberEntity.Province.ToString();
                TextBox_City.Text = _WG_MenberEntity.City.ToString();
                TextBox_District.Text = _WG_MenberEntity.District.ToString();
                TextBox_Town.Text = _WG_MenberEntity.Town.ToString();
                TextBox_Community.Text = _WG_MenberEntity.Community.ToString();
                TextBox_Phone.Text = _WG_MenberEntity.Phone.ToString();
                TextBox_WeChat.Text = _WG_MenberEntity.WeChat.ToString();
                TextBox_QQ.Text = _WG_MenberEntity.QQ.ToString();
                TextBox_PersonalID.Text = _WG_MenberEntity.PersonalID.ToString();
                TextBox_Address.Text = _WG_MenberEntity.Address.ToString();
                TextBox_Education.Text = _WG_MenberEntity.Education.ToString();
                TextBox_Major.Text = _WG_MenberEntity.Major.ToString();
                TextBox_SpecialSkill.Text = _WG_MenberEntity.SpecialSkill.ToString();
                TextBox_ServiceIntention.Text = _WG_MenberEntity.ServiceIntention.ToString();
                TextBox_ServiceTimeInterval.Text = _WG_MenberEntity.ServiceTimeInterval.ToString();
                TextBox_ServiceHours.Text = _WG_MenberEntity.ServiceHours.ToString();
                TextBox_Status.Text = _WG_MenberEntity.Status.ToString();
            }
        }
        protected void WG_MenberAdd()
        {
            #region 判断是否可空


            var _NickName = Request.Form["TextBox_NickName"];


            var _Name = Request.Form["TextBox_Name"];
            if (string.IsNullOrEmpty(_Name))
            {
                Alert("[ 会员名称 ]不能为空");
                return;
            }

            var _Psw = Request.Form["TextBox_Psw"];

            var _Scores = Request.Form["TextBox_Scores"];


            var _Sex = Request.Form["TextBox_Sex"];


            var _Birthday = Request.Form["TextBox_Birthday"];


            var _Email = Request.Form["TextBox_Email"];


            var _Flag = Request.Form["TextBox_Flag"];


            var _PhotoUrl = Request.Form["TextBox_PhotoUrl"];


            var _Country = Request.Form["TextBox_Country"];

            var _Province = Request.Form["TextBox_Province"];


            var _City = Request.Form["TextBox_City"];


            var _District = Request.Form["TextBox_District"];

            var _Town = Request.Form["TextBox_Town"];

            var _Community = Request.Form["TextBox_Community"];

            var _Phone = Request.Form["TextBox_Phone"];


            var _WeChat = Request.Form["TextBox_WeChat"];


            var _QQ = Request.Form["TextBox_QQ"];

            var _PersonalID = Request.Form["TextBox_PersonalID"];


            var _Address = Request.Form["TextBox_Address"];


            var _Education = Request.Form["TextBox_Education"];

            var _Major = Request.Form["TextBox_Major"];


            var _SpecialSkill = Request.Form["TextBox_SpecialSkill"];


            var _ServiceIntention = Request.Form["TextBox_ServiceIntention"];


            var _ServiceTimeInterval = Request.Form["TextBox_ServiceTimeInterval"];


            var _ServiceHours = Request.Form["TextBox_ServiceHours"];


            var _Status = Request.Form["TextBox_Status"];
            if (string.IsNullOrEmpty(_Status))
            {
                Alert("[ 当前状态 ]不能为空");
                return;
            }

            #endregion

            #region 获取数据

            WG_MenberEntity _WG_MenberEntity = new WG_MenberEntity();



            _WG_MenberEntity.NickName = Convert.ToString(_NickName.ToString());


            _WG_MenberEntity.Name = Convert.ToString(_Name.ToString());

            //要MD5
            string pswMD5 = MD5Encrypt.MD5Hash(_Psw.ToString());
            _WG_MenberEntity.Psw = Convert.ToString(pswMD5);

            _WG_MenberEntity.Scores = Convert.ToInt32(_Scores.ToString());


            _WG_MenberEntity.Sex = Convert.ToString(_Sex.ToString());


            _WG_MenberEntity.Birthday = Convert.ToString(_Birthday.ToString());


            _WG_MenberEntity.Email = Convert.ToString(_Email.ToString());

            _WG_MenberEntity.Flag = Convert.ToInt32(_Flag.ToString());


            _WG_MenberEntity.PhotoUrl = Convert.ToString(_PhotoUrl.ToString());


            _WG_MenberEntity.Country = Convert.ToString(_Country.ToString());


            _WG_MenberEntity.Province = Convert.ToString(_Province.ToString());


            _WG_MenberEntity.City = Convert.ToString(_City.ToString());


            _WG_MenberEntity.District = Convert.ToString(_District.ToString());


            _WG_MenberEntity.Community = Convert.ToString(_Community.ToString());

            _WG_MenberEntity.Town = Convert.ToString(_Town.ToString());

            _WG_MenberEntity.Phone = Convert.ToString(_Phone.ToString());


            _WG_MenberEntity.WeChat = Convert.ToString(_WeChat.ToString());


            _WG_MenberEntity.QQ = Convert.ToString(_QQ.ToString());


            _WG_MenberEntity.PersonalID = Convert.ToString(_PersonalID.ToString());


            _WG_MenberEntity.Address = Convert.ToString(_Address.ToString());


            _WG_MenberEntity.Education = Convert.ToString(_Education.ToString());


            _WG_MenberEntity.Major = Convert.ToString(_Major.ToString());


            _WG_MenberEntity.SpecialSkill = Convert.ToString(_SpecialSkill.ToString());


            _WG_MenberEntity.ServiceIntention = Convert.ToString(_ServiceIntention.ToString());


            _WG_MenberEntity.ServiceTimeInterval = Convert.ToString(_ServiceTimeInterval.ToString());

            _WG_MenberEntity.ServiceHours = Convert.ToInt32(_ServiceHours.ToString());

            _WG_MenberEntity.Status = Convert.ToInt32(_Status.ToString());

            _WG_MenberEntity.CreateDate = DateTime.Now;

            _WG_MenberEntity.UpdateDate = DateTime.Now;
            try
            {
                DataProvider.GetInstance().AddWG_Menber(_WG_MenberEntity);
            }
            catch
            {
                WriteLog("WG_MenberAdd", "添加WG_Menber", "插入数据库时出错", Common.DailyUtility.MideSmsType.LogType.SystemLog);
                Alert("添加数据时出错,请重试");
                return;
            }
            Alert("添加WG_Menber成功");
        }
        private MideFrameWork.Data.Entity.WG_MenberEntity GetWG_Menber(DataRow dr)
        {
            MideFrameWork.Data.Entity.WG_MenberEntity info = new MideFrameWork.Data.Entity.WG_MenberEntity();
										if(DBNull.Value==dr["ID"])
					info.ID=0;
				else
					info.ID=int.Parse(dr["ID"].ToString());
									
																								
						if(DBNull.Value==dr["NickName"])
				info.NickName= string.Empty;
			else	
				info.NickName= dr["NickName"].ToString();
																								
						if(DBNull.Value==dr["Name"])
				info.Name= string.Empty;
			else	
				info.Name= dr["Name"].ToString();
																								
						if(DBNull.Value==dr["Psw"])
				info.Psw= string.Empty;
			else	
				info.Psw= dr["Psw"].ToString();
																						if(DBNull.Value==dr["Scores"])
					info.Scores=0;
				else
					info.Scores=int.Parse(dr["Scores"].ToString());
									
																								
						if(DBNull.Value==dr["Sex"])
				info.Sex= string.Empty;
			else	
				info.Sex= dr["Sex"].ToString();
																								
						if(DBNull.Value==dr["Birthday"])
				info.Birthday= string.Empty;
			else	
				info.Birthday= dr["Birthday"].ToString();
																								
						if(DBNull.Value==dr["Email"])
				info.Email= string.Empty;
			else	
				info.Email= dr["Email"].ToString();
																						if(DBNull.Value==dr["Flag"])
					info.Flag=0;
				else
					info.Flag=int.Parse(dr["Flag"].ToString());
									
																								
						if(DBNull.Value==dr["PhotoUrl"])
				info.PhotoUrl= string.Empty;
			else	
				info.PhotoUrl= dr["PhotoUrl"].ToString();
																								
						if(DBNull.Value==dr["Country"])
				info.Country= string.Empty;
			else	
				info.Country= dr["Country"].ToString();
																								
						if(DBNull.Value==dr["Province"])
				info.Province= string.Empty;
			else	
				info.Province= dr["Province"].ToString();
																								
						if(DBNull.Value==dr["City"])
				info.City= string.Empty;
			else	
				info.City= dr["City"].ToString();
																								
						if(DBNull.Value==dr["District"])
				info.District= string.Empty;
			else	
				info.District= dr["District"].ToString();
																								
						if(DBNull.Value==dr["Town"])
				info.Town= string.Empty;
			else	
				info.Town= dr["Town"].ToString();
																								
						if(DBNull.Value==dr["Community"])
				info.Community= string.Empty;
			else	
				info.Community= dr["Community"].ToString();
																								
						if(DBNull.Value==dr["Phone"])
				info.Phone= string.Empty;
			else	
				info.Phone= dr["Phone"].ToString();
																								
						if(DBNull.Value==dr["WeChat"])
				info.WeChat= string.Empty;
			else	
				info.WeChat= dr["WeChat"].ToString();
																								
						if(DBNull.Value==dr["QQ"])
				info.QQ= string.Empty;
			else	
				info.QQ= dr["QQ"].ToString();
																								
						if(DBNull.Value==dr["PersonalID"])
				info.PersonalID= string.Empty;
			else	
				info.PersonalID= dr["PersonalID"].ToString();
																								
						if(DBNull.Value==dr["Address"])
				info.Address= string.Empty;
			else	
				info.Address= dr["Address"].ToString();
																								
						if(DBNull.Value==dr["Education"])
				info.Education= string.Empty;
			else	
				info.Education= dr["Education"].ToString();
																								
						if(DBNull.Value==dr["Major"])
				info.Major= string.Empty;
			else	
				info.Major= dr["Major"].ToString();
																								
						if(DBNull.Value==dr["SpecialSkill"])
				info.SpecialSkill= string.Empty;
			else	
				info.SpecialSkill= dr["SpecialSkill"].ToString();
																								
						if(DBNull.Value==dr["ServiceIntention"])
				info.ServiceIntention= string.Empty;
			else	
				info.ServiceIntention= dr["ServiceIntention"].ToString();
																								
						if(DBNull.Value==dr["ServiceTimeInterval"])
				info.ServiceTimeInterval= string.Empty;
			else	
				info.ServiceTimeInterval= dr["ServiceTimeInterval"].ToString();
																						if(DBNull.Value==dr["ServiceHours"])
					info.ServiceHours=0;
				else
					info.ServiceHours=int.Parse(dr["ServiceHours"].ToString());
									
																						if(DBNull.Value==dr["Status"])
					info.Status=0;
				else
					info.Status=int.Parse(dr["Status"].ToString());
									
																								
						if(DBNull.Value==dr["Verification"])
				info.Verification= string.Empty;
			else	
				info.Verification= dr["Verification"].ToString();
																								
						if(DBNull.Value==dr["Memo"])
				info.Memo= string.Empty;
			else	
				info.Memo= dr["Memo"].ToString();
																									if(DBNull.Value==dr["CreateDate"])
					info.CreateDate=DateTime.Now;
				else
					info.CreateDate=DateTime.Parse(dr["CreateDate"].ToString());
						
																									if(DBNull.Value==dr["UpdateDate"])
					info.UpdateDate=DateTime.Now;
				else
					info.UpdateDate=DateTime.Parse(dr["UpdateDate"].ToString());
						
															            return info;
        }
 protected void btn_OK_Click(object sender, EventArgs e)
 {
     if (IsTimeout)
     {
         ProcessTimeout();
         return;
     }
     string newPsw = txt_NewPsw.Text.Trim();
     string confirmPsw = txt_Confirm.Text.Trim();
     if (!newPsw.Equals(confirmPsw))
     {
         lbl_Hint.Text = "所输入密码不一致,请重新输入!";
         return;
     }
     else
     {
         if (newPsw.Length < 6)
         {
             lbl_Hint.Text = "密码长度不得小于6!";
         }
         else
         {
             string whereStr = " name='" + MenberName + "'";
             IList<WG_MenberEntity> meList = DataProvider.GetInstance().GetWG_MenberList(whereStr);
             if (meList == null || meList.Count <= 0)
             {
                 //用户不存在
                 lbl_Hint.Text = "用户不存在,本链接无法重置您的密码,请联系管理员。";
             }
             else
             {
                 //
                 string psw = MD5Encrypt.MD5Hash(txt_NewPsw.Text.Trim());
                 WG_MenberEntity newME = new WG_MenberEntity();
                 newME = meList[0];
                 newME.Psw = psw;
                 if (DataProvider.GetInstance().UpdateWG_Menber(newME))
                 {
                     lbl_Hint.Text = "重置密码成功!";
                 }
                 else
                 {
                     lbl_Hint.Text = "重置密码过程中出现错误,请联系管理员!";
                 }
             }
         }
     }
 }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.AddHeader("Access-Control-Allow-Origin", "*");
            context.Response.AddHeader("Access-Control-Allow-Methods", "POST");
            context.Response.AddHeader("Access-Control-Allow-Headers", "x-requested-with,content-type");
            context.Response.ContentType = "text/plain";

            JsonBaseObject jbo = new JsonBaseObject();
            string result = string.Empty;

            try
            {
                string username = context.Request["username"];
                string psw = context.Request["psw"];
                if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(psw))
                {
                    jbo.code = -1;
                    jbo.data = null;
                    jbo.message = "账号或密码不能为空!";
                    jbo.success = false;
                    result = JsonSerializer<JsonBaseObject>(jbo);
                    context.Response.Write(result);
                }

                string whereStr = " Name ='" + username + "'";
                IList<WG_MenberEntity> userList = DataProvider.GetInstance().GetWG_MenberList(whereStr);
                if (userList.Count > 0)
                {
                    jbo.code = -1;
                    jbo.data = null;
                    jbo.message = "该用户已存在!";
                    jbo.success = false;
                }
                else
                {
                    try
                    {
                        string sex = context.Request["sex"];
                        //设置默认
                        string avatar_url = ConfigurationManager.AppSettings["HostUrl"].ToString()+"imgs/" + context.Request["avatar_url"]; //sex == "男" ? "http://120.24.230.139/AppData/imgs/man.jpg" : "http://120.24.230.139/AppData/imgs/woman.jpg";//context.Request["avatar_url"];
                        string nickname = context.Request["nickname"];
                        string birthday = context.Request["birthday"];
                        string phoneNumber = context.Request["phoneNumber"];
                        string email = context.Request["email"];
                        string QQnumber = context.Request["QQnumber"];
                        string country = context.Request["country"];
                        string province = context.Request["province"];
                        string city = context.Request["city"];
                        string district = context.Request["district"];
                        string town = context.Request["town"];
                        string community = context.Request["community"];
                        string personalid = context.Request["identity"];
                        string address = context.Request["address"];
                        string weixinNumber = context.Request["weixinNumber"];
                        string education = context.Request["education"];
                        string profession = context.Request["profession"];
                        string speciality = context.Request["speciality"];
                        string intention = context.Request["intention"];
                        string intentionTime = context.Request["intentionTime"];
                        string flag = context.Request["flag"];

                        WG_MenberEntity menber = new WG_MenberEntity();
                        menber.Name = username;
                        menber.NickName = nickname;
                        menber.Psw = psw;
                        menber.Sex = sex;
                        menber.PhotoUrl = avatar_url;
                        menber.Birthday = birthday;
                        menber.Phone = phoneNumber;
                        menber.Email = email;
                        menber.QQ = QQnumber;
                        menber.Country = country;
                        menber.Province = province;
                        menber.City = city;
                        menber.District = district;
                        menber.Town = town;
                        menber.Community = community;
                        menber.PersonalID = personalid;
                        menber.Address = address;
                        menber.WeChat = weixinNumber;
                        menber.Education = education;
                        menber.Major = profession;
                        menber.SpecialSkill = speciality;
                        menber.ServiceIntention = intention;
                        menber.ServiceTimeInterval = intentionTime;
                        //0为游客,1位求助者,2为志愿者。求助者和自愿者才需要审核
                        if (int.Parse(flag) > 0)
                            menber.Status = 1;//状态:0正常,1待审核,2状态异常
                        else
                        {
                            menber.Status = 0;
                        }
                        menber.Flag = int.Parse(flag);
                        menber.Scores = 100;//初始积分100
                        menber.ServiceHours = 0;///初始服务时长为0
                        menber.CreateDate = DateTime.Now;
                        menber.UpdateDate = DateTime.Now;

                        //新增用户
                        int mID = DataProvider.GetInstance().AddWG_Menber(menber);

                        //新增得分明细表
                        WG_ScoreEntity se = new WG_ScoreEntity();
                        se.MenberID = mID;
                        se.Scores = int.Parse(ConfigurationManager.AppSettings["DefaultScore"].ToString());
                        se.CreateDate = DateTime.Now;
                        se.Title = "新用户注册获得" + se.Scores + "积分";
                        DataProvider.GetInstance().AddWG_Score(se);
                        //看看是否心中其他表

                        #region 通知用户主程成功,等待审核 add by frde 20160130
                        NoticeEntity ne = new NoticeEntity();
                        ne.FromUserID = 0;
                        ne.ToUserID = mID.ToString();
                        ne.Title = "注册成功";
                        ne.CreateDate = DateTime.Now;
                        ne.NoticeContent = "您的账号注册成功,请等待审核认证。";

                        //给用户一条消息
                        DataProvider.GetInstance().AddNotice(ne);
                        #endregion


                        //返回数据
                        menber.ID = mID;
                        jbo.code = 0;
                        jbo.data = menber;
                        jbo.message = "注册成功!";
                        jbo.success = true;
                    }
                    catch (Exception ex)
                    {
                        jbo.code = -1;
                        jbo.data = null;
                        jbo.message = "注册过程中发生异常!";
                        jbo.success = false;
                    }
                }
            }
            catch (Exception ex)
            {
                //失败
                jbo.code = -1;
                jbo.data = null;
                jbo.message = "接口调用过程中出现其他错误";
                jbo.success = false;
            }


            #region 返回json

            result = JsonSerializer<JsonBaseObject>(jbo);
            context.Response.Write(result);

            #endregion
        }
        public void ProcessRequest(HttpContext context)
        {
            //1.承接
            //2.完成操作
            context.Response.AddHeader("Access-Control-Allow-Origin", "*");
            context.Response.AddHeader("Access-Control-Allow-Methods", "POST");
            context.Response.AddHeader("Access-Control-Allow-Headers", "x-requested-with,content-type");
            context.Response.ContentType = "text/plain";
            JsonBaseObject jbo = new JsonBaseObject();
            string resultStr = string.Empty;
            try
            {

                string helpRequestStr = context.Request["helpRequestID"];//请求单号
                string underTakerStr = context.Request["underTakerID"]; //接单者ID
                string status = context.Request["status"]; //动作状态
                int helpRequestID = int.Parse(helpRequestStr);
                int underTakerID = int.Parse(underTakerStr);
                WG_HelpRequestEntity currEntity = DataProvider.GetInstance().GetWG_HelpRequestEntity(helpRequestID);
                WG_MenberEntity underTaker = new WG_MenberEntity();
                WG_MenberEntity Requestor = DataProvider.GetInstance().GetWG_MenberEntity(currEntity.PromoterID);
                if (currEntity != null)
                {
                    if (currEntity.Status > 1)
                    {
                        //非法操作
                        jbo.code = -1;
                        jbo.data = null;
                        jbo.message = "单子已完成";
                        jbo.success = false;

                        resultStr = JsonSerializer<JsonBaseObject>(jbo);
                        context.Response.Write(resultStr);
                    }
                    else
                    {
                        if (currEntity.Status == 0 && status == "1")
                        {
                            #region 接单===配对
                            //承接
                            currEntity.Status = 1;
                            if (!string.IsNullOrEmpty(underTakerStr))
                                currEntity.UnderTakerID = underTakerID;

                            currEntity.UpdateDate = DateTime.Now;

                            //统一更新单子
                            bool result = DataProvider.GetInstance().UpdateWG_HelpRequest(currEntity);
                            if (result)
                            {
                                //接单成功
                                jbo.code = 0;
                                jbo.data = null;
                                jbo.message = "接单成功。";
                                jbo.success = true;

                            }
                            else
                            {
                                //接单失败
                                jbo.code = -1;
                                jbo.data = null;
                                jbo.message = "接单失败。";
                                jbo.success = false;
                            }

                            #region 通知接单人

                            NoticeEntity ne = new NoticeEntity();
                            ne.Title = "您的求助/帮助已被承接";
                            ne.ToUserID = currEntity.PromoterID.ToString();//通知发帖人
                            ne.NoticeType = 1;//1求助帮助,2.活动类型,3.礼物类型
                            ne.LinkId = currEntity.ID;
                            ne.CreateDate = DateTime.Now;
                            ne.NoticeContent = "您的承接的求助单[ " + currEntity.Title + " ]已被承接。";
                            try
                            {
                                DataProvider.GetInstance().AddNotice(ne);
                            }
                            catch (Exception ex)
                            {

                            }
                            #endregion

                            #region respone

                            resultStr = JsonSerializer<JsonBaseObject>(jbo);
                            context.Response.Write(resultStr);

                            #endregion

                            #endregion
                        }
                        else if (currEntity.Status == 1 && status == "2")
                        {
                            #region 完成订单

                            currEntity.Status = 2;
                            currEntity.UpdateDate = DateTime.Now;
                            //完成
                            underTaker = DataProvider.GetInstance().GetWG_MenberEntity(currEntity.UnderTakerID);
                            //2.更新承接人服务时常
                            if (currEntity.Type == 1 && underTaker != null)
                            {
                                underTaker.ServiceHours += currEntity.Duration;
                                underTaker.Scores += currEntity.Duration * 60;
                                //积分明细

                            }
                            else if (currEntity.Type == 2 && Requestor != null)
                            {
                                Requestor.ServiceHours += currEntity.Duration;
                                Requestor.Scores += currEntity.Duration * 60;
                            }
                            else
                            {
                                //接单人不存在
                                jbo.code = -1;
                                jbo.data = null;
                                jbo.message = "接单人不存在";
                                jbo.success = false;

                                #region respone

                                resultStr = JsonSerializer<JsonBaseObject>(jbo);
                                context.Response.Write(resultStr);

                                #endregion
                            }

                            //统一更新单子
                            bool result = DataProvider.GetInstance().UpdateWG_HelpRequest(currEntity);
                            if (!result)
                            {
                                #region 更新订单出错

                                jbo.code = -1;
                                jbo.data = null;
                                jbo.message = "更新订单出错";
                                jbo.success = false;

                                #region respone

                                resultStr = JsonSerializer<JsonBaseObject>(jbo);
                                context.Response.Write(resultStr);

                                #endregion

                                #endregion
                            }
                            //3.承接者数据更新
                            bool utakerResult = false;
                            if (currEntity.Type == 1)
                                utakerResult = DataProvider.GetInstance().UpdateWG_Menber(underTaker);
                            else if (currEntity.Type == 2)
                                utakerResult = DataProvider.GetInstance().UpdateWG_Menber(Requestor);
                            if (!result)
                            {
                                #region 更新接单人信息出错

                                jbo.code = -1;
                                jbo.data = null;
                                jbo.message = "更新接单人信息出错";
                                jbo.success = false;

                                #region respone

                                resultStr = JsonSerializer<JsonBaseObject>(jbo);
                                context.Response.Write(resultStr);

                                #endregion

                                #endregion
                            }
                            else
                            {

                                #region 通知接单人
                                //1.
                                NoticeEntity ne = new NoticeEntity();
                                ne.Title = "您承接的单被发起人标记为完成状态";
                                ne.ToUserID = underTaker.ID.ToString();
                                ne.NoticeType = 1;//1求助帮助,2.活动类型,3.礼物类型
                                ne.LinkId = currEntity.ID;
                                ne.CreateDate = DateTime.Now;
                                ne.NoticeContent = "您的承接的求助单[ " + currEntity.Title + " ]已被发起人完成,您已获得:" + currEntity.Duration + "的积分和服务时常累积。感谢您的爱心奉献与付出。";
                                try
                                {
                                    DataProvider.GetInstance().AddNotice(ne);
                                }
                                catch (Exception ex)
                                {

                                }
                                #endregion
                                #region 完成订单成功
                                //接单成功
                                jbo.code = 0;
                                jbo.data = null;
                                jbo.message = "完成订单成功。";
                                jbo.success = true;

                                #endregion
                                #region respone

                                resultStr = JsonSerializer<JsonBaseObject>(jbo);
                                context.Response.Write(resultStr);

                                #endregion
                            }

                            #endregion
                        }
                        else if (currEntity.Status == 1 && status == "3")
                        {

                            #region 失约重发 20160110


                            #region 通知接单人
                            //1.
                            string noticeMsg = "";
                            NoticeEntity ne = new NoticeEntity();
                            ne.Title = "您承接的单被发起人标记为失约并重新发布了";
                            ne.ToUserID = currEntity.UnderTakerID.ToString();
                            ne.NoticeType = 1;//1求助帮助,2.活动类型,3.礼物类型
                            ne.LinkId = currEntity.ID;
                            ne.CreateDate = DateTime.Now;

                            ne.NoticeContent = "您的承接的求助单[ " + currEntity.Title + " ]已被发起人重新发出,您此次失约了,请注意与发帖人沟通好。";
                            try
                            {
                                DataProvider.GetInstance().AddNotice(ne);
                            }
                            catch (Exception ex)
                            {
                                noticeMsg = ex.ToString();
                            }
                            #endregion

                            try
                            {
                                //1.修改订单的状态,从已配对(1)改回原来的待配对(0)
                                currEntity.Status = 0;
                                //2.清空承接人信息
                                currEntity.UnderTakerID = -1;//表示没有人承接
                                currEntity.UpdateDate = DateTime.Now;

                                DataProvider.GetInstance().UpdateWG_HelpRequest(currEntity);
                                //接单成功
                                jbo.code = 0;
                                jbo.data = null;
                                jbo.message = "失约重发成功。" + noticeMsg;
                                jbo.success = true;
                            }
                            catch (Exception)
                            {
                                jbo.code = -1;
                                jbo.data = null;
                                jbo.message = "失约重发失败。";
                                jbo.success = false;
                                throw;
                            }


                            #region respone

                            resultStr = JsonSerializer<JsonBaseObject>(jbo);
                            context.Response.Write(resultStr);

                            #endregion
                            #endregion
                        }
                        else
                        {
                        }
                    }
                }
                else
                {
                    //失败
                    jbo.code = -1;
                    jbo.data = null;
                    jbo.message = "所更新的记录不存在。";
                    jbo.success = false;
                }
            }
            catch (Exception ex)
            {
                //失败
                jbo.code = -1;
                jbo.data = null;
                jbo.message = "接口调用过程中出现其他错误";
                jbo.success = false;
            }


        }