本文整理汇总了C#中Part.PartExists方法的典型用法代码示例。如果您正苦于以下问题:C# Part.PartExists方法的具体用法?C# Part.PartExists怎么用?C# Part.PartExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Part
的用法示例。
在下文中一共展示了Part.PartExists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Savebtn_Click
private void Savebtn_Click(object sender, EventArgs e)
{
//save settings to resource file then test settings to connect
Properties.Settings.Default.uname = Uname.Text;
Properties.Settings.Default.passw = Passw.Text;
Properties.Settings.Default.Save();
string server = Properties.Settings.Default .svrname + ":" + Properties.Settings.Default.svrport;
try
{
DataList.EpicConn = new BLConnectionPool(Uname.Text, Passw.Text, "AppServerDC://" + server);
Part EpicPart = new Part(DataList.EpicConn);
bool ValidLogin = EpicPart.PartExists(null);
Properties.Settings.Default.validated = true;
Properties.Settings.Default.Save();
DataList.EpicClose();
this.Close();
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message,"Try Again");
}
}
示例2: 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;
}