// ------------------------------------------------------- // 添加 删除 修改 // ------------------------------------------------------- #region 函数:Save(IAssignedJobInfo param) /// <summary>保存记录</summary> /// <param name="param">实例<see cref="IAssignedJobInfo"/>详细信息</param> /// <returns>实例<see cref="IAssignedJobInfo"/>详细信息</returns> public IAssignedJobInfo Save(IAssignedJobInfo param) { if (!this.IsExist(param.Id)) { this.Insert(param); } else { this.Update(param); } return(param); }
public string FindOne(XmlDocument doc) { StringBuilder outString = new StringBuilder(); string id = XmlHelper.Fetch("id", doc); IAssignedJobInfo param = this.service.FindOne(id); outString.Append("{\"data\":" + AjaxUtil.Parse <IAssignedJobInfo>(param) + ","); outString.Append(MessageObject.Stringify("0", I18n.Strings["msg_query_success"], true) + "}"); return(outString.ToString()); }
// ------------------------------------------------------- // 同步管理 // ------------------------------------------------------- #region 函数:SyncFromPackPage(IAssignedJobInfo param) /// <summary>同步信息</summary> /// <param name="param">岗位信息</param> public int SyncFromPackPage(IAssignedJobInfo param) { this.ibatisMapper.Insert(StringHelper.ToProcedurePrefix(string.Format("{0}_SyncFromPackPage", tableName)), param); return(0); }
/// <summary>修改记录</summary> /// <param name="param">实例<see cref="IAssignedJobInfo"/>详细信息</param> public void Update(IAssignedJobInfo param) { this.ibatisMapper.Update(StringHelper.ToProcedurePrefix(string.Format("{0}_Update", tableName)), param); }
/// <summary>添加记录</summary> /// <param name="param">实例<see cref="IAssignedJobInfo"/>详细信息</param> public void Insert(IAssignedJobInfo param) { this.ibatisMapper.Insert(StringHelper.ToProcedurePrefix(string.Format("{0}_Insert", tableName)), param); }
/// <summary>根据Xml元素加载对象</summary> /// <param name="element">Xml元素</param> public virtual void Deserialize(XmlElement element) { if (this.Account == null) { m_Account = new AccountInfo(); } this.Account.Deserialize(element); this.Id = this.AccountId = this.Account.Id = element.SelectSingleNode("id").InnerText; this.FullName = element.SelectSingleNode("name").InnerText; this.CorporationId = element.SelectSingleNode("corporationId").InnerText; this.DepartmentId = element.SelectSingleNode("departmentId").InnerText; if (element.SelectSingleNode("department2Id") != null) { this.Department2Id = element.SelectSingleNode("department2Id").InnerText; } if (element.SelectSingleNode("department3Id") != null) { this.Department3Id = element.SelectSingleNode("department3Id").InnerText; } this.OrganizationUnitId = element.SelectSingleNode("organizationId").InnerText; if (element.SelectSingleNode("roleId") != null) { this.RoleId = element.SelectSingleNode("roleId").InnerText; } if (element.SelectSingleNode("headship") != null) { this.Headship = element.SelectSingleNode("headship").InnerText; } if (element.SelectSingleNode("sex") != null) { this.Sex = element.SelectSingleNode("sex").InnerText; } if (element.SelectSingleNode("birthday") != null) { this.Birthday = Convert.ToDateTime(element.SelectSingleNode("birthday").InnerText); } if (element.SelectSingleNode("graduateDate") != null) { this.GraduationDate = Convert.ToDateTime(element.SelectSingleNode("graduateDate").InnerText); } if (element.SelectSingleNode("entryDate") != null) { this.EntryDate = Convert.ToDateTime(element.SelectSingleNode("entryDate").InnerText); } if (element.SelectSingleNode("promotionDate") != null) { this.PromotionDate = Convert.ToDateTime(element.SelectSingleNode("promotionDate").InnerText); } this.Mobile = element.SelectSingleNode("mobile").InnerText; this.Telephone = element.SelectSingleNode("telephone").InnerText; if (element.SelectSingleNode("email") != null) { this.Email = element.SelectSingleNode("email").InnerText; } if (element.SelectSingleNode("rtx") != null) { this.Rtx = element.SelectSingleNode("rtx").InnerText; } this.AssignedJobId = element.SelectSingleNode("assignedJobId").InnerText; XmlNodeList nodes = null; nodes = element.SelectNodes("partTimeJobs/partTimeJobId"); foreach (XmlNode node in nodes) { IAssignedJobInfo partTimeJob = MembershipManagement.Instance.AssignedJobService[node.InnerText]; if (partTimeJob != null) { this.PartTimeJobs.Add(partTimeJob); } } if (element.SelectSingleNode("jobId") != null) { this.JobId = element.SelectSingleNode("jobId").InnerText; } if (element.SelectSingleNode("jobGrade") != null) { this.JobGradeDisplayName = element.SelectSingleNode("jobGrade").InnerText; } this.ModifiedDate = Convert.ToDateTime(element.SelectSingleNode("updateDate").InnerText); }
// ------------------------------------------------------- // 保存 删除 // ------------------------------------------------------- #region 函数:Save(IAssignedJobInfo param) /// <summary>保存记录</summary> /// <param name="param">实例<see cref="IAssignedJobInfo"/>详细信息</param> /// <returns>实例<see cref="IAssignedJobInfo"/>详细信息</returns> public IAssignedJobInfo Save(IAssignedJobInfo param) { return(this.provider.Save(param)); }
/// <summary>同步信息</summary> /// <param name="param">岗位信息</param> public int SyncFromPackPage(IAssignedJobInfo param) { this.provider.SyncFromPackPage(param); return(0); }
// ------------------------------------------------------- // ���� ɾ�� // ------------------------------------------------------- #region 属性:Save(IMemberInfo param) /// <summary>������¼</summary> /// <param name="param">IMemberInfo ʵ����ϸ��Ϣ</param> /// <returns>IMemberInfo ʵ����ϸ��Ϣ</returns> public IMemberInfo Save(IMemberInfo param) { IMemberInfo originalObject = this.FindOne(param.Id); if (originalObject == null) { originalObject = param; } IRoleInfo defaultRole = null; IAssignedJobInfo defaultAssignedJob = null; // �����ֶ����� �Զ�������֯��Ϣ // AutoBindingOrganizationUnitByPrimaryKey : None | RoleId | AssignedJobId if (MembershipConfigurationView.Instance.AutoBindingOrganizationUnitByPrimaryKey == "RoleId" && !string.IsNullOrEmpty(param.RoleId)) { defaultRole = MembershipManagement.Instance.RoleService[param.RoleId]; param.OrganizationUnitId = defaultRole.OrganizationUnitId; this.SetDefaultOrganizationUnit(param.Account.Id, param.OrganizationUnitId); this.SetDefaultCorporationAndDepartmentsByOrganizationUnitId(param.Account.Id, param.OrganizationUnitId); } else if (MembershipConfigurationView.Instance.AutoBindingOrganizationUnitByPrimaryKey == "AssignedJobId" && !string.IsNullOrEmpty(param.AssignedJobId)) { defaultAssignedJob = MembershipManagement.Instance.AssignedJobService[param.AssignedJobId]; if (defaultAssignedJob != null) { param.OrganizationUnitId = defaultAssignedJob.OrganizationUnitId; this.SetDefaultOrganizationUnit(param.Account.Id, param.OrganizationUnitId); this.SetDefaultCorporationAndDepartmentsByOrganizationUnitId(param.Account.Id, param.OrganizationUnitId); } } else if (MembershipConfigurationView.Instance.AutoBindingOrganizationUnitByPrimaryKey == "Self" && !string.IsNullOrEmpty(param.OrganizationUnitId)) { // �����ֶ�����������֯��Ϣ this.SetDefaultOrganizationUnit(param.Account.Id, param.OrganizationUnitId); this.SetDefaultCorporationAndDepartmentsByOrganizationUnitId(param.Account.Id, param.OrganizationUnitId); } // ���ݸ�λ���� �Զ�����ְλ��Ϣ if (MembershipConfigurationView.Instance.AutoBindingJobByPrimaryKey == "AssignedJobId" && !string.IsNullOrEmpty(param.AssignedJobId)) { if (defaultAssignedJob == null) { defaultAssignedJob = MembershipManagement.Instance.AssignedJobService[param.AssignedJobId]; } if (defaultAssignedJob != null) { this.SetDefaultJob(param.Account.Id, defaultAssignedJob.JobId); } } else if (MembershipConfigurationView.Instance.AutoBindingJobByPrimaryKey == "Self" && !string.IsNullOrEmpty(param.JobId)) { // ����������������ְλ��Ϣ this.SetDefaultJob(param.Account.Id, param.JobId); } // ���ݸ�λ���� �Զ�����ְ����Ϣ if (MembershipConfigurationView.Instance.AutoBindingJobGradeByPrimaryKey == "AssignedJobId" && !string.IsNullOrEmpty(param.AssignedJobId)) { if (defaultAssignedJob == null) { defaultAssignedJob = MembershipManagement.Instance.AssignedJobService[param.AssignedJobId]; } if (defaultAssignedJob != null) { this.SetDefaultJobGrade(param.Account.Id, defaultAssignedJob.JobGradeId); } } else if (MembershipConfigurationView.Instance.AutoBindingJobGradeByPrimaryKey == "Self" && !string.IsNullOrEmpty(param.JobGradeId)) { // ����Ĭ����������ְ����Ϣ this.SetDefaultJobGrade(param.Account.Id, param.JobGradeId); } // ������֯ȫ·�� param.FullPath = CombineFullPath(param.Account.Name, param.OrganizationUnitId); param = provider.Save(param); // 1.������չ��Ϣ if (param.ExtensionInformation != null) { param.ExtensionInformation.Save(); } // 2.����Ĭ�Ͻ�ɫ��Ϣ if (param.Role != null) { MembershipManagement.Instance.RoleService.SetDefaultRelation(param.Account.Id, param.Role.Id); } // 3.����Ĭ�ϸ�λ��Ϣ if (param.AssignedJob != null) { MembershipManagement.Instance.AssignedJobService.RemoveDefaultRelation(param.Account.Id); MembershipManagement.Instance.AssignedJobService.SetDefaultRelation(param.Account.Id, param.AssignedJob.Id); } // 4.���ü�ְ��Ϣ if (param.PartTimeJobs.Count > 0) { this.BindPartTimeJobs(param); } else if (param.PartTimeJobs.Count == 0 && originalObject.PartTimeJobs.Count > 0) { // �Ƴ���Ĭ�ϸ�λ��ϵ MembershipManagement.Instance.AssignedJobService.RemoveNondefaultRelation(param.Account.Id); } return(param); }