本文整理汇总了C#中Part.Update方法的典型用法代码示例。如果您正苦于以下问题:C# Part.Update方法的具体用法?C# Part.Update怎么用?C# Part.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Part
的用法示例。
在下文中一共展示了Part.Update方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NewPartCollection
public bool NewPartCollection(NewPartModel model, Session epiSession, out bool IsSucces, out string msgError)
{
try
{
Part myPart = new Part(epiSession.ConnectionPool);
PartDataSet dsPart = new PartDataSet();
myPart.GetNewPart(dsPart);
DataRow drPart = dsPart.Tables[0].Rows[0];
drPart.BeginEdit();
drPart["PartNum"] = model.SerialNo;
drPart["PartDescription"] = model.SerialNo; ;
drPart["UOMClassID"] = "COUNT";
drPart["IUM"] = "KG";
drPart["PUM"] = "KG";
drPart["TypeCode"] = "M";
drPart["SalesUM"] = "KG";
drPart["UserChar4"] = string.IsNullOrEmpty(model.SupplierCode) ? "" : model.SupplierCode;
drPart["UnitPrice"] = model.Amount;
drPart["Character01"] = string.IsNullOrEmpty(model.SaleContract) ? "" : model.SaleContract;
drPart["Character03"] = string.IsNullOrEmpty(model.NGRemark) ? "-" : model.NGRemark;
drPart["Character07"] = model.ArticleNo;
drPart["Character07"] = model.CustID;
drPart["Number10"] = model.Quantity;
drPart["Date01"] = DateTime.Now;
drPart["ShortChar01"] = string.IsNullOrEmpty(model.CommodityCode) ? "" : model.CommodityCode;
drPart["ShortChar02"] = string.IsNullOrEmpty(model.SpecCode) ? "" : model.SpecCode;
drPart["ShortChar04"] = string.IsNullOrEmpty(model.BussinessType) ? "" : model.BussinessType;
drPart["ShortChar05"] = string.IsNullOrEmpty(model.MakerCode) ? "" : model.MakerCode;
drPart["ShortChar06"] = string.IsNullOrEmpty(model.MillCode) ? "" : model.MillCode;
drPart["Character07"] = string.IsNullOrEmpty(model.ArticleNo) ? "" : model.ArticleNo;
drPart["Number18"] = model.iRunning;
drPart["ShortChar09"] = string.IsNullOrEmpty(model.CoatingCode) ? "" : model.CoatingCode;
drPart["Number01"] = model.Thick;
drPart["Number02"] = model.Width;
drPart["Number03"] = model.Length;
drPart["Number11"] = 1;
drPart["Number12"] = 1;
if (model.NGStatus == 1)
{
drPart["Character10"] = "N";
}
else
{
drPart["Character10"] = "B";
}
drPart["NetWeight"] = model.Weight;
drPart.EndEdit();
myPart.Update(dsPart);
IsSucces = true;
msgError = "";
}
catch (Exception ex)
{
IsSucces = false;
msgError = ex.Message;
}
return IsSucces;
}
示例2: NewPart
public string NewPart(NewPartModel model, SessionInfo epiSession, int StoreInNo, out bool IsSucces, out string msgError)
{
int iRunning = RunningPart();
string PartNum = GetSerialByFormat(iRunning);
try
{
Session currSession = new Session(epiSession.UserID, epiSession.UserPassword, epiSession.AppServer, Session.LicenseType.Default);
Part myPart = new Part(currSession.ConnectionPool);
PartDataSet dsPart = new PartDataSet();
myPart.GetNewPart(dsPart);
DataRow drPart = dsPart.Tables[0].Rows[0];
drPart.BeginEdit();
drPart["PartNum"] = PartNum;
drPart["PartDescription"] = PartNum;
drPart["UOMClassID"] = "COUNT";
drPart["IUM"] = "KG";
drPart["PUM"] = "KG";
drPart["TypeCode"] = "M";
drPart["SalesUM"] = "KG";
drPart["UserChar4"] = model.SupplierCode;
drPart["UnitPrice"] = model.Amount;
drPart["Character01"] = model.SaleContract;
drPart["Character03"] = model.NGRemark;
drPart["Character07"] = model.ArticleNo;
drPart["Character07"] = model.CustID;
drPart["Number10"] = model.Quantity;
drPart["Date01"] = DateTime.Now;
drPart["ShortChar01"] = string.IsNullOrEmpty(model.CommodityCode) ? "" : model.CommodityCode;
drPart["ShortChar02"] = string.IsNullOrEmpty(model.SpecCode) ? "" : model.SpecCode;
drPart["ShortChar04"] = model.BussinessType;
drPart["ShortChar05"] = model.MakerCode;
drPart["ShortChar06"] = model.MillCode;
drPart["Character07"] = model.ArticleNo;
drPart["ShortChar08"] = iRunning;
drPart["ShortChar09"] = model.CoatingCode;
drPart["Number01"] = model.Thick;
drPart["Number02"] = model.Width;
drPart["Number03"] = model.Length;
drPart["Number11"] = 1;
drPart["Number12"] = 1;
if (model.NGStatus == 1)
{
drPart["Character10"] = "N";
}
else
{
drPart["Character10"] = "B";
}
drPart["NetWeight"] = model.Weight;
drPart.EndEdit();
myPart.Update(dsPart);
currSession.Dispose();
UpdateStock(PartNum, model.Quantity);
IsSucces = true;
msgError = "";
}
catch (Exception ex)
{
IsSucces = false;
msgError = ex.Message;
}
return PartNum;
}
示例3: savebtn_Click
private void savebtn_Click(object sender, EventArgs e)
{
if (trackserial.Checked && (SerialPrefix == "" || SerialPrefix == null))
MessageBox.Show("Cannot use null serial prefix. Set the prefix or uncheck 'Track Serial Number'", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
else
{
try
{
//Commit Part Changes
Part Part = new Part(DataList.EpicConn);
PartDataSet Pdata = new PartDataSet();
//Pdata = (PartDataSet)DL.PartSearchDataSet("");
string serialWarning;
string questionString;
bool multipleMatch;
string PartNumber = Partnumber_txt.Text;
DataViewRowState DRState;
if (!DataList.PartExists(PartNumber))
{
Part.GetPartXRefInfo(ref PartNumber, "", "", out serialWarning, out questionString, out multipleMatch);
Part.GetNewPart(Pdata);
Part.ChangePartNum(PartNumber, Pdata);
DRState = DataViewRowState.Added;
}
else
{
Pdata = Part.GetByID(PartNumber);
DRState = DataViewRowState.Unchanged;
#region Clear Bflush/SN Settings
try
{
DataList.UpdateDatum(Pdata, "Part", 0, "TrackSerialNum", false.ToString());
DataList.UpdateDatum(Pdata, "Part", 0, "UseMaskSeq", false.ToString());
DataList.UpdateDatum(Pdata, "PartPlant", 0, "PartTrackSerialNum", false.ToString());
DataList.UpdateDatum(Pdata, "PartPlant", 0, "BackFlush", false.ToString());
Part.Update(Pdata);
Pdata = Part.GetByID(PartNumber);
}
catch (Exception ex) { System.Diagnostics.Debug.Print(ex.Message); }
#endregion
}
Pdata = UpdateDataSet(Pdata, DRState);
//Add data to allow BO to create plant tables
try
{
Part.Update(Pdata);
if (bflush_chk.Checked)
{
//try to eliminate backflush if necessary
DataList.UpdateDatum(Pdata, "PartPlant", 0, "BackFlush", bflush_chk.Checked.ToString());
}
Part.Update(Pdata);
}
catch (Exception ex) { System.Diagnostics.Debug.Print(ex.Message); }
if (trackserial.Checked)
{
Pdata = Part.GetByID(PartNumber);
try
{
Part.ChangePartTrackSerialNum(trackserial.Checked, Pdata);
}
catch
{
//If the neat process fails, do it the hard way.
DataList.UpdateDatum(Pdata, "Part", 0, "TrackSerialNum", true.ToString());
DataList.UpdateDatum(Pdata, "Part", 0, "UseMaskSeq", true.ToString());
DataList.UpdateDatum(Pdata, "Part", 0, "SNLastUsedSeq", "");
Part.Update(Pdata);
Pdata = Part.GetByID(PartNumber);
//.........这里部分代码省略.........
示例4: useselected_btn_Click
private void useselected_btn_Click(object sender, EventArgs e)
{
if (template_cbo.Text == "Other")
{
try
{
//Use text box part number
Part Part = new Part(DataList.EpicConn);
PartDataSet PData = new PartDataSet();
PData = Part.DuplicatePart(partnumber_txt.Text, _PartNumber, desc_txt.Text);
Part.Update(PData);
this.DialogResult = DialogResult.Ignore;
}
catch { }
}
else
{
//Use Listed Template
DataRow dr = eNGDataDataSet.Tables[0].Rows[template_cbo.SelectedIndex];
_Pdata.Description = dr["Desc"].ToString();
_Pdata.PMT = dr["Type"].ToString();
_Pdata.UOM_Class = dr["UOMClass"].ToString();
decimal fail = 0;
decimal.TryParse(dr["NetWeight"].ToString(), out fail);
_Pdata.Net_Weight = fail;
_Pdata.Net_Weight_UM = dr["UOMWeight"].ToString();
decimal.TryParse(dr["NetVol"].ToString(),out fail);
_Pdata.Net_Vol = fail;
_Pdata.Net_Vol_UM = dr["UOMVol"].ToString();
_Pdata.Primary_UOM = dr["UOM"].ToString();
_Pdata.PartGroup = dr["Group"].ToString();
_Pdata.PartClass = dr["Class"].ToString();
_Pdata.PartPlant = dr["Plant"].ToString();
_Pdata.PlantWhse = dr["Whse"].ToString();
}
this.Close();
}
示例5: NewPart
public bool NewPart(SessionInfo _session, ProductsMasterModel model, out bool IsSucces, out string msgError)
{
//int iRunning = RunningPart();
//string PartNum = GetSerialByFormat(iRunning);
try
{
///TODO: Fix Epicor AppServer to workaround.
Session currSession = new Session(_session.UserID, _session.UserPassword, _session.AppServer, Session.LicenseType.Default);
Part myPart = new Part(currSession.ConnectionPool);
PartDataSet dsPart = new PartDataSet();
myPart.GetNewPart(dsPart);
DataRow drPart = dsPart.Tables[0].Rows[0];
drPart.BeginEdit();
drPart["PartNum"] = model.NorNum;
drPart["PartDescription"] = model.NorNum;
drPart["UOMClassID"] = "UCC";
drPart["IUM"] = (model.SizeLength > 0) ? "PCS" : "KG"; //Our UOM
drPart["PUM"] = (model.SizeLength > 0) ? "PCS" : "KG"; ; //Purchasing UOM
drPart["TypeCode"] = "M";
drPart["SalesUM"] = (model.SizeLength > 0) ? "PCS" : "KG"; ; //Sale UOM
drPart["ShortChar05"] = "M";
drPart["Number01"] = model.SizeThick;
drPart["Number02"] = model.SizeWidth;
drPart["Number03"] = model.SizeLength;
drPart["Number11"] = 1;
drPart["Number12"] = 1;
drPart["Character10"] = "N";
drPart["NetWeight"] = model.CoilWeigthMin;
drPart.EndEdit();
myPart.Update(dsPart);
currSession.Dispose();
IsSucces = true;
msgError = "";
}
catch (Exception ex)
{
IsSucces = false;
msgError = ex.Message;
return false;
}
return true;
}
示例6: GetNewPart
public bool GetNewPart(MCSS model, Models.SessionInfo epiSession, out bool IsSucces, out string msgError)
{
try
{
Session currSession = new Session(epiSession.UserID, epiSession.UserPassword, epiSession.AppServer, Session.LicenseType.Default);
Part myPart = new Part(currSession.ConnectionPool);
bool partExst = false;
string whereClausePart = string.Format(@"Part.PartNum='{0}'", model.McssNum);
//whereClausePart.Replace("=\"","");
PartDataSet dsPart = new PartDataSet();
if (myPart.PartExists(model.McssNum))
{
dsPart = myPart.GetRows(whereClausePart, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 0, 1, out partExst);
}
else
{
myPart.GetNewPart(dsPart);
}
DataRow drPart = dsPart.Tables[0].Rows[0];
drPart.BeginEdit();
drPart["PartNum"] = model.McssNum;
drPart["PartDescription"] = model.McssNum;
drPart["UOMClassID"] = "UCC";
drPart["TypeCode"] = "P";
drPart["IUM"] = (model.Length > 0) ? "PCS" : "KG"; //Our UOM
drPart["PUM"] = (model.Length > 0) ? "PCS" : "KG"; ; //Purchasing UOM
drPart["TypeCode"] = "M";
drPart["SalesUM"] = (model.Length > 0) ? "PCS" : "KG"; ; //Sale UOM
drPart["Character02"] = ""; //NCR No.
drPart["Character08"] = string.IsNullOrEmpty(model.CustID) ? "" : model.CustID;
drPart["Character10"] = ""; //Pack No.
drPart["ShortChar01"] = string.IsNullOrEmpty(model.CommodityCode) ? "" : model.CommodityCode;
drPart["ShortChar02"] = string.IsNullOrEmpty(model.MatSpec1) ? "" : model.MatSpec1;
drPart["ShortChar07"] = ""; //Old Stock No.
drPart["ShortChar09"] = string.IsNullOrEmpty(model.Coating1) ? "" : model.Coating1;
drPart["ShortChar10"] = "6"; //PartStatus = MCSS
drPart["Number01"] = model.Thick;
drPart["Number02"] = model.Width;
drPart["Number03"] = model.Length;
drPart["TrackLots"] = 1;
drPart["Number11"] = 1;
drPart["Number12"] = model.Pocession.GetInt();
drPart["Character10"] = "N";
drPart["NetWeight"] = model.WeightPerCoilMin.GetDecimal();
drPart.EndEdit();
myPart.Update(dsPart);
currSession.Dispose();
IsSucces = true;
msgError = "";
}
catch (Exception ex)
{
IsSucces = false;
msgError = ex.Message;
}
return IsSucces;
}
示例7: CreatePartRevision
public static bool CreatePartRevision(string PartNumber, string CurrentRev, string NewRev, string RevDesc)
{
bool _results;
try
{
Part Part = new Part(DataList.EpicConn);
PartDataSet PartData = new PartDataSet();
PartData = Part.GetByID(PartNumber);
Part.GetNewPartRev(PartData, PartNumber, CurrentRev);
int Y = PartData.Tables["PartRev"].Rows.Count - 1;
DataList.UpdateDatum(PartData, "PartRev", Y, "RevShortDesc", RevDesc);
DataList.UpdateDatum(PartData, "PartRev", Y, "RevisionNum", NewRev);
DataList.UpdateDatum(PartData, "PartRev", Y, "AltMethod", "");
Part.Update(PartData);
_results = true;
}
catch { _results = false; }
finally
{
EpicClose();
}
return _results;
}
示例8: savebtn_Click
private void savebtn_Click(object sender, EventArgs e)
{
try
{
//Commit Part Changes
Part Part = new Part(DataList.EpicConn);
PartDataSet Pdata = new PartDataSet();
//Pdata = (PartDataSet)DL.PartSearchDataSet("");
string serialWarning;
string questionString;
bool multipleMatch;
string PartNumber = Partnumber_txt.Text;
Part.GetPartXRefInfo(ref PartNumber, "", "", out serialWarning, out questionString, out multipleMatch);
if (!multipleMatch)
{
Part.GetNewPart(Pdata);
Part.ChangePartNum(PartNumber, Pdata);
DataList.AddDatum(Pdata, "Part", 0, "PartDescription", Description_txt.Text);
//SearchWord has 8 character limit
if (Description_txt.Text.Length > 8)
DataList.AddDatum(Pdata, "Part", 0, "SearchWord", Description_txt.Text.Substring(0, 8));
else
DataList.AddDatum(Pdata, "Part", 0, "SearchWord", Description_txt.Text);
DataList.AddDatum(Pdata, "Part", 0, "NetWeight", NetWeight.Text);
DataList.AddDatum(Pdata, "Part", 0, "NetWeightUOM", uomweight_cbo.SelectedValue.ToString());
//DataList.AddDatum(Pdata, "Part", 0, "NetVolume", NetVolume.Text);
//DataList.AddDatum(Pdata, "Part", 0, "NetVolumeUOM", uomvol_cbo.SelectedValue.ToString());
DataList.AddDatum(Pdata, "Part", 0, "IUM", uom_cbo.SelectedValue.ToString());
DataList.AddDatum(Pdata, "Part", 0, "ClassID", class_cbo.SelectedValue.ToString());
string Type_Code = type_cbo.SelectedItem.ToString();
Part.ChangePartTypeCode(Type_Code, Pdata);
Part.ChangePartProdCode(group_cbo.SelectedValue.ToString(), Pdata);
//Add data to allow BO to create plant tables
Part.Update(Pdata);
//retrieve the new copy of the data
Pdata = Part.GetByID(PartNumber);
DataList.UpdateDatum(Pdata, "PartPlant", 0, "PrimWhse", whse_cbo.SelectedValue.ToString());
DataList.UpdateDatum(Pdata, "PartPlant", 0, "PrimWhseDescription", whse_cbo.Text);
DataList.UpdateDatum(Pdata, "PartPlant", 0, "DBRowIdent", null);
//Update with warehouse information
Part.Update(Pdata);
DataList.EpicClose();
}
else
{
MessageBox.Show("Part already exists in database! Use revision to make changes.");
}
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
finally
{
this.Close();
}
}
示例9: Main
public static void Main(string[] args)
{
Application CATIA = (Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Catia.Application");
oPartDocument = (PartDocument)CATIA.Documents.Add ( "Part" );
oPart = oPartDocument.Part;
oPartBody = oPart.MainBody;
oPlaneYZ = oPart.CreateReferenceFromGeometry( oPart.OriginElements.PlaneYZ );
//CATIA.ActiveWindow.ActiveViewer.RenderingMode = 1;
//msgbox "Create Five Bearings"
CreatePatternBearing();
oPart.Update();
CATIA.ActiveWindow.ActiveViewer.Reframe();
//msgbox "Create First Cam Set"
CreateCamSet (0);
oPart.Update();
CATIA.ActiveWindow.ActiveViewer.Reframe();
//msgbox "Create Second Cam Set"
CreateCamSet (90);
oPart.Update();
CATIA.ActiveWindow.ActiveViewer.Reframe();
//msgbox "Create Third Cam Set"
CreateCamSet (180);
oPart.Update();
CATIA.ActiveWindow.ActiveViewer.Reframe();
//msgbox "Create Fourth Cam Set"
CreateCamSet (270);
oPart.Update();
CATIA.ActiveWindow.ActiveViewer.Reframe();
//msgbox "Create Driving Wheel"
CreateCylinder (iPinLength/2, iBearingDiam );
oPart.Update();
CATIA.ActiveWindow.ActiveViewer.Reframe();
//msgbox "This is the macro end"
}