// If we keep the library as a global variable, we can // cache data like property descriptions and column headings public void BindToLib(IObjectStore oNewLib, Collection pColHeadings, string sClass) { string[] sClasses = new string[2]; sClasses[0] = sClass; oQueryLib = oNewLib; //oPropDescs = (IDMObjects.PropertyDescriptions)oQueryLib.FilterPropertyDescriptions(IDMObjects.idmObjectType.idmObjTypeDocument, sClasses); IClassDescription objClassDesc = ClassDescription.FetchInstance(oNewLib, sClass, null); //(IDMObjects.idmObjectType.idmObjTypeDocument, sClasses); oPropDescs = objClassDesc.PropertyDescriptions; int oTmp = 0; //for (int oTmp = 0 To oPropDescs.Count ) //foreach (object oTmp in pColHeadings.Count) { // Weed out any bogus labels the caller passed us //FSQ20070509. Changed by try..catch //On Error Resume Next; try { //Microsoft.VisualBasic.Collection.KeyValuePair otemp2 =((Microsoft.VisualBasic.Collection.KeyValuePair)oTmp); if (oPropDescs[oTmp] != null) { cColHeadings.Add(oTmp, null, null, null); } } catch { try { cColHeadings.Add(oTmp, null, null, null); } catch { } } } }
// If we keep the library as a global variable, we can // cache data like property descriptions and column headings public void BindToLib(IObjectStore objObjectStore, Collection pColHeadings, string sClass) { string[] sClasses = new string[2]; IClassDescription objClassDesc = ClassDescription.FetchInstance(objObjectStore, sClass, null); oPropDescs = objClassDesc.PropertyDescriptions; foreach (string oTmp in pColHeadings) { // Weed out any bogus labels the caller passed us try { if (oPropDescs.Contains(oTmp)) { cColHeadings.Add(oTmp, null, null, null); } } catch (Exception e) { throw new Exception("On Error Resume Next not handled propertly: " + e.Message); } } }
public void UpdateQuery(IObjectStore objObjectStore, string sClass, DataGridView IDMLView) //AxIDMListView.AxIDMListView { string[] sClasses = new string[2]; //IDMObjects.PropertyDescription PropDesc = null; sClasses[0] = sClass; bool Salvar = false; //string DirWinTemp = "C:\\APPS\\CreditoEmpresarial\\"; string DirWinTemp = @Globals.DirLog; //oQueryLib = oNewLib; //oPropDescs = (IDMObjects.PropertyDescriptions)oQueryLib.FilterPropertyDescriptions(IDMObjects.idmObjectType.idmObjTypeDocument, sClasses); IClassDescription objClassDesc = ClassDescription.FetchInstance(objObjectStore, sClass, null); oPropDescs = objClassDesc.PropertyDescriptions; if (IDMLView.RowCount == 0) { //@Globals.fncParmIniSet("UOCFileNet", "Execute", "5", DirWinTemp + "UOCFileNet.ini"); //@Globals.fncParmIniSet("Error", "ErrNumber", "5", DirWinTemp + "UOCFileNet.ini"); //@Globals.fncParmIniSet("Error", "DescError", "Error No hay Imágenes con esos parámetros", DirWinTemp + "UOCFileNet.ini"); //@Globals.fncParmIniSet("Cadena", "Cadena", Interaction.Command().Trim(), DirWinTemp + "UOCFileNet.ini"); MessageBox.Show("Error No hay Imágenes con esos parámetros"); return; } for (int i = 1; i <= IDMLView.RowCount; i++) { // IDMLView.SelectItem(i); //TODO validate with Filenet @Globals.oDocument = (IDocument)objObjectStore.FetchObject("Document", (String)IDMLView.Rows[i].Cells[0].Value, null); switch (@Globals.VarCom) { case 1: String pName = "F_PAGES"; IPropertyDescription propertyDescription = getPropertyDescriptionByName(oPropDescs, pName); if (propertyDescription.IsReadOnly == false) { @Globals.oDocument.Properties.FindProperty(pName).SetObjectValue(@Globals.Pag); Salvar = true; } break; case 2: pName = "NumCliente"; if (FrmFileNET.DefInstance.TxtCriterio[0].Text.Length > 0) { @Globals.oDocument.Properties.FindProperty(pName).SetObjectValue(FrmFileNET.DefInstance.TxtCriterio[0].Text); Salvar = true; } pName = "Contrato"; if (FrmFileNET.DefInstance.TxtCriterio[2].Text.Length > 0) { @Globals.oDocument.Properties.FindProperty(pName).SetObjectValue(FrmFileNET.DefInstance.TxtCriterio[2].Text); Salvar = true; } pName = "Linea"; if (FrmFileNET.DefInstance.TxtCriterio[3].Text.Length > 0) { @Globals.oDocument.Properties.FindProperty(pName).SetObjectValue(FrmFileNET.DefInstance.TxtCriterio[3].Text); Salvar = true; } pName = "FolioS403"; propertyDescription = getPropertyDescriptionByName(oPropDescs, pName); if (propertyDescription.IsReadOnly == false) { @Globals.oDocument.Properties.FindProperty(pName).SetObjectValue(@Globals.XFolioS403); Salvar = true; } pName = "CalificaOnDemand"; propertyDescription = getPropertyDescriptionByName(oPropDescs, pName); if (propertyDescription.IsReadOnly == false) { @Globals.oDocument.Properties.FindProperty(pName).SetObjectValue(0); @Globals.oDocument.Properties.FindProperty("Status").SetObjectValue(1); Salvar = true; } //Set CmdEjec = New ADODB.Command //Set CmdEjec.ActiveConnection = oMiBD //sQuery1 = "UPDATE FnDocument SET Cliente = '1' WHERE Folio='" & FrmFileNET.TxtCriterio(1) & "'" //CmdEjec.CommandText = sQuery1 //CmdEjec.Execute , , adCmdText //oMiBD.Execute sQuery1, , adCmdText //CmdEjec.Execute //oRS!contrato = "1" //oRS.Update //Tampoco sirve con la siguiente sintaxis //oRS.Update oRS!contrato, 1 break; case 3: case 6: pName = "CalificaOnDemand"; propertyDescription = getPropertyDescriptionByName(oPropDescs, pName); if (propertyDescription.IsReadOnly == false && @Globals.XCalifOnd.Length > 0) { @Globals.oDocument.Properties.FindProperty(pName).SetObjectValue(@Globals.XCalifOnd); @Globals.oDocument.Properties.FindProperty("Status").SetObjectValue((@Globals.XCalifOnd)); Salvar = true; } pName = "FechaOperacion"; propertyDescription = getPropertyDescriptionByName(oPropDescs, pName); if (propertyDescription.IsReadOnly == false && @Globals.XFechaOp.Length > 0) { @Globals.oDocument.Properties.FindProperty(pName).SetObjectValue(@Globals.XFechaOp); Salvar = true; } pName = "Instrumento"; propertyDescription = getPropertyDescriptionByName(oPropDescs, pName); if (propertyDescription.IsReadOnly == false && @Globals.XInst.Length > 0) { @Globals.oDocument.Properties.FindProperty(pName).SetObjectValue(@Globals.XInst); Salvar = true; } pName = "Producto"; propertyDescription = getPropertyDescriptionByName(oPropDescs, pName); if (propertyDescription.IsReadOnly == false && @Globals.XProd.Length > 0) { @Globals.oDocument.Properties.FindProperty(pName).SetObjectValue(@Globals.XProd); Salvar = true; } pName = "FolioS403"; propertyDescription = getPropertyDescriptionByName(oPropDescs, pName); if (propertyDescription.IsReadOnly == false && @Globals.XFolioS403.Length > 0) { @Globals.oDocument.Properties.FindProperty(pName).SetObjectValue(@Globals.XFolioS403); Salvar = true; } pName = "NumCliente"; propertyDescription = getPropertyDescriptionByName(oPropDescs, pName); if (propertyDescription.IsReadOnly == false && FrmFileNET.DefInstance.TxtCriterio[0].Text.Length > 0) { @Globals.oDocument.Properties.FindProperty(pName).SetObjectValue(FrmFileNET.DefInstance.TxtCriterio[0].Text); Salvar = true; } pName = "Contrato"; propertyDescription = getPropertyDescriptionByName(oPropDescs, pName); if (propertyDescription.IsReadOnly == false && FrmFileNET.DefInstance.TxtCriterio[2].Text.Length > 0) { @Globals.oDocument.Properties.FindProperty(pName).SetObjectValue(FrmFileNET.DefInstance.TxtCriterio[2].Text); Salvar = true; } pName = "Linea"; propertyDescription = getPropertyDescriptionByName(oPropDescs, pName); if (propertyDescription.IsReadOnly == false && FrmFileNET.DefInstance.TxtCriterio[3].Text.Length > 0) { @Globals.oDocument.Properties.FindProperty(pName).SetObjectValue(FrmFileNET.DefInstance.TxtCriterio[3].Text); Salvar = true; } if (Double.Parse(@Globals.TipoDoc) != 999) { pName = "TipoDoc"; propertyDescription = getPropertyDescriptionByName(oPropDescs, pName); if (propertyDescription.IsReadOnly == false && Conversion.Val(@Globals.TipoDoc) > 0) { @Globals.oDocument.Properties.FindProperty(pName).SetObjectValue(@Globals.TipoDoc); Salvar = true; } } pName = "XfolioS"; propertyDescription = getPropertyDescriptionByName(oPropDescs, pName); if (propertyDescription.IsReadOnly == false && @Globals.XFile.Length > 0) { @Globals.oDocument.Properties.FindProperty(pName).SetObjectValue(Conversion.Str(@Globals.XFile)); Salvar = true; } if (Salvar) { //TODO set security //@Globals.oDocument.Permissions[1].GranteeName = "SicUsrG:CredEmp:Banamex"; //Read //@Globals.oDocument.Permissions[2].GranteeName = "OperatorG:CredEmp:Banamex"; //Write //@Globals.oDocument.Permissions[3].GranteeName = "OperatorG:CredEmp:Banamex"; //AccessAX } break; } if (Salvar) { @Globals.oDocument.Save(RefreshMode.REFRESH); if (@Globals.VarCom == 3 || @Globals.VarCom == 6) { @Globals.fncParmIniSet("UOCFileNet", "Execute", "1", DirWinTemp + "UOCFileNet.ini"); } } } if (Salvar) { @Globals.oDocument.Refresh(); //oRS.Requery(-1); } }