/// <summary> /// 修改子帐号信息(公司编号,其它平台用户编号,省份编号,城市编号,用户名,是否停用,是否管理员不做修改) /// 若设置的密码为null或为空,则密码不进行修改,若有修改密码,则已同步修改了mq,机票等所有的相关密码 /// </summary> /// <param name="model">帐号信息实体</param> /// <returns></returns> public bool UpdateChild(EyouSoft.Model.CompanyStructure.CompanyUser model) { bool isTrue = false; if (model == null) { return(isTrue); } //设置所有的密码 model.PassWordInfo = this.InitPassWordModel(model.PassWordInfo.NoEncryptPassword); isTrue = idal.Update(model); if (isTrue) { //若密码不为空,则要修改机票的密码 //if (!string.IsNullOrEmpty(model.PassWordInfo.NoEncryptPassword)) //{ // this.UpdateTicketUserPwd(model.ID, model.PassWordInfo.MD5Password); //} } #region 步修改其他平台用户信息 zwc 2011-04-07 if (isTrue) { this.SyncUpdateUserInfo(model.ID); } #endregion return(isTrue); }
/// <summary> /// 根据用户MQID获得公司以及当前用户明细信息实体类 /// </summary> /// <param name="userMqId">用户MQID</param> /// <returns></returns> private EyouSoft.Model.CompanyStructure.CompanyAndUserInfo GetUserCompanyModel(int userMqId) { if (userMqId <= 0) { return(null); } EyouSoft.Model.CompanyStructure.CompanyAndUserInfo modelAll = null; string companyid = ""; EyouSoft.Model.CompanyStructure.CompanyUser user = uIdal.GetModel(userMqId); if (user != null) { modelAll = new EyouSoft.Model.CompanyStructure.CompanyAndUserInfo(); companyid = user.CompanyID; modelAll.User = user; } user = null; if (string.IsNullOrEmpty(companyid)) { return(null); } EyouSoft.Model.CompanyStructure.CompanyDetailInfo company = cIdal.GetModel(companyid); if (company != null) { modelAll.Company = company; } company = null; return(modelAll); }
/// <summary> /// 添加帐号[添加帐号后自动生成MQ号码] /// </summary> /// <param name="model">帐号信息实体</param> /// <returns></returns> public EyouSoft.Model.ResultStructure.ResultInfo Add(EyouSoft.Model.CompanyStructure.CompanyUser model) { EyouSoft.Model.ResultStructure.ResultInfo result = EyouSoft.Model.ResultStructure.ResultInfo.Error; if (model == null || string.IsNullOrEmpty(model.UserName)) { return(result); } model.UserName = model.UserName.Trim(); //设置所有的密码 model.PassWordInfo = this.InitPassWordModel(model.PassWordInfo.NoEncryptPassword); result = idal.Add(ref model); //写入用户后要写入MQ客服号 if (result == EyouSoft.Model.ResultStructure.ResultInfo.Succeed) { try { EyouSoft.BLL.MQStructure.IMServiceMQ.CreateInstance().InsertFriendServiceMQ(Convert.ToInt32(model.ContactInfo.MQ), model.ProvinceId); } catch { } } #region 步添加其他平台用户信息(暂时不参与同步) zwc 2011-04-07 //大平台加子帐号暂时不参与同步 //if (result == EyouSoft.Model.ResultStructure.ResultInfo.Succeed) // BLL.SyncStructure.SyncUser.SyncAddUserInfo(model); #endregion return(result); }
/// <summary> /// 初始化方法 /// </summary> /// <param name="searchKey">搜索关键字</param> /// <param name="areaID">线路区域编号</param> /// <param name="begin">开始时间</param> /// <param name="end">结束时间</param> protected void DataInit(string searchKey, int areaID, string begin, string end) { pageIndex = Utils.GetInt(Utils.GetQueryStringValue("Page"), 1); //声明bll 操作对象 EyouSoft.IBLL.CompanyStructure.ICompanyUser cBLL = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance(); //声明公司对象 EyouSoft.Model.CompanyStructure.CompanyUser cModel = cBLL.GetModel(0);//SiteUserInfo.ID if (cModel != null && cModel.Area != null && cModel.Area.Count > 0) { //绑定公司的线路区域 this.rptAreaList.DataSource = cModel.Area; this.rptAreaList.DataBind(); //绑定下拉框线路区域 AreaListBind(cModel.Area, areaID); //团号(团号参数为null则最新订单,存在团号既查询单独团号下的订单) string tourId = Request.QueryString["tourId"]; #region 团查询实体赋值 EyouSoft.Model.NewTourStructure.MTourListSearch searchModel = new EyouSoft.Model.NewTourStructure.MTourListSearch(); searchModel.TourKey = searchKey; if (tourId == null) { searchModel.TourOrderStatus = EyouSoft.Model.NewTourStructure.TourOrderStatus.未确认; } searchModel.SLeaveDate = Utils.GetDateTimeNullable(begin); searchModel.ELeaveDate = Utils.GetDateTimeNullable(end); #endregion //获得未处理订单的团 EyouSoft.IBLL.NewTourStructure.ITourList tourBll = EyouSoft.BLL.NewTourStructure.BTourList.CreateInstance(); IList <EyouSoft.Model.NewTourStructure.MPowderOrder> tourList = EyouSoft.BLL.NewTourStructure.BPowderList.CreateInstance().GetNewPowderOrder( pageSize, pageIndex, ref recordCount, "", //SiteUserInfo.CompanyID, searchKey, areaID, Utils.GetDateTimeNullable(begin), Utils.GetDateTimeNullable(end), tourId);//团号 if (tourList != null && tourList.Count > 0) { this.rptList.DataSource = tourList; this.rptList.DataBind(); BindPage(); } else { this.ExportPageInfo1.Visible = false; this.litMsg.Text = "暂无最新订单"; } } else { } }
/// <summary> /// 保存用户信息 /// </summary> private void Save() { string _wrong = string.Empty; user = userbll.GetUserInfo(this.SiteUserInfo.ID); user.PersonInfo.ContactName = Utils.GetFormValue("name"); user.PersonInfo.ContactSex = (EyouSoft.Model.EnumType.CompanyStructure.Sex)Utils.GetInt(Utils.GetFormValue("sex"), 0); user.PersonInfo.ContactFax = Utils.GetFormValue("fax"); //电话号码 if (Utils.IsPhone(Utils.GetFormValue("phone").Trim()) || Utils.GetFormValue("phone").Trim() == "") { user.PersonInfo.ContactTel = Utils.GetFormValue("phone"); } else { _wrong = "请输入正确的电话号码!"; } //手机 if (Utils.IsMobile(Utils.GetFormValue("mobile").Trim()) || Utils.GetFormValue("mobile").Trim() == "") { user.PersonInfo.ContactMobile = Utils.GetFormValue("mobile"); } else { _wrong += "请输入正确的手机号码!"; } user.PersonInfo.QQ = Utils.GetFormValue("QQ").Trim(); user.PersonInfo.MSN = Utils.GetFormValue("msn").Trim(); user.PersonInfo.ContactEmail = Utils.GetFormValue("email").Trim(); if (string.IsNullOrEmpty(_wrong)) { bool res = userbll.Update(user); if (user.PassWordInfo.NoEncryptPassword != Utils.GetFormValue("psd")) { userbll.UpdatePassWord(user.ID, new EyouSoft.Model.CompanyStructure.PassWord(Utils.GetFormValue("psd"))); } if (res) { MessageBox.ResponseScript(this, "; alert('保存成功');location.href='/UserCenter/UserInfo/UserInfo.aspx';"); } else { MessageBox.ShowAndReturnBack(this, "操作失败", 1); } } else { MessageBox.ShowAndReturnBack(this, _wrong, 1); } }
/// <summary> /// 添加用户信息 /// </summary> /// <param name="model">用户信息实体</param> /// <returns>true:成功 false:失败</returns> public bool Add(EyouSoft.Model.CompanyStructure.CompanyUser model) { bool dalResult = Dal.Add(model); if (dalResult) { this.RemoveDepartmentCache(model.CompanyId); } handleLogsBll.Add(AddLogs("添加", dalResult)); return(dalResult); }
protected void Page_Load(object sender, EventArgs e) { EyouSoft.BLL.CompanyStructure.CompanyUser CompanyUser = null; EyouSoft.Model.CompanyStructure.CompanyUser ModelCompanyUser = new EyouSoft.Model.CompanyStructure.CompanyUser(); string hidMethod = Utils.GetFormValue("hidMethod"); if (hidMethod == "save") { ModelCompanyUser.PassWordInfo = new EyouSoft.Model.CompanyStructure.PassWord(); ModelCompanyUser.PassWordInfo.NoEncryptPassword = this.Txt_PassWord.Text; ModelCompanyUser.UserName = Utils.GetFormValue(this.txtUserName.UniqueID); ModelCompanyUser.PersonInfo = new EyouSoft.Model.CompanyStructure.ContactPersonInfo(); ModelCompanyUser.PersonInfo.ContactName = this.Txt_Name.Value; ModelCompanyUser.PersonInfo.ContactSex = (EyouSoft.Model.EnumType.CompanyStructure.Sex)Enum.Parse(typeof(EyouSoft.Model.EnumType.CompanyStructure.Sex), this.ddlSex.SelectedValue); ModelCompanyUser.PersonInfo.JobName = this.Txt_Position.Value; ModelCompanyUser.PersonInfo.ContactTel = this.Txt_Phone.Value; ModelCompanyUser.PersonInfo.ContactFax = this.Txt_Fox.Value; ModelCompanyUser.PersonInfo.ContactMobile = this.Txt_Moblie.Value; ModelCompanyUser.PersonInfo.QQ = this.Txt_QQNumber.Value; ModelCompanyUser.PersonInfo.ContactEmail = this.Txt_Email.Value; ModelCompanyUser.PersonInfo.Remark = this.Txt_Remiks.Value; bool result = true; ModelCompanyUser.ID = SiteUserInfo.ID; ModelCompanyUser.TourCompanyId = SiteUserInfo.TourCompany.TourCompanyId; CompanyUser = new EyouSoft.BLL.CompanyStructure.CompanyUser(); result = CompanyUser.UpdateZuTuan(ModelCompanyUser); MessageBox.ShowAndRedirect(this, result ? "用户信息修改成功!" : "用户信息修改失败!", "/GroupEnd/SystemSetting/AccountManager.aspx"); return; } CompanyUser = new EyouSoft.BLL.CompanyStructure.CompanyUser(); ModelCompanyUser = CompanyUser.GetUserInfo(SiteUserInfo.ID); if (ModelCompanyUser != null) { this.Txt_UserName.Text = ModelCompanyUser.UserName; this.txtUserName.Value = ModelCompanyUser.UserName; this.Txt_Name.Value = ModelCompanyUser.PersonInfo.ContactName; this.Txt_PassWord.Text = ModelCompanyUser.PassWordInfo.NoEncryptPassword; if (this.ddlSex.Items.FindByValue(((int)ModelCompanyUser.PersonInfo.ContactSex).ToString()) != null) { this.ddlSex.Items.FindByValue(((int)ModelCompanyUser.PersonInfo.ContactSex).ToString()).Selected = true; } this.Txt_Position.Value = ModelCompanyUser.PersonInfo.JobName; this.Txt_Phone.Value = ModelCompanyUser.PersonInfo.ContactTel; this.Txt_Fox.Value = ModelCompanyUser.PersonInfo.ContactFax; this.Txt_Moblie.Value = ModelCompanyUser.PersonInfo.ContactMobile; this.Txt_QQNumber.Value = ModelCompanyUser.PersonInfo.QQ; this.Txt_Email.Value = ModelCompanyUser.PersonInfo.ContactEmail; this.Txt_Remiks.Value = ModelCompanyUser.PersonInfo.Remark; } }
/// <summary> /// 初使化用户信息 /// </summary> private void cominit() { cModel = csBll.GetUserInfo(SiteUserInfo.ID); cptModel = cBll.GetCustomerConfigModel(CurrentUserCompanyID); if (cModel == null) { cModel = new EyouSoft.Model.CompanyStructure.CompanyUser(); } if (cptModel == null) { cptModel = new EyouSoft.Model.CompanyStructure.CustomerConfig(); } }
/// <summary> /// 绑定专线下拉 /// </summary> private void BindZX() { ICompanyUser companyUserBLL = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance(); EyouSoft.Model.CompanyStructure.CompanyUser companyUserModel = companyUserBLL.GetModel(SiteUserInfo.ID); if (companyUserModel != null && companyUserModel.Area != null && companyUserModel.Area.Count > 0) { ddl_ZX.AppendDataBoundItems = true; ddl_ZX.DataTextField = "AreaName"; ddl_ZX.DataValueField = "AreaId"; ddl_ZX.DataSource = companyUserModel.Area; ddl_ZX.DataBind(); } }
/// <summary> /// 修改用户信息 /// </summary> /// <param name="model">用户信息实体</param> /// <returns>true:成功 false:失败</returns> public bool Update(EyouSoft.Model.CompanyStructure.CompanyUser model) { bool dalResult = Dal.Update(model); if (dalResult) { this.RemoveDepartmentCache(model.CompanyId); //修改密码 UpdatePassWord(model.ID, model.PassWordInfo); } handleLogsBll.Add(AddLogs("修改", dalResult)); return(dalResult); }
/// <summary> /// 初始化用户信息 /// </summary> /// <param name="model"></param> private void InitCompanyUserInfo(EyouSoft.Model.CompanyStructure.CompanyUser model) { ltrUserCityName.Text = model.ContactInfo.ContactName; ltrUserSex.Text = model.ContactInfo.ContactSex != EyouSoft.Model.CompanyStructure.Sex.未知 ? model.ContactInfo.ContactSex.ToString() : "无性别信息"; ltrIsAdmin.Text = model.IsAdmin ? "是" : "否"; ltrUserName1.Text = model.UserName; ltrUserMQ.Text = model.ContactInfo.MQ; ltrUserMobile.Text = model.ContactInfo.Mobile; ltrUserTel.Text = model.ContactInfo.Tel; ltrUserFax.Text = model.ContactInfo.Fax; ltrUserEmail.Text = model.ContactInfo.Email; ltrUserMSN.Text = model.ContactInfo.MSN; ltrUserProvinceName.Text = this.GetProvinceName(model.ProvinceId); ltrUserCityName.Text = this.GetCityName(model.CityId); }
/// <summary> /// 更新机票用户的密码 /// </summary> /// <param name="userId">用户GUID</param> /// <param name="md5Pw">MD5密码</param> /// <returns></returns> public bool UpdateTicketUserPwd(string userId, string md5Pw) { bool isTrue = false; EyouSoft.Model.CompanyStructure.CompanyUser model = idal.GetModel(userId); if (model != null) { try { isTrue = Adpost.Ticket.BLL.Ticket.TicketUpdateUserPwd(model.OpUserId.ToString(), md5Pw.ToUpper()); } catch { } } model = null; return(isTrue); }
/// <summary> /// 同步修改其他平台用户信息 zwc 2011-04-07 /// </summary> /// <param name="PlamUserId">用户Id</param> public static void SyncUpdateUserInfo(string PlamUserId) { if (string.IsNullOrEmpty(PlamUserId)) { return; } EyouSoft.Model.CompanyStructure.CompanyUser model = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance().GetModel(PlamUserId); if (model == null) { return; } #region 步修改其他平台用户信息 zwc 2011-04-07 if (EyouSoft.OpenRelation.Utils.GetIsSync()) { //同步修改其他平台用户信息 EyouSoft.OpenRelation.Utils.CreateRequest( new EyouSoft.OpenRelation.Model.MRequestInfo() { AppKey = EyouSoft.OpenRelation.Utils.GetAppKey(), RequestUriString = EyouSoft.OpenRelation.Utils.GetMiddlewareURI(), RequestSystemType = EyouSoft.OpenRelation.Model.SystemType.Platform, InstructionType = EyouSoft.OpenRelation.Model.InstructionType.UpdateUser, InstructionCode = EyouSoft.OpenRelation.Utils.ConvertJSON <EyouSoft.OpenRelation.Model.MUserInfo>(new EyouSoft.OpenRelation.Model.MUserInfo() { UserName = model.UserName.Trim(), Password = model.PassWordInfo.NoEncryptPassword.Trim(), RealName = model.ContactInfo.ContactName, Gender = model.ContactInfo.ContactSex == EyouSoft.Model.CompanyStructure.Sex.男 ? EyouSoft.OpenRelation.Model.Gender.G : EyouSoft.OpenRelation.Model.Gender.L, Mobile = model.ContactInfo.Mobile, Telephone = model.ContactInfo.Tel, Fax = model.ContactInfo.Fax, Email = model.ContactInfo.Email, MSN = model.ContactInfo.MSN, QQ = model.ContactInfo.QQ, PlatformCompanyId = model.CompanyID, PlatformUserId = model.ID, SystemType = EyouSoft.OpenRelation.Model.SystemType.Platform }) }); } #endregion }
/// <summary> /// 保存按钮Click事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { EyouSoft.Model.CompanyStructure.CompanyLogo logoInfo = new EyouSoft.Model.CompanyStructure.CompanyLogo(); logoInfo.ImagePath = Utils.GetFormValue("FSelfLogo$hidFileName"); EyouSoft.Model.CompanyStructure.CompanyMQAdv adInfo = new EyouSoft.Model.CompanyStructure.CompanyMQAdv(); adInfo.ImagePath = Utils.GetFormValue("FSelfAd$hidFileName"); adInfo.ImageLink = Utils.GetFormValue("txtPayMQSelfAdUrl").Trim(); EyouSoft.IBLL.CompanyStructure.ICompanyUser ubll = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance(); EyouSoft.Model.CompanyStructure.CompanyUser uInfo = ubll.GetModel(this.SiteUserInfo.ID); string contactName = Utils.GetFormValue(this.txtSelfContactName.UniqueID); //Utils.InputText(this.txtSelfContactName.Text); int contactGender = Utils.GetInt(Utils.GetFormValue(this.rblSelfGender.UniqueID), 2); //Utils.GetInt(this.rblSelfGender.SelectedValue, 2); string contactTelephone = Utils.GetFormValue(this.txtSelfContactTel.UniqueID); //Utils.InputText(this.txtSelfContactTel.Text); string contactMobile = Utils.GetFormValue(this.txtSelfContactMobile.UniqueID); //Utils.InputText(this.txtSelfContactMobile.Text); uInfo.ContactInfo.ContactName = string.IsNullOrEmpty(contactName) ? uInfo.ContactInfo.ContactName : contactName; uInfo.ContactInfo.ContactSex = (EyouSoft.Model.CompanyStructure.Sex)contactGender; uInfo.ContactInfo.Tel = string.IsNullOrEmpty(contactTelephone) ? uInfo.ContactInfo.Tel : contactTelephone; uInfo.ContactInfo.Mobile = string.IsNullOrEmpty(contactMobile) ? uInfo.ContactInfo.Mobile : contactMobile; ubll.UpdatePersonal(uInfo); if (!string.IsNullOrEmpty(logoInfo.ImagePath)) { EyouSoft.BLL.CompanyStructure.CompanyAttachInfo.CreateInstance().SetCompanyLogo(uInfo.CompanyID, logoInfo); } if (!string.IsNullOrEmpty(adInfo.ImagePath) || !string.IsNullOrEmpty(adInfo.ImageLink)) { if (string.IsNullOrEmpty(adInfo.ImagePath)) { adInfo.ImagePath = this.txtSelfCurrentAdImgPath.Value; } if (!string.IsNullOrEmpty(adInfo.ImageLink) && !adInfo.ImageLink.StartsWith("http://")) { adInfo.ImageLink = "http://" + adInfo.ImageLink; } EyouSoft.BLL.CompanyStructure.CompanyAttachInfo.CreateInstance().SetCompanyMQAdv(uInfo.CompanyID, adInfo); } Response.Redirect(Request.ServerVariables["SCRIPT_NAME"] + "?" + Request.QueryString); }
/// <summary> /// 根据oPUserID获取用户信息 /// </summary> /// <param name="oPUserID">用户对应oPUserID</param> /// <returns></returns> public EyouSoft.Model.CompanyStructure.CompanyUser GetModelByOPUserID(int oPUserID) { if (oPUserID <= 0) { return(null); } EyouSoft.Model.CompanyStructure.CompanyUser model = idal.GetModelByOPUserID(oPUserID); if (model != null) { //获得用户的线路区域信息 List <EyouSoft.Model.SystemStructure.AreaBase> areaList = (List <EyouSoft.Model.SystemStructure.AreaBase>)EyouSoft.BLL.CompanyStructure.CompanyArea.CreateInstance().GetUserArea(model.ID); if (areaList != null && areaList.Count > 0) { model.Area = this.GetCacheAreaAllInfo(areaList); } } return(model); }
/// <summary> /// 获得管理员实体信息 /// </summary> /// <param name="companyId">公司ID</param> /// <returns></returns> public EyouSoft.Model.CompanyStructure.CompanyUser GetAdminModel(string companyId) { if (string.IsNullOrEmpty(companyId)) { return(null); } EyouSoft.Model.CompanyStructure.CompanyUser model = idal.GetAdminModel(companyId); if (model != null) { //获得用户的线路区域信息 List <EyouSoft.Model.SystemStructure.AreaBase> areaList = (List <EyouSoft.Model.SystemStructure.AreaBase>)EyouSoft.BLL.CompanyStructure.CompanyArea.CreateInstance().GetUserArea(model.ID); if (areaList != null && areaList.Count > 0) { model.Area = this.GetCacheAreaAllInfo(areaList); } } return(model); }
protected void Page_Load(object sender, EventArgs e) { DesUrl = HttpUtility.UrlDecode(Utils.GetQueryStringValue(Utils.MQTransitDesUrlKey)); int mqLoginId = Utils.GetInt(Request.QueryString[Utils.MQLoginIdKey]); Pwd = Utils.GetQueryStringValue(Utils.MQPwKey); EyouSoft.Model.CompanyStructure.CompanyUser companyUser = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance().GetModel(mqLoginId); if (companyUser == null) { Response.Clear(); Response.Write("无效的用户信息"); Response.End(); } UserName = companyUser.UserName; }
/// <summary> /// 审核 /// </summary> protected bool CheckCompany() { bool Result = false; string CompanyId = Request.QueryString["CompanyId"]; if (!string.IsNullOrEmpty(CompanyId)) { Result = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().PassRegister(CompanyId); } if (Result) { EyouSoft.Model.CompanyStructure.CompanyDetailInfo _detailCompanyInfo = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().GetModel(CompanyId); //公司信息 EyouSoft.Model.CompanyStructure.CompanyUser _companyUser = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance().GetAdminModel(CompanyId); //公司管理员信息 if (_detailCompanyInfo != null) { //审核通过发送短信 bool isSend = Utils.SendSMSForReminderRegPass(_detailCompanyInfo.ContactInfo.Mobile, _detailCompanyInfo.AdminAccount.UserName, _detailCompanyInfo.ContactInfo.MQ, _detailCompanyInfo.CityId); if (isSend) { //发送短信记录 EyouSoft.Model.ToolStructure.MsgTipRecord tipModel = new EyouSoft.Model.ToolStructure.MsgTipRecord(); tipModel.Email = string.Empty; tipModel.FromMQID = _detailCompanyInfo.ContactInfo.MQ; tipModel.ToMQID = _detailCompanyInfo.ContactInfo.MQ; tipModel.Mobile = _detailCompanyInfo.ContactInfo.Mobile; tipModel.MsgType = EyouSoft.Model.ToolStructure.MsgType.RegPass; tipModel.SendWay = EyouSoft.Model.ToolStructure.MsgSendWay.SMS; EyouSoft.BLL.ToolStructure.MsgTipRecord msgTipBll = new EyouSoft.BLL.ToolStructure.MsgTipRecord(); msgTipBll.Add(tipModel); } //审核通过发送邮件 EyouSoft.Common.Email.ReminderEmailHelper.SendRegPassEmail( _detailCompanyInfo.AdminAccount.UserName, _detailCompanyInfo.ContactInfo.Email, _companyUser != null ? _companyUser.PassWordInfo.NoEncryptPassword : ""); _detailCompanyInfo = null; } } return(Result); }
/// <summary> /// 绑定线路区域 /// </summary> private void BindLineArea() { //用户Id string UserID = string.Empty;; if (SiteUserInfo != null) { EyouSoft.SSOComponent.Entity.UserInfo UserInfoModel = SiteUserInfo; UserID = UserInfoModel.ID ?? "0"; } ICompanyUser companyUserBLL = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance(); EyouSoft.Model.CompanyStructure.CompanyUser companyUserModel = companyUserBLL.GetModel(UserID); if (companyUserModel != null && companyUserModel.Area != null && companyUserModel.Area.Count > 0) { //国内 List <AreaBase> gn = companyUserModel.Area.Where(ty => ty.RouteType == AreaType.国内长线).ToList(); //国际 List <AreaBase> gj = companyUserModel.Area.Where(ty => ty.RouteType == AreaType.国际线).ToList(); //周边 List <AreaBase> zb = companyUserModel.Area.Where(ty => ty.RouteType == AreaType.地接线路 || ty.RouteType == AreaType.国内短线).ToList(); if (gn != null && gn.Count > 0) { showGN = true; rpt_gn.DataSource = gn; rpt_gn.DataBind(); } if (gj != null && gj.Count > 0) { showGJ = true; rpt_gj.DataSource = gj; rpt_gj.DataBind(); } if (zb != null && zb.Count > 0) { showZB = true; rpt_zb.DataSource = zb; rpt_zb.DataBind(); } routeSource = (RouteSource)Utils.GetInt(Utils.GetQueryStringValue("RouteSource"), 1); } }
public EyouSoft.Model.ResultStructure.ResultInfo CreatChildUser(string CompanyId, string UserName, string PassWord, string ContactName , string ContactTel) { if (!soapHeader.IsSafeCall) { throw new Exception("对不起,您没有权限调用此服务!"); } EyouSoft.Model.CompanyStructure.CompanyUser ModelUser = new EyouSoft.Model.CompanyStructure.CompanyUser(); ModelUser.CompanyID = Utils.InputText(CompanyId); ModelUser.UserName = Utils.InputText(UserName, 20); ModelUser.PassWordInfo.NoEncryptPassword = PassWord; ModelUser.ContactInfo.ContactName = Utils.InputText(ContactName, 20); ModelUser.ContactInfo.Tel = Utils.InputText(ContactTel, 20); ModelUser.RoleID = string.Empty; EyouSoft.Model.ResultStructure.ResultInfo Result = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance().Add(ModelUser); ModelUser = null; return(Result); }
private void InitData() { if (string.IsNullOrEmpty(UserID)) { UserID = SiteUserInfo.ID ?? "0"; } EyouSoft.Model.CompanyStructure.CompanyUser companyUserModel = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance().GetModel(UserID); if (companyUserModel != null) { if (companyUserModel.Area != null && companyUserModel.Area.Count > 0) { this.rptAreaList.DataSource = companyUserModel.Area; this.rptAreaList.DataBind(); } } else { this.pnlNoData.Visible = true; } }
/// <summary> /// 加好友时,设置我的客户 /// </summary> private void SetCustomer() { if (SiteUserInfo != null && !string.IsNullOrEmpty(SiteUserInfo.ID)) { string companyId = Utils.InputText(Request.QueryString["CompanyId"]); if (EyouSoft.BLL.CompanyStructure.MyCustomer.CreateInstance().SetMyCustomer(SiteUserInfo.ID, companyId)) { //得到需要发送的公司的信息 EyouSoft.Model.CompanyStructure.CompanyDetailInfo model = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().GetModel(companyId); //得到需要发送的公司的管理员用户信息 EyouSoft.Model.CompanyStructure.CompanyUser companyUser = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance().GetAdminModel(companyId); //添加短信提示功能 add by dyz 2010-10-25 bool isSend = Utils.SendSMSForReminderAddFriend(model.ContactInfo.MQ, model.ContactInfo.Mobile, SiteUserInfo.CompanyName, SiteUserInfo.ContactInfo.ContactName, model.CityId); if (isSend) { //发送短信记录 EyouSoft.Model.ToolStructure.MsgTipRecord tipModel = new EyouSoft.Model.ToolStructure.MsgTipRecord(); tipModel.Email = string.Empty; tipModel.FromMQID = SiteUserInfo.ContactInfo.MQ; tipModel.ToMQID = model.ContactInfo.MQ; //接收方MQ tipModel.Mobile = model.ContactInfo.Mobile; //接收方手机 tipModel.MsgType = EyouSoft.Model.ToolStructure.MsgType.AddFriend; tipModel.SendWay = EyouSoft.Model.ToolStructure.MsgSendWay.SMS; EyouSoft.BLL.ToolStructure.MsgTipRecord msgTipBll = new EyouSoft.BLL.ToolStructure.MsgTipRecord(); msgTipBll.Add(tipModel); } //添加邮件提示功能 add by dyz 2010-10-26 EyouSoft.Common.Email.ReminderEmailHelper.SendAddFriendEmail( model.AdminAccount.UserName, model.ContactInfo.Email, companyUser != null ? companyUser.PassWordInfo.NoEncryptPassword : "", SiteUserInfo.ContactInfo.ContactName); } } }
public int UpdatePersonalInfo(string UserId, string NewPassWord, string ContactName, bool Sex, string ContactTel, string ContactMobile , string Fax, string Email, string QQ, string MSN) { if (!soapHeader.IsSafeCall) { throw new Exception("对不起,您没有权限调用此服务!"); } //if (string.IsNullOrEmpty(UserId) || string.IsNullOrEmpty(ContactName) || string.IsNullOrEmpty(Email)) if (string.IsNullOrEmpty(UserId) || string.IsNullOrEmpty(ContactName)) { return(0); } int Resutl = 0; EyouSoft.Model.CompanyStructure.CompanyUser userModel = new EyouSoft.Model.CompanyStructure.CompanyUser(); userModel = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance().GetModel(UserId); userModel.ContactInfo.ContactName = ContactName; userModel.ContactInfo.ContactSex = Sex ? EyouSoft.Model.CompanyStructure.Sex.男 : EyouSoft.Model.CompanyStructure.Sex.女; userModel.ContactInfo.Mobile = Utils.InputText(ContactMobile, 50); userModel.ContactInfo.Fax = Utils.InputText(Fax, 50); userModel.ContactInfo.Tel = Utils.InputText(ContactTel, 20); userModel.ContactInfo.Email = Utils.InputText(Email); userModel.ContactInfo.QQ = Utils.InputText(QQ, 20); userModel.ContactInfo.MSN = Utils.InputText(MSN, 50); Resutl = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance().UpdatePersonal(userModel) ? 1 : -1; if (Resutl == 1 && !string.IsNullOrEmpty(NewPassWord)) { EyouSoft.Model.CompanyStructure.PassWord pass = new EyouSoft.Model.CompanyStructure.PassWord(); pass.NoEncryptPassword = Utils.InputText(NewPassWord);//设置新密码 Resutl = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance().UpdatePassWord(Utils.InputText(UserId), pass) ? 2 : -2; pass = null; } userModel = null; return(Resutl); }
protected void Page_Load(object sender, EventArgs e) { //if (!CheckGrant(TravelPermission.系统设置_管理首页)) //{ // Utils.ResponseNoPermit(); // return; //} if (!IsPostBack) { this.InitData(); } userBll = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance(); userModel = userBll.GetModel(SiteUserInfo.ID); string method = Utils.GetFormValue("method"); if (method == "save") { UpdatePersonInfo();//更新个人信息 return; } LoadPersonInfo();//初始化个人信息 }
protected void Page_Load(object sender, EventArgs e) { string shopUrl = string.Empty; string mq = Request.QueryString["mq"]; if (!string.IsNullOrEmpty(mq) && EyouSoft.Common.Function.StringValidate.IsInteger(mq)) { EyouSoft.Model.CompanyStructure.CompanyUser user = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance().GetModel(int.Parse(mq)); EyouSoft.Model.CompanyStructure.CompanyAndUserInfo company = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().GetModel(int.Parse(mq)); if (company != null && company.Company.CompanyRole.RoleItems.Length > 0) { shopUrl = EyouSoft.Common.Utils.GetCompanyDomain(company.Company.ID, company.Company.CompanyRole.RoleItems[0]); } if (!string.IsNullOrEmpty(shopUrl)) { Response.Write("<script>location.href='" + shopUrl + "';</script>"); } else { Response.Write("<script>location.href='" + EyouSoft.Common.Domain.UserPublicCenter + "';</script>"); } } }
/// <summary> /// 验证Email与会员用户信息是否相同 /// </summary> protected bool isExitEmail(string UserName, string Email) { bool isPass = false; if (UserName != "" && Email != "") { EyouSoft.Model.CompanyStructure.CompanyUser Model = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance().GetModelByUserName(UserName); if (Model != null) { string UserEmail = Model.ContactInfo.Email.ToString(); if (!string.IsNullOrEmpty(UserEmail)) { //邮件比较的时候,忽略大小写 if (Email.Equals(UserEmail, StringComparison.OrdinalIgnoreCase)) { isPass = true; } } } Model = null; } return(isPass); }
protected void AddSonUser(List <EyouSoft.Model.SystemStructure.AreaBase> areaList) { if (!IsCompanyCheck) { Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), "<script>alert('对不起,你尚未审核通过!');</script>"); return; } sonUserModel = new EyouSoft.Model.CompanyStructure.CompanyUser(); sonUserModel.DepartId = Utils.GetFormValue(sus_selDepart.UniqueID); sonUserModel.RoleID = Utils.GetFormValue(sus_selRole.UniqueID); EyouSoft.Model.CompanyStructure.PassWord pass = new EyouSoft.Model.CompanyStructure.PassWord(); pass.NoEncryptPassword = sus_txtNewPassword1.Value; sonUserModel.PassWordInfo = pass; sonUserModel.ContactInfo.Tel = Utils.InputText(sus_txtTel.Value, 20); sonUserModel.ContactInfo.Fax = Utils.InputText(sus_txtFax.Value, 50); sonUserModel.ContactInfo.Mobile = Utils.InputText(sus_txtMobile.Value, 20); sonUserModel.ContactInfo.MSN = Utils.InputText(sus_txtMSN.Value, 50); sonUserModel.ContactInfo.QQ = Utils.InputText(sus_txtQQ.Value, 20); sonUserModel.ContactInfo.ContactName = Utils.InputText(sus_txtUserName.Value, 20); sonUserModel.UserName = Utils.InputText(sus_txtAccount.Value, 20); sonUserModel.CompanyID = SiteUserInfo.CompanyID; sonUserModel.Area = areaList; EyouSoft.Model.ResultStructure.ResultInfo result = sonUserBll.Add(sonUserModel); if (result == EyouSoft.Model.ResultStructure.ResultInfo.Exists) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "<script>;alert('该账户已经存在!');window.location='" + Request.Url.ToString() + "';</script>"); } else if (result == EyouSoft.Model.ResultStructure.ResultInfo.Succeed) { ResponseMegSuccess(); } else if (result == EyouSoft.Model.ResultStructure.ResultInfo.Error) { ResponseMegError(); } }
/// <summary> /// 更新组团用户信息 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool UpdateZuTuan(EyouSoft.Model.CompanyStructure.CompanyUser model) { return(Dal.UpdateZuTuan(model)); }
protected void Page_Load(object sender, EventArgs e) { int mqLoginId = Utils.GetInt(Request.Form["mqid"]); string pwd = Utils.GetFormValue("mqpwd"); EyouSoft.Model.CompanyStructure.CompanyUser companyUser = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance().GetModel(mqLoginId); //if (companyUser == null || companyUser.PassWordInfo.MD5Password != pwd) //{ // Response.Clear(); // Response.StatusCode = 200; // Response.Write("无效的用户信息"); // Response.End(); //} //Get the Upload File Type. string fileType = Utils.GetFormValue("filetype"); //Get the width and heigth. int width = Utils.GetInt(Request.Form["ImageWidth"], 300); int height = Utils.GetInt(Request.Form["ImageHeight"], 300); // Get the file data. HttpPostedFile image_upload = Request.Files["Filedata"]; if (image_upload == null || image_upload.ContentLength <= 0) { Response.Clear(); Response.StatusCode = 200; Response.Write("{error:'上传的文件为空'}"); Response.End(); } else if (image_upload.ContentLength > 1048576) { Response.Clear(); Response.StatusCode = 200; Response.Write("{error:'上传的文件超过了指定的大小'}"); Response.End(); } //generate the file path. //string companyName = companyUser.CompanyID; string companyName = ""; string fileExt = string.Empty; string fileName = string.Empty; if (fileType != "worddoc") { fileExt = ".jpg"; fileName = Utils.GenerateFileName(fileExt); } else { fileExt = System.IO.Path.GetExtension(image_upload.FileName); fileName = Utils.GenerateFileName(fileExt); } string year = DateTime.Now.Year.ToString(); string month = DateTime.Now.Month.ToString(); string relativePath = VirtualPathUtility.RemoveTrailingSlash(VirtualPathUtility.ToAbsolute(EyouSoft.Common.ConfigModel.ConfigClass.GetConfigString("FileSystem.CompanyVirtualPath"))) + "/" + year + "/" + month + "/" + fileName; string relativeDirPath = VirtualPathUtility.RemoveTrailingSlash(VirtualPathUtility.ToAbsolute(EyouSoft.Common.ConfigModel.ConfigClass.GetConfigString("FileSystem.CompanyVirtualPath"))) + "/" + year + "/" + month + "/"; string desFilePath = Server.MapPath(relativePath); string desDirPath = Server.MapPath(relativeDirPath); if (!Directory.Exists(desDirPath)) { Directory.CreateDirectory(desDirPath); } if (fileType != "worddoc") { //Thumbnail.CompressionImage(image_upload.InputStream, desFilePath, width, height); image_upload.SaveAs(desFilePath); // } else { image_upload.SaveAs(desFilePath); } Response.Clear(); Response.StatusCode = 200; Response.Write("{fileid:'" + relativePath + "'}"); Response.End(); }
/// <summary> /// 初始化线路区域 /// </summary> private void InitRouteArea() { EyouSoft.SSOComponent.Entity.UserInfo operatorModel = this.SiteUserInfo; int[] AreaIds = {}; string UserId = EyouSoft.Common.Utils.GetQueryStringValue("UserId"); if (!string.IsNullOrEmpty(Request.QueryString["UserId"])) { EyouSoft.Model.CompanyStructure.CompanyUser UserModel = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance().GetModel(UserId); if (UserModel != null) { List <EyouSoft.Model.SystemStructure.AreaBase> UserHasArea = UserModel.Area; if (UserHasArea != null && UserHasArea.Count > 0) { AreaIds = UserHasArea.Select(p => p.AreaId).ToArray <int>(); } } } else { AreaIds = operatorModel.AreaId; } if (operatorModel != null) { List <EyouSoft.Model.SystemStructure.SysArea> AreaList = (List <EyouSoft.Model.SystemStructure.SysArea>)EyouSoft.BLL.SystemStructure.SysArea.CreateInstance().GetSysAreaList(AreaIds); StringBuilder strVal = new StringBuilder(); if (AreaList != null && AreaList.Count > 0) { if (_currentAreaId > 0) //指定了显示哪个线路区域 { strVal.Append("<a href=\"javascript:void(0)\" name=a_AreaId AreaId='-1' class=\"red\">所 有</a>"); } else { strVal.Append("<a href=\"javascript:void(0)\" name=a_AreaId AreaId='-1' class=\"red\">所 有</a> "); } int rowCount = AreaList.Count; //实际的记录数 for (int i = 0; i < rowCount; i++) { int AreaId = AreaList[i].AreaId; string AreaName = AreaList[i].AreaName; if (AreaId != _currentAreaId) { if ((i + 1) % 3 == 0) { strVal.AppendFormat("<a href=\"javascript:void(0)\" name='a_" + AreaId + "' AreaId='{1}'>{0}</a> </br>", AreaName, AreaId); } else { strVal.AppendFormat("<a href=\"javascript:void(0)\" name='a_" + AreaId + "' AreaId='{1}'>{0}</a> ", AreaName, AreaId); } } else { if ((i + 1) % 3 == 0) { strVal.AppendFormat("<a href=\"javascript:void(0)\" name='a_" + AreaId + "' AreaId='{1}''>{0}</a> </br>", AreaName, AreaId); } else { strVal.AppendFormat("<a href=\"javascript:void(0)\" name='a_" + AreaId + "' AreaId='{1}'>{0}</a> ", AreaName, AreaId); } } } AreaList = null; Response.Write(strVal.ToString()); } else { Response.Clear(); Response.Write("[{isSuccess:false,Message:'你当前使用帐号没有经营任何线路区域!'}]"); Response.End(); } } }