//改 public bool DocDistrbuteInfoUpdate(T_OA_DISTRIBUTEUSER obj) { using (BumfCompanyDocDistrbuteManagementBll DocDistrbuteBll = new BumfCompanyDocDistrbuteManagementBll()) { return(DocDistrbuteBll.UpdateDocDistrbuteInfo(obj)); } }
/// <summary> /// 修改时,并未从新选择分发范围时,对选择的数据进行转换 /// </summary> private void TransformDataForSave(T_OA_DISTRIBUTEUSER transform) { var ohterData = distributeView.oldDistributeuserList.Where(item => item.DISTRIBUTEUSERID == transform.DISTRIBUTEUSERID).Select(item => item); if (ohterData.Count() > 0) { T_OA_DISTRIBUTEUSER _distributeuser = ohterData.FirstOrDefault(); transform.VIEWTYPE = _distributeuser.VIEWTYPE; transform.VIEWER = _distributeuser.VIEWER; } }
//增 public string DocDistrbuteAdd(T_OA_DISTRIBUTEUSER obj) { using (BumfCompanyDocDistrbuteManagementBll DocDistrbuteBll = new BumfCompanyDocDistrbuteManagementBll()) { string returnStr = ""; bool sucess = DocDistrbuteBll.AddDocDistrbuteInfo(obj); if (sucess == false) { returnStr = "添加公文发布失败"; } return(returnStr); } }
/// <summary> /// 生成待办任务 /// </summary> private void CreateNotifyTask(T_OA_DISTRIBUTEUSER notifyfeedback) { EngineWcfGlobalFunctionClient engClient = new EngineWcfGlobalFunctionClient(); CustomUserMsg[] cust = new CustomUserMsg[1]; cust[0] = new CustomUserMsg() { FormID = notifyfeedback.DISTRIBUTEUSERID, UserID = notifyfeedback.OWNERID }; string strXmlObjectSource = string.Empty; strXmlObjectSource = ObjListToXml <T_OA_DISTRIBUTEUSER>(notifyfeedback, "OA"); engClient.ApplicationMsgTrigger(cust, "OA", "T_OA_DISTRIBUTEUSER", strXmlObjectSource, MsgType.Task); }
private void AddDistributeObjList(SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj issuanceExtOrgObj, string issuanceID) { T_OA_DISTRIBUTEUSER distributeTmp = new T_OA_DISTRIBUTEUSER(); distributeTmp.DISTRIBUTEUSERID = Guid.NewGuid().ToString(); distributeTmp.MODELNAME = "HousingIssuance"; distributeTmp.FORMID = issuanceID; distributeTmp.VIEWTYPE = ((int)GetObjectType(issuanceExtOrgObj)).ToString(); if (distributeTmp.VIEWTYPE == ((int)IssuanceObjectType.Post).ToString()) //如果是选择岗位,则保存岗位级别 { //if (!string.IsNullOrEmpty((issuanceExtOrgObj.ObjectInstance as T_HR_POST).POSTLEVEL.ToString())) //{ // distributeTmp.VIEWER = (issuanceExtOrgObj.ObjectInstance as T_HR_POST).POSTLEVEL.ToString(); //} //else //{ // distributeTmp.VIEWER = (issuanceExtOrgObj.ObjectInstance as T_HR_POST).T_HR_POSTDICTIONARY.POSTLEVEL.ToString(); //} } else { if (!string.IsNullOrEmpty(issuanceExtOrgObj.ObjectID)) { distributeTmp.VIEWER = issuanceExtOrgObj.ObjectID; } else { distributeTmp.VIEWER = Utility.ReturnIssuranceObjID(issuanceExtOrgObj); } } distributeTmp.CREATEDATE = DateTime.Now; distributeTmp.CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID; distributeTmp.CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName; distributeTmp.CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID; distributeTmp.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; distributeTmp.CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; distributeTmp.OWNERID = Common.CurrentLoginUserInfo.EmployeeID;; distributeTmp.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName; distributeTmp.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID; distributeTmp.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; distributeTmp.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; if (distributeTmp.VIEWTYPE != ((int)IssuanceObjectType.Post).ToString()) //不提供按部门下的岗位发布 { distributeLists.Add(distributeTmp); } }
/// <summary> /// 获取调查申请数据 /// </summary> void BindingDataByRequire() { distributeEntity.T_OA_SATISFACTIONREQUIRE = new T_OA_SATISFACTIONREQUIRE(); distribute = new T_OA_DISTRIBUTEUSER(); distributeEntity.T_OA_SATISFACTIONREQUIRE.SATISFACTIONREQUIREID = scheme.DataView.Satisfactionrequireid; distributeEntity.DISTRIBUTETITLE = scheme.DataView.SurveyTitle; TxtTitle.Text = distributeEntity.DISTRIBUTETITLE; distributeEntity.CONTENT = scheme.DataView.Content; TxtContent.Text = distributeEntity.CONTENT; formId = scheme.DataView.Satisfactionrequireid; if (string.IsNullOrEmpty(scheme.DataView.AnswerGroupid)) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); return; } RefreshUI(RefreshedTypes.ShowProgressBar); permissionClient.GetSysDictionaryByFatherIDAsync(scheme.DataView.AnswerGroupid); }
void SatisfactionDistributeChildWindow_Loaded(object sender, RoutedEventArgs e) { EventRegister(); distributeEntity = new T_OA_SATISFACTIONDISTRIBUTE(); distribute = new T_OA_DISTRIBUTEUSER(); distributeuserList = new ObservableCollection<T_OA_DISTRIBUTEUSER>(); distributeEntity.T_OA_SATISFACTIONREQUIRE = new T_OA_SATISFACTIONREQUIRE(); if (actionType != FormTypes.New) { if (string.IsNullOrEmpty(distributeId)) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); return; } if (actionType == FormTypes.Browse) { this.contextInfo.IsEnabled = false; } RefreshUI(RefreshedTypes.ShowProgressBar); client.GetSatisfactionDistributeChildAsync(distributeId); return; } }
void SatisfactionDistributeChildWindow_Loaded(object sender, RoutedEventArgs e) { EventRegister(); distributeEntity = new T_OA_SATISFACTIONDISTRIBUTE(); distribute = new T_OA_DISTRIBUTEUSER(); distributeuserList = new ObservableCollection <T_OA_DISTRIBUTEUSER>(); distributeEntity.T_OA_SATISFACTIONREQUIRE = new T_OA_SATISFACTIONREQUIRE(); if (actionType != FormTypes.New) { if (string.IsNullOrEmpty(distributeId)) { ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); return; } if (actionType == FormTypes.Browse) { this.contextInfo.IsEnabled = false; } RefreshUI(RefreshedTypes.ShowProgressBar); client.GetSatisfactionDistributeChildAsync(distributeId); return; } }
private void AddDistributeObjList(SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj issuanceExtOrgObj, string issuanceID) { T_OA_DISTRIBUTEUSER distributeTmp = new T_OA_DISTRIBUTEUSER(); distributeTmp.DISTRIBUTEUSERID = Guid.NewGuid().ToString(); distributeTmp.MODELNAME = "HousingIssuance"; distributeTmp.FORMID = issuanceID; distributeTmp.VIEWTYPE = ((int)GetObjectType(issuanceExtOrgObj)).ToString(); if (distributeTmp.VIEWTYPE == ((int)IssuanceObjectType.Post).ToString()) //如果是选择岗位,则保存岗位级别 { //if (!string.IsNullOrEmpty((issuanceExtOrgObj.ObjectInstance as T_HR_POST).POSTLEVEL.ToString())) //{ // distributeTmp.VIEWER = (issuanceExtOrgObj.ObjectInstance as T_HR_POST).POSTLEVEL.ToString(); //} //else //{ // distributeTmp.VIEWER = (issuanceExtOrgObj.ObjectInstance as T_HR_POST).T_HR_POSTDICTIONARY.POSTLEVEL.ToString(); //} } else { if (!string.IsNullOrEmpty(issuanceExtOrgObj.ObjectID)) { distributeTmp.VIEWER = issuanceExtOrgObj.ObjectID; } else { distributeTmp.VIEWER = Utility.ReturnIssuranceObjID(issuanceExtOrgObj); } } distributeTmp.CREATEDATE = DateTime.Now; distributeTmp.CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID; distributeTmp.CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName; distributeTmp.CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID; distributeTmp.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; distributeTmp.CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; distributeTmp.OWNERID = Common.CurrentLoginUserInfo.EmployeeID; ; distributeTmp.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName; distributeTmp.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID; distributeTmp.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; distributeTmp.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; if (distributeTmp.VIEWTYPE != ((int)IssuanceObjectType.Post).ToString()) //不提供按部门下的岗位发布 { distributeLists.Add(distributeTmp); } }
//批量添加文档发布 public bool DocDistrbuteBatchAdd(T_OA_DISTRIBUTEUSER[] obj) { using (BumfCompanyDocDistrbuteManagementBll DocDistrbuteBll = new BumfCompanyDocDistrbuteManagementBll()) { return DocDistrbuteBll.BatchAddDocDistrbuteInfo(obj); } }
private void SendDocByCompanyid(string companyid) { Dictionary <string, string> dicCompany = new Dictionary <string, string>(); string strSunCompany = @"select c.companyid,c.cname from smthrm.t_hr_company c where c.fatherid='" + companyid + "'"; OracleHelp.Connect(); DataTable dtsun = OracleHelp.getTable(strSunCompany); if (dtsun != null) { if (dtsun.Rows.Count > 0) { for (int i = 0; i < dtsun.Rows.Count; i++) { dicCompany.Add(dtsun.Rows[i]["cname"].ToString(), dtsun.Rows[i]["companyid"].ToString()); string strGrandSunCompany = @"select c.companyid,c.cname from smthrm.t_hr_company c where c.fatherid='" + dtsun.Rows[i]["companyid"].ToString() + "'"; DataTable dtGrandSun = OracleHelp.getTable(strGrandSunCompany); if (dtGrandSun != null) { if (dtGrandSun.Rows.Count > 0) { for (int j = 0; j < dtGrandSun.Rows.Count; j++) { dicCompany.Add(dtGrandSun.Rows[j]["cname"].ToString(), dtGrandSun.Rows[j]["companyid"].ToString()); } } } } } } OracleHelp.close(); if (string.IsNullOrEmpty(TxtSendDocid.Text)) { MessageBox.Show("请先查询公文id"); return; } string msg = string.Empty; ObservableCollection <T_OA_DISTRIBUTEUSER> distributeAddList = new ObservableCollection <T_OA_DISTRIBUTEUSER>(); SmtOACommonOfficeClient DocDistrbuteClient = new SmtOACommonOfficeClient(); ObservableCollection <string> CompanyIDsList = new ObservableCollection <string>(); ObservableCollection <string> StrDepartmentIDsList = new ObservableCollection <string>(); //获取部门ID ObservableCollection <string> StrPositionIDsList = new ObservableCollection <string>(); ObservableCollection <string> StrStaffList = new ObservableCollection <string>(); //员工ID if (dicCompany.Count > 0) { foreach (var q in dicCompany) { //if (q.Key == "杭州新神州通货物运输有限公司") continue; ShowMessage("发布公文给这个公司:" + q.Key + " 公司id:" + q.Value); CompanyIDsList.Add(q.Value); T_OA_DISTRIBUTEUSER distributeTmp = new T_OA_DISTRIBUTEUSER(); distributeTmp.DISTRIBUTEUSERID = Guid.NewGuid().ToString(); distributeTmp.MODELNAME = "CompanySendDoc"; distributeTmp.FORMID = TxtSendDocid.Text; distributeTmp.VIEWTYPE = "0";//公司 distributeTmp.VIEWER = q.Value; distributeTmp.CREATEDATE = DateTime.Now; distributeTmp.CREATEUSERID = GlobalParameters.employeeid; distributeTmp.CREATEUSERNAME = GlobalParameters.employeeName; distributeTmp.CREATEPOSTID = GlobalParameters.employeeMasterPostid; distributeTmp.CREATEDEPARTMENTID = GlobalParameters.employeeMasterDepartmentid; distributeTmp.CREATECOMPANYID = GlobalParameters.employeeMasterCompanyid; distributeTmp.OWNERID = GlobalParameters.employeeid; distributeTmp.OWNERNAME = GlobalParameters.employeeName; distributeTmp.OWNERPOSTID = GlobalParameters.employeeMasterPostid; distributeTmp.OWNERDEPARTMENTID = GlobalParameters.employeeMasterDepartmentid; distributeTmp.OWNERCOMPANYID = GlobalParameters.employeeMasterCompanyid; distributeAddList.Add(distributeTmp); } ShowMessage("发布公文给所有公司完毕,共发送:" + dicCompany.Count + " 条数据"); } V_BumfCompanySendDoc tmpSenddoc = DocDistrbuteClient.GetBumfDocInfo(TxtSendDocid.Text); if (tmpSenddoc.OACompanySendDoc == null) { MessageBox.Show("通过id获取的公文为空,请检查后再试"); return; } T_OA_SENDDOC sendDoc = tmpSenddoc.OACompanySendDoc; sendDoc.T_OA_SENDDOCTYPE = null; sendDoc.T_OA_SENDDOCTYPEReference = null; DocDistrbuteClient.BatchAddCompanyDocDistrbuteForNew(distributeAddList.ToArray(), CompanyIDsList.ToArray(), StrDepartmentIDsList.ToArray(), StrPositionIDsList.ToArray(), StrStaffList.ToArray(), sendDoc); //MessageBox.Show("发布公文成功!"); }
//改 public bool DocDistrbuteInfoUpdate(T_OA_DISTRIBUTEUSER obj) { using (BumfCompanyDocDistrbuteManagementBll DocDistrbuteBll = new BumfCompanyDocDistrbuteManagementBll()) { return DocDistrbuteBll.UpdateDocDistrbuteInfo(obj); } }
//批量添加文档发布 public bool BatchAddCompanyDocDistrbute(T_OA_DISTRIBUTEUSER[] obj, List<string> employeeids, T_OA_SENDDOC doc) { using (BumfCompanyDocDistrbuteManagementBll DocDistrbuteBll = new BumfCompanyDocDistrbuteManagementBll()) { return DocDistrbuteBll.BatchAddDocDistrbuteInfoOnlyDoc(obj, employeeids, doc); } }
private void AddDistributeObjList(SMT.SaaS.FrameworkUI.OrganizationControl.ExtOrgObj issuanceExtOrgObj, string issuanceID) { T_OA_DISTRIBUTEUSER distributeTmp = new T_OA_DISTRIBUTEUSER(); distributeTmp.DISTRIBUTEUSERID = Guid.NewGuid().ToString(); distributeTmp.MODELNAME = "CompanySendDoc"; distributeTmp.FORMID = issuanceID; distributeTmp.VIEWTYPE = ((int)GetObjectType(issuanceExtOrgObj)).ToString(); if (distributeTmp.VIEWTYPE == ((int)IssuanceObjectType.Post).ToString()) //如果是选择岗位,则保存岗位级别 { //if (!string.IsNullOrEmpty((issuanceExtOrgObj.ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_POST).POSTLEVEL.ToString())) //{ // distributeTmp.VIEWER = (issuanceExtOrgObj.ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_POST).POSTLEVEL.ToString(); //} //else //{ // distributeTmp.VIEWER = (issuanceExtOrgObj.ObjectInstance as SMT.Saas.Tools.OrganizationWS.T_HR_POST).T_HR_POSTDICTIONARY.POSTLEVEL.ToString(); //} } else { distributeTmp.VIEWER = issuanceExtOrgObj.ObjectID; } distributeTmp.CREATEDATE = DateTime.Now; distributeTmp.CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID; distributeTmp.CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName; distributeTmp.CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID; distributeTmp.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; distributeTmp.CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; distributeTmp.OWNERID = Common.CurrentLoginUserInfo.EmployeeID; distributeTmp.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName; distributeTmp.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID; distributeTmp.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID; distributeTmp.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID; if (distributeTmp.VIEWTYPE != ((int)IssuanceObjectType.Post).ToString()) //如果是选择岗位,则保存岗位级别 { var ents = from ent in distributeLists where ent.FORMID == distributeTmp.FORMID && ent.VIEWER == distributeTmp.VIEWER && ent.VIEWTYPE == distributeTmp.VIEWTYPE select ent; if (ents.Count() == 0) { distributeLists.Add(distributeTmp); } } }
private void SendDocByCompanyid(string companyid) { Dictionary<string, string> dicCompany=new Dictionary<string,string>(); string strSunCompany = @"select c.companyid,c.cname from smthrm.t_hr_company c where c.fatherid='" + companyid + "'"; OracleHelp.Connect(); DataTable dtsun = OracleHelp.getTable(strSunCompany); if (dtsun != null) { if (dtsun.Rows.Count > 0) { for (int i = 0; i < dtsun.Rows.Count; i++) { dicCompany.Add(dtsun.Rows[i]["cname"].ToString(), dtsun.Rows[i]["companyid"].ToString()); string strGrandSunCompany = @"select c.companyid,c.cname from smthrm.t_hr_company c where c.fatherid='" + dtsun.Rows[i]["companyid"].ToString() + "'"; DataTable dtGrandSun = OracleHelp.getTable(strGrandSunCompany); if (dtGrandSun != null) { if (dtGrandSun.Rows.Count > 0) { for (int j = 0; j < dtGrandSun.Rows.Count; j++) { dicCompany.Add(dtGrandSun.Rows[j]["cname"].ToString(), dtGrandSun.Rows[j]["companyid"].ToString()); } } } } } } OracleHelp.close(); if (string.IsNullOrEmpty(TxtSendDocid.Text)) { MessageBox.Show("请先查询公文id"); return; } string msg = string.Empty; ObservableCollection<T_OA_DISTRIBUTEUSER> distributeAddList = new ObservableCollection<T_OA_DISTRIBUTEUSER>() ; SmtOACommonOfficeClient DocDistrbuteClient = new SmtOACommonOfficeClient(); ObservableCollection<string> CompanyIDsList = new ObservableCollection<string>(); ObservableCollection<string> StrDepartmentIDsList = new ObservableCollection<string>(); //获取部门ID ObservableCollection<string> StrPositionIDsList = new ObservableCollection<string>(); ObservableCollection<string> StrStaffList = new ObservableCollection<string>(); //员工ID if (dicCompany.Count > 0) { foreach (var q in dicCompany) { //if (q.Key == "杭州新神州通货物运输有限公司") continue; ShowMessage("发布公文给这个公司:"+q.Key+" 公司id:"+q.Value); CompanyIDsList.Add(q.Value); T_OA_DISTRIBUTEUSER distributeTmp = new T_OA_DISTRIBUTEUSER(); distributeTmp.DISTRIBUTEUSERID = Guid.NewGuid().ToString(); distributeTmp.MODELNAME = "CompanySendDoc"; distributeTmp.FORMID = TxtSendDocid.Text; distributeTmp.VIEWTYPE = "0";//公司 distributeTmp.VIEWER = q.Value; distributeTmp.CREATEDATE = DateTime.Now; distributeTmp.CREATEUSERID =GlobalParameters.employeeid; distributeTmp.CREATEUSERNAME = GlobalParameters.employeeName; distributeTmp.CREATEPOSTID = GlobalParameters.employeeMasterPostid; distributeTmp.CREATEDEPARTMENTID = GlobalParameters.employeeMasterDepartmentid; distributeTmp.CREATECOMPANYID = GlobalParameters.employeeMasterCompanyid; distributeTmp.OWNERID =GlobalParameters.employeeid; distributeTmp.OWNERNAME = GlobalParameters.employeeName; distributeTmp.OWNERPOSTID = GlobalParameters.employeeMasterPostid; distributeTmp.OWNERDEPARTMENTID = GlobalParameters.employeeMasterDepartmentid; distributeTmp.OWNERCOMPANYID = GlobalParameters.employeeMasterCompanyid; distributeAddList.Add(distributeTmp); } ShowMessage("发布公文给所有公司完毕,共发送:" + dicCompany.Count+ " 条数据"); } V_BumfCompanySendDoc tmpSenddoc=DocDistrbuteClient.GetBumfDocInfo(TxtSendDocid.Text); if (tmpSenddoc.OACompanySendDoc == null) { MessageBox.Show("通过id获取的公文为空,请检查后再试"); return; } T_OA_SENDDOC sendDoc = tmpSenddoc.OACompanySendDoc; sendDoc.T_OA_SENDDOCTYPE = null; sendDoc.T_OA_SENDDOCTYPEReference = null; DocDistrbuteClient.BatchAddCompanyDocDistrbuteForNew(distributeAddList.ToArray(), CompanyIDsList.ToArray(), StrDepartmentIDsList.ToArray(), StrPositionIDsList.ToArray(), StrStaffList.ToArray(), sendDoc); //MessageBox.Show("发布公文成功!"); }
//增 public string DocDistrbuteAdd(T_OA_DISTRIBUTEUSER obj) { using (BumfCompanyDocDistrbuteManagementBll DocDistrbuteBll = new BumfCompanyDocDistrbuteManagementBll()) { string returnStr = ""; bool sucess = DocDistrbuteBll.AddDocDistrbuteInfo(obj); if (sucess == false) { returnStr = "添加公文发布失败"; } return returnStr; } }