/// <summary> /// 选择前过滤数据 /// </summary> /// <param name="e"></param> public override void BeforeF7Select(BeforeF7SelectEventArgs e) { //base.BeforeF7Select(e); switch (e.FieldKey) { case "FApply": FilterStaffByOrganization(e); break; case "FApplyID": FilterStaffByOrganization(e); break; case "F_ora_Applicant": FilterStaffByOrganization(e); break; case "F_ora_Handler": //调职,工作交接人 FilterStaffByOrganization(e); break; case "FHandler": //离职,工作交接人 FilterStaffByOrganization(e); break; case "F_ora_Leader": //续签,直接领导 FilterStaffByOrganization(e); break; case "F_ora_rcvDiver": //用车,司机 FilterDriver(e); break; } }
public override void BeforeF7Select(BeforeF7SelectEventArgs e) { if (e.BaseDataField == null) { return; } if (e.FieldKey == "F_PAEZ_Base") { int TsRow = this.Model.GetEntryCurrentRowIndex("F_PAEZ_TSID"); DynamicObject Paez_Tsid = this.Model.GetValue("F_PAEZ_TSID", TsRow) as DynamicObject; if (null != Paez_Tsid) { string filter = string.Format(" (f_paez_tano= {0} )", Paez_Tsid["number"].ToString()); //销售厚度过滤条件加上去 if (string.IsNullOrEmpty(e.ListFilterParameter.Filter)) { e.ListFilterParameter.Filter = filter; } else { filter = " And " + filter; e.ListFilterParameter.Filter += filter; } } } }
/// <summary> /// 根据表单选择的组织过滤员工 /// </summary> /// <param name="e"></param> private void FilterStaffByOrganization(BeforeF7SelectEventArgs e) { string orgId = this.View.Model.DataObject[GetApplySign()["FOrgId"]] == null ? "0" : (this.View.Model.DataObject[GetApplySign()["FOrgId"]] as DynamicObject)["Id"].ToString(); if (orgId == "0") { return; } string sql = ""; if (IsNotBYQ()) { sql = string.Format(@" SELECT FID FROM T_BD_STAFFTEMP st INNER JOIN T_BD_STAFF s on st.FSTAFFID=s.FSTAFFID and s.FDOCUMENTSTATUS='C' and s.FFORBIDSTATUS='A' WHERE st.FISFIRSTPOST='1' AND st.FWORKORGID='{0}'", orgId); } else { sql = string.Format(@"/*dialect*/ SELECT DISTINCT FID FROM T_BD_STAFFTEMP st INNER JOIN T_BD_STAFF s on st.FSTAFFID=s.FSTAFFID and s.FDOCUMENTSTATUS='C' and s.FFORBIDSTATUS='A' INNER JOIN T_BD_Department d on d.FDeptId=[dbo].[fun_czty_GetWorkDeptID](st.FDeptId) WHERE FISFIRSTPOST='1' AND d.FUseOrgId='{0}'", orgId); } var objs = CZDB_GetData(sql); string filter = objs.Count <= 0 ? "0" : string.Join(",", objs.Select(i => i["FID"].ToString()).ToArray()); filter = $"FID in ({filter})"; e.ListFilterParameter.Filter = filter; }
/// <summary> /// 过滤基价方案 /// </summary> private void Act_FilterScheme(BeforeF7SelectEventArgs e) { string _UserId = this.Context.UserId.ToString(); string _FMtlGroup = this.View.Model.GetValue("FMtlGroup") == null ? "0" : (this.View.Model.GetValue("FMtlGroup") as DynamicObject)["Id"].ToString(); //string filter = " FID in ("; //if(_FMtlGroup != "0") //{ // string sql = string.Format("select FID from ora_CrmBD_BPScheme where FCreatorId='{0}' and FMtlGroup='{1}'", _UserId, _FMtlGroup); // var objs = CZDB_GetData(sql); // for (int i = 0; i < objs.Count; i++) // { // filter += "'" + objs[i]["FID"].ToString() + "'"; // if (i < objs.Count - 1) filter += ","; // } // if (objs.Count <= 0) // { // filter += "'0'"; // } //} //else //{ // filter += "'0'"; //} //filter += ")"; string filter = string.Format(" FCreatorId='{0}' and FMtlGroup='{1}'", _UserId, _FMtlGroup); e.ListFilterParameter.Filter = filter; }
public override void BeforeF7Select(BeforeF7SelectEventArgs e) { string key; switch (key = e.FieldKey.ToUpperInvariant()) { case "FSALEOFROM": this.GetSaleOrderListData(e, "FSaleOFrom", "SAL_SaleOrder", "FBILLNO"); break; case "FSALEOTO": this.GetSaleOrderListData(e, "FSaleOTo", "SAL_SaleOrder", "FBILLNO"); break; case "FCUSTOMERFROM": case "FCUSTOMERTO": case "FMATERIALFROM": case "FMATERIALTO": case "FSALESFROM": case "FSALESTO": { string text = this.View.Model.GetValue("FSaleOrgList").ToString(); if (text.Length == 0) { this.View.ShowMessage(ResManager.LoadKDString("请先选择销售组织!", "004104030002440", SubSystemType.SCM, new object[0]), MessageBoxType.Notice); e.Cancel = true; return; } ListShowParameter listShowParameter = e.DynamicFormShowParameter as ListShowParameter; listShowParameter.MutilListUseOrgId = text; break; } } base.BeforeF7Select(e); }
/// <summary> /// 根据表单选择的组织过滤员工 /// </summary> /// <param name="e"></param> private void FilterStaffByOrganization(BeforeF7SelectEventArgs e) { string filter = "FID in ("; string orgId = this.View.BillModel.DataObject[GetApplySign()["FOrgId"]] == null ? "0" : (this.View.BillModel.DataObject[GetApplySign()["FOrgId"]] as DynamicObject)["Id"].ToString(); if (orgId == "0") { return; } string sql = string.Format("SELECT es.FID FROM T_BD_STAFFTEMP es INNER JOIN T_BD_DEPARTMENT d on es.FDEPTID=d.FDEPTID WHERE es.FISFIRSTPOST='1' AND d.FUSEORGID='{0}'", orgId); var objs = DBUtils.ExecuteDynamicObject(this.Context, sql); for (int i = 0; i < objs.Count; i++) { filter += "'" + objs[i]["FID"].ToString() + "'"; if (i < objs.Count - 1) { filter += ","; } } if (objs.Count <= 0) { filter += "'0'"; } filter += ')'; e.ListFilterParameter.Filter = filter; }
//项目进展过滤 public override void BeforeF7Select(BeforeF7SelectEventArgs e) { base.BeforeF7Select(e); if (e.FieldKey.ToUpper().Equals("F_PEJK_PROPROCESS")) { //项目进展按照产品进行过滤 DynamicObject proCode = this.Model.GetValue("F_PEJK_CRMProCode", e.Row) as DynamicObject; if (proCode == null) { return; } DynamicObjectCollection ProProcess = proCode["PEJK_Cust_CRMPROENTRY"] as DynamicObjectCollection; if (ProProcess == null || ProProcess.Count() == 0) { return; } List <long> ProprocessIds = new List <long>(); foreach (var item in ProProcess) { ProprocessIds.Add(Convert.ToInt64(item["F_PEJK_ProProcess_Id"])); } string str = string.Join(",", ProprocessIds); string filter = string.Format(" FID IN ({0})", str); if (string.IsNullOrEmpty(e.ListFilterParameter.Filter)) { e.ListFilterParameter.Filter = filter; } else { filter = " And " + filter; e.ListFilterParameter.Filter += filter; } } }
/// <summary> /// 显示基础资料列表之前调用 /// 通过重载本事件,可以设置必要的过滤条件,以限定检索范围; /// </summary> /// <param name="e"></param> public override void BeforeF7Select(BeforeF7SelectEventArgs e) { string _crmFilter; switch (e.FieldKey.ToUpperInvariant()) { //case "FXXX":通过字段的Key[大写]来区分不同的基础资料 // e.ListFilterParameter.Filter = "FXXX= AND fxxy=";过滤的字段使用对应基础资料的字段的Key,支持ksql语法 //break; case "FCRMHDORGID": _crmFilter = STR_HoldOrg; if (_crmFilter != "") { e.ListFilterParameter.Filter = " FOrgID in(" + _crmFilter + ")"; } break; case "FCRMHDDEPT": _crmFilter = STR_HoldDept; if (_crmFilter != "") { e.ListFilterParameter.Filter = " FDEPTID in(" + _crmFilter + ")"; } break; case "FCUSTID": //e.ListFilterParameter.Filter = FilterCustomerBySeller(); break; default: break; } base.BeforeF7Select(e); }
public override void BeforeF7Select(BeforeF7SelectEventArgs e) { base.BeforeF7Select(e); if (e.FieldKey.ToUpperInvariant().Equals("F_LHR_HSWD")) { DynamicObject dot = (DynamicObject)this.Model.GetValue("F_LHR_ACCOUNT"); long acctId = Convert.ToInt64(dot["Id"]); //根据已选择的科目进行基础资料过滤 string strSql = string.Format(@"/*dialect*/select af.FFLEXITEMPROPERTYID from T_BD_ACCOUNT ac inner join T_BD_ACCOUNTFLEXENTRY af on ac.FACCTID = af.FACCTID where ac.FACCTID = {0}", acctId); DynamicObjectCollection doc = DBUtils.ExecuteDynamicObject(this.Context, strSql) as DynamicObjectCollection; string wdId = ""; foreach (DynamicObject dt in doc) { wdId += "," + Convert.ToInt64(dt["FFLEXITEMPROPERTYID"]) + ""; } wdId = wdId.Substring(1);//客户维度 string filter = string.Format(" F_LHR_HSWD IN ({0})", wdId); if (string.IsNullOrEmpty(e.ListFilterParameter.Filter)) { e.ListFilterParameter.Filter = filter; } else { e.ListFilterParameter.Filter += " AND " + filter; } } }
/// <summary> /// 用车申请,过滤司机 /// </summary> /// <param name="e"></param> private void FilterDriver(BeforeF7SelectEventArgs e) { string sql = @"SELECT se.FID FROM T_BD_STAFFTEMP se INNER JOIN T_ORG_POST_L p ON se.FPOSTID = p.FPOSTID WHERE p.FNAME = '驾驶员'"; var objs = CZDB_GetData(sql); if (objs.Count > 0) { string filter = "FID in ("; for (int i = 0; i < objs.Count; i++) { filter += "'" + objs[i]["FID"].ToString() + "'"; if (i < objs.Count - 1) { filter += ","; } } if (objs.Count <= 0) { filter += "'0'"; } filter += ")"; e.ListFilterParameter.Filter = filter; } }
public override void BeforeF7Select(BeforeF7SelectEventArgs e) { base.BeforeF7Select(e); string key = e.FieldKey.ToUpperInvariant(); switch (key) { case "FCUSTNAME": //客户 break; } }
//string Path = @"D:\凯路调试.txt"; public override void BeforeF7Select(BeforeF7SelectEventArgs e) { base.BeforeF7Select(e); string ActionKey = e.FieldKey.ToUpper(); if (ActionKey == "FMATERIALID") { var a = this.View.GetFieldEditor("FMATERIALID", e.Row); var DataSource = this.Model.DataObject; //采用SQL注入来实现自定义 e.ListFilterParameter.Filter = "FMODIFIERID = 100007 AND t0.FMATERIALID IN (100612,100614,100589))))))--"; } }
private void SelectDimensionValue(string formid, BeforeF7SelectEventArgs e, DimentionScopeType scopetype) { ListShowParameter parameter2 = new ListShowParameter { FormId = formid, ParentPageId = this.View.PageId, MultiSelect = true, SyncCallBackAction = true, IsShowQuickFilter = false, IsLookUp = true }; ListShowParameter param = parameter2; long iD = base.Context.CurrentOrganizationInfo.ID; if (this.GetBaseDataType("FCtrlDimensionEntry", e.Row, "Dimension") == "10") { param.FormId = "BOS_ASSISTANTDATA_SELECT"; string str2 = string.Format("FID='{0}'", formid); if (str2.IsNullOrEmptyOrWhiteSpace()) { param.ListFilterParameter.Filter = str2; } else { param.ListFilterParameter.Filter = param.ListFilterParameter.Filter.JoinFilterString(str2, "AND"); } param.IsIsolationOrg = true; param.UseOrgId = base.Context.CurrentOrganizationInfo.ID; } else if (OrganizationServiceHelper.GetBaseDataType(base.Context, formid) == 2) { FormMetadata cachedFormMetaData = FormMetaDataCache.GetCachedFormMetaData(base.Context, formid); string pkFieldName = cachedFormMetaData.BusinessInfo.GetForm().PkFieldName; string masterPKFieldName = cachedFormMetaData.BusinessInfo.GetForm().MasterPKFieldName; string tableName = cachedFormMetaData.BusinessInfo.Entrys[0].TableName; string useOrgFieldKey = cachedFormMetaData.BusinessInfo.GetForm().UseOrgFieldKey; param.ListFilterParameter.Filter = param.ListFilterParameter.Filter.JoinFilterString(string.Format(" {0}={1} and {1} in (select distinct {1} from {2} where FDOCUMENTSTATUS='C' AND FFORBIDSTATUS='A' AND {3} ={4}) ", new object[] { pkFieldName, masterPKFieldName, tableName, useOrgFieldKey, iD }), "AND"); param.IsIsolationOrg = false; } else { param.IsIsolationOrg = true; param.UseOrgId = base.Context.CurrentOrganizationInfo.ID; } param.OpenStyle.ShowType = ShowType.Modal; this.View.ShowForm(param, delegate(Kingdee.BOS.Core.DynamicForm.FormResult formResult) { if (formResult != null) { this.FillSelectedDatas(formResult, e, scopetype); } }); }
public override void BeforeF7Select(BeforeF7SelectEventArgs e) { string _key = e.FieldKey.ToUpperInvariant(); switch (_key) { case "FSCHEME": //基价方案 Act_FilterScheme(e); break; default: break; } }
/// <summary> /// 显示基础资料列表之前调用 /// 通过重载本事件,可以设置必要的过滤条件,以限定检索范围; /// </summary> /// <param name="e"></param> public override void BeforeF7Select(BeforeF7SelectEventArgs e) { switch (e.FieldKey.ToUpperInvariant()) { //case "FXXX":通过字段的Key[大写]来区分不同的基础资料 // e.ListFilterParameter.Filter = "FXXX= AND fxxy=";过滤的字段使用对应基础资料的字段的Key,支持ksql语法 //break; case "": break; default: break; } }
public override void BeforeF7Select(BeforeF7SelectEventArgs e) { switch (e.FieldKey.ToUpperInvariant()) { case "FCUSTID": //客户 //string filter = FilterCustomerBySeller(); //e.ListFilterParameter.Filter = filter; break; default: break; } base.BeforeF7Select(e); }
public override void BeforeF7Select(BeforeF7SelectEventArgs e) { base.BeforeF7Select(e); if (e.FieldKey.ToUpper().Equals("FDEPTID")) { string filter = string.Format(" FDEPTTYPE = '4'"); if (string.IsNullOrEmpty(e.ListFilterParameter.Filter)) { e.ListFilterParameter.Filter = filter; } else { filter = " And " + filter; e.ListFilterParameter.Filter += filter; } } }
public override void BeforeF7Select(BeforeF7SelectEventArgs e) { string str2 = e.FieldKey.ToUpperInvariant(); if (str2 != null) { if (str2 != "FCUSTOMERNAME") { if (str2 != "FCONTACTNAME") { return; } } else { this.GetF8Value("CRM_CUST", "FCustomerName", "FCustomerID", ""); long lCustid = 0L; DynamicObject obj2 = (DynamicObject)base.View.Model.GetValue("FCustomerID"); if ((obj2 != null) && (obj2["Id"] != null)) { lCustid = Convert.ToInt64(obj2["Id"]); } this.GetCustInfo(lCustid); return; } long num2 = 0L; DynamicObject obj3 = (DynamicObject)base.View.Model.GetValue("FCustomerID"); if ((obj3 != null) && (obj3["Id"] != null)) { num2 = Convert.ToInt64(obj3["Id"]); } string strFilter = "1=0"; if (num2 > 0L) { strFilter = $" EXISTS(SELECT 1 FROM T_CRM_CONTACT WHERE T0.FCONTACTID=T_CRM_CONTACT.FCONTACTID AND T_CRM_CONTACT.FCUSTOMERID={num2})"; } this.GetF8Value("CRM_CUST_Contact", "FContactName", "FContactID", strFilter); long lCONTACTID = 0L; DynamicObject obj4 = (DynamicObject)base.View.Model.GetValue("FContactID"); if ((obj4 != null) && (obj4["Id"] != null)) { lCONTACTID = Convert.ToInt64(obj4["Id"]); } this.GetContactInfo(lCONTACTID); } }
public override void BeforeF7Select(BeforeF7SelectEventArgs e) { string filter = e.ListFilterParameter.Filter; string billFormId = this.GetBillFormId(); string str3 = e.FieldKey.ToUpperInvariant(); if (str3 != null) { if (!(str3 == "FSCHEMEID")) { if (str3 == "FRULEID") { e.ListFilterParameter.Filter = this.GetRuleFilter(filter); } else if (str3 == "FORGIDS") { e.ListFilterParameter.Filter = this.GetOrgFilter(filter); } else if (str3 == "FFILTERNAME") { DynamicObject obj2 = this.View.Model.GetValue("FDimension", e.Row) as DynamicObject; object obj3 = obj2["BaseDataType_Id"]; if (obj3 == null) { this.View.ShowNotificationMessage(this.WARNNING_SelectCtrlDimension, "", MessageBoxType.Notice); return; } billFormId = obj3.ToString(); this.SelectDimensionValue(billFormId, e, DimentionScopeType.Dimension); } else if (str3 == "FITEMDATATYPEIDS") { e.ListFilterParameter.Filter = this.GetItemDataFilter(filter); } } else { e.ListFilterParameter.Filter = this.GetSchemeFilter(filter); } } base.BeforeF7Select(e); }
private void GetSaleOrderListData(BeforeF7SelectEventArgs e, string key_Field, string FormId, string key_Item) { if (FormId == null || FormId.ToString().Length == 0) { return; } ListShowParameter listShowParameter = new ListShowParameter(); ListRegularFilterParameter listRegularFilterParameter = new ListRegularFilterParameter(); listRegularFilterParameter.Filter = string.Format(" FSALEORGID IN ({0})", this.selOrgId); listShowParameter.IsLookUp = true; listShowParameter.ListType = Convert.ToInt32(BOSEnums.Enu_ListType.BaseList); listShowParameter.ListFilterParameter.MergeFilter(e.ListFilterParameter); listShowParameter.IsShowUsed = false; listShowParameter.IsShowApproved = e.IsShowApproved; listShowParameter.FormId = FormId.ToString(); listShowParameter.MultiSelect = false; listShowParameter.PageId = string.Format("{0}_{1}_F7", this.View.PageId, listShowParameter.FormId); this.View.ShowForm(listShowParameter, delegate(FormResult result) { object returnData = result.ReturnData; if (returnData is ListSelectedRowCollection) { ListSelectedRowCollection listSelectedRowCollection = returnData as ListSelectedRowCollection; if (listSelectedRowCollection != null && !listSelectedRowCollection.IsEmpty <ListSelectedRow>()) { int row = e.Row; if (key_Item.Trim() == "FBILLNO") { this.Model.SetValue(key_Field, listSelectedRowCollection[0].BillNo, row); } if (key_Item.Trim() == "FNUMBER") { this.Model.SetValue(key_Field, listSelectedRowCollection[0].Number, row); } } } }); }
private void FillSelectedDatas(Kingdee.BOS.Core.DynamicForm.FormResult fre, BeforeF7SelectEventArgs e, DimentionScopeType scopetype) { if ((fre != null) && (fre.ReturnData != null)) { ListSelectedRowCollection returnData = (ListSelectedRowCollection)fre.ReturnData; if ((returnData != null) && (returnData.Count != 0)) { StringBuilder builder = new StringBuilder(); StringBuilder builder2 = new StringBuilder(); bool flag = false; foreach (ListSelectedRow row in returnData) { if (flag) { builder.Append(","); builder2.Append(","); } flag = true; builder.Append(row.PrimaryKeyValue); builder2.Append(row.Name); } switch (scopetype) { case DimentionScopeType.Dimension: this.View.Model.SetValue("FFilterKey", builder.ToString(), e.Row); this.View.Model.SetValue("FFilterName", builder2.ToString(), e.Row); this.View.Model.SetValue("FFilterKeyDesc", builder2.ToString(), e.Row); return; case DimentionScopeType.BillDimension: this.View.Model.SetValue("FBillFilterKey", builder.ToString(), e.Row); this.View.Model.SetValue("FBillFilterName", builder2.ToString(), e.Row); this.View.Model.SetValue("FBillFilterKeyDesc", builder2.ToString(), e.Row); return; } } } }
public override void BeforeF7Select(BeforeF7SelectEventArgs e) { base.BeforeF7Select(e); if (e.FieldKey.ToUpper().Equals("FSALEDEPTID")) { DynamicObject saleCompany = this.Model.GetValue("FSaleCompanyId") as DynamicObject; if (saleCompany == null) { return; } string companyNumber = Convert.ToString(saleCompany["Number"]).Substring(0, 5); string filter = string.Format(" FNUMBER like '{0}%' AND FDEPTTYPE = '2' ", companyNumber); if (string.IsNullOrEmpty(e.ListFilterParameter.Filter)) { e.ListFilterParameter.Filter = filter; } else { filter = " And " + filter; e.ListFilterParameter.Filter += filter; } } }
public override void BeforeF7Select(BeforeF7SelectEventArgs e) { base.BeforeF7Select(e); presenter.ShowBillExtension(e.FieldKey, this.View.PageId, e.Row);//View里面调用Presenter }
public override void BeforeF7Select(BeforeF7SelectEventArgs e) { base.BeforeF7Select(e); }