Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Work Orders w/Mincom Connector

Status
Not open for further replies.

manwater

Programmer
Apr 14, 2009
1
We currently are running Ellipse 6.1 in a Windows environment. I'm looking for some sample code that demos how to create work order using the Mincom Connector. I'm using C# .Net Visual Studio 2003.

Thanks
 
We have Ellipse 5.2.3.7 wk3 and I am using Visual Studio 2005 (C# Language). This is how I am creating a work order using the Mincom Connector.

public bool createDriveUpWO(string WoDesc,
string OriginatorID,
string WoType,
string MaintType,
string componentCode,
string EquipNo,
string VehicleNo,
string WorkGroup,
string JobCodeX4,
string JobCodeX6,
string planStartDate)
{
MIMSX.MIMSBlock createBlock;
MIMSX.MIMSReply createReply;
MIMSX.MIMSRequest createRequest;
MIMSX.MIMSInstance createInstance;

try
{
#region Variables

#region Account Code
string accountCode = "9010" + VehicleNo.Substring(0,1) + "016100000";
#endregion

#endregion

createBlock = mimsServer.Blocks.New("createWoBlock");
createRequest = createBlock.Requests.New("createWoRequest");

createRequest.AddFieldNameValue(MIMSX.MIMSX_REQUEST_FLAGS.MIMSX_FLAG_SERVICE, "WORKORDER.Create");

createInstance = createRequest.Instances.New("createWoInstance");

createInstance.AddFieldNameValue("DstrctCode", "DIS1");
createInstance.AddFieldNameValue("WoDesc", WoDesc);
createInstance.AddFieldNameValue("OriginatorId", OriginatorID);
createInstance.AddFieldNameValue("WoType", "FL");
createInstance.AddFieldNameValue("MaintType", MaintType);
createInstance.AddFieldNameValue("WorkGroup", WorkGroup);
createInstance.AddFieldNameValue("EquipNo", EquipNo);
createInstance.AddFieldNameValue("WoPrefix", "FL");
createInstance.AddFieldNameValue("JobCode4", JobCodeX4);
createInstance.AddFieldNameValue("JobCode6", JobCodeX6);
createInstance.AddFieldNameValue("AccountCode", accountCode);
createInstance.AddFieldNameValue("PlanStrDate", planStartDate);
createInstance.AddFieldNameValue("ReqByDate", planStartDate);
if (!string.IsNullOrEmpty(componentCode))
{
createInstance.AddFieldNameValue("CompCode", componentCode);
}

#region currentVehicleMileage
if (!string.IsNullOrEmpty(globalVariables.currentVehicleMileage))
{
if (globalVariables.useMileage)
{
createInstance.AddFieldNameValue("OrigDocType", "VM");
createInstance.AddFieldNameValue("OrigDocNo", globalVariables.currentVehicleMileage);
}
}
#endregion

createReply = createBlock.Send(true);
globalVariables.returnedWorkOrder = Convert.ToString(createReply.Requests.Item(1).Instances.Item(1).Fields.Item("WorkOrder").Value);

mimsServer.Blocks.Remove(createBlock);

return true;
}
catch
{
MIMSX.MIMSError error;
error = mimsServer.Errors.Item(new Decimal(1));
globalVariables.gvWOError = error.ErrorMessage;

return false;
}
}

Then to create the work order, I have the following:

if (wo.createDriveUpWO(woDesc, globalVariables.loginUserEmpNo, woType, "35", compCode, equipNo, vehicleNo, workGroup, maintType, workDescriptor, planStartDate))
{
error = null;
globalVariables.gvWOError = "";
proceed = true;
}
else
{
error = "Error Creating Work Order for Equipment #" + equipNo;
MessageBox.Show(error, "Work Order Creation Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
proceed = false;
}

I hope this helped you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top