本文整理汇总了C#中DataManager.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# DataManager.ToString方法的具体用法?C# DataManager.ToString怎么用?C# DataManager.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataManager
的用法示例。
在下文中一共展示了DataManager.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoSave
public string DoSave()
{
string retval;
SqlTransaction tran = null;
var isnew = false;
try
{
var cn = new SqlConnection {ConnectionString = _constr};
cn.Open();
tran = cn.BeginTransaction(IsolationLevel.ReadUncommitted);
var dt = new DsMaster().ITEMMAST;
var ta = new DsMasterTableAdapters.ITEMMASTTableAdapter();
ta.Connection.ConnectionString = _constr;
ta.Fill(dt);
ta.AssignConnection(cn, tran);
var dr = dt.FindByITEMNO(Itemno);
if (dr != null)
{
dr.BeginEdit();
dr.editedby = Utils.Userid;
dr.editeddate = DateTime.Now.Date;
}
else
{
dr = (DsMaster.ITEMMASTRow) dt.NewRow();
isnew = true;
var autoid = new DataManager().GetAutoId(12);
autoid++;
Utils.Itemno = Utils.Company + autoid.ToString("D5");
dr.ITEMNO = Utils.Itemno;
dr.CREATEDBY = Utils.Userid;
dr.CDATE = DateTime.Now.Date;
if (ItemmastRow.OWNBARCODE && string.IsNullOrEmpty(ItemmastRow.BARCODE))
dr.BARCODE = Utils.Itemno;
else
{
dr.BARCODE = ItemmastRow.BARCODE;
}
}
dr.ITEMTYPE = ItemmastRow.ITEMTYPE;
dr.OWNBARCODE = ItemmastRow.OWNBARCODE;
dr.ITEMNAME = ItemmastRow.ITEMNAME;
dr.ARITEMNAME = ItemmastRow.ARITEMNAME;
dr.BASEUOM = ItemmastRow.BASEUOM;
dr.SUPPLIERNO = ItemmastRow.SUPPLIERNO;
dr.MANFNAME = ItemmastRow.MANFNAME;
dr.REORDER = ItemmastRow.REORDER;
dr.UOM = ItemmastRow.UOM;
dr.PRINTBARCODE = ItemmastRow.PRINTBARCODE;
dr.EXPDATEREQ = ItemmastRow.EXPDATEREQ;
dr.ACTIVE = ItemmastRow.ACTIVE;
dr.CATEGORY = ItemmastRow.CATEGORY;
dr.GROUPID = ItemmastRow.GROUPID;
dr.GENERICID = ItemmastRow.GENERICID;
dr.MARGIN = ItemmastRow.MARGIN;
dr.MARKUP = ItemmastRow.MARKUP;
dr.DISCOUNT = ItemmastRow.DISCOUNT;
dr.FASTMOVING = ItemmastRow.FASTMOVING;
dr.LOCATION = ItemmastRow.LOCATION;
dr.TEMPRATURE = ItemmastRow.TEMPRATURE;
dr.MINQTY = ItemmastRow.MINQTY;
dr.MAXQTY = ItemmastRow.MAXQTY;
dr.COMPANY = Utils.Company;
dr.SEL = false;
dr.DISCONSALE = ItemmastRow.DISCONSALE;
dr.CPRICE = ItemmastRow.CPRICE;
dr.SPRICE = ItemmastRow.SPRICE;
dr.ITEMDEM = ItemmastRow.ITEMDEM;
dr.COLOR=ItemmastRow.COLOR;
dr.WEIGHT=ItemmastRow.WEIGHT;
dr.POMINQTY =ItemmastRow.POMINQTY;
dr.POMAXQTY =ItemmastRow.POMAXQTY;
dr.DISCONSALE = ItemmastRow.DISCONSALE;
dr.SALEDISCOUNTPER = ItemmastRow.SALEDISCOUNTPER;
if (isnew)
{
dt.Rows.Add(dr);
ta.Update(dt);
}
else
{
dr.EndEdit();
ta.Update(dt);
}
new DataManager().UpdateAutoNum(12);
tran.Commit();
retval = "1";
}
catch (Exception ex)
{
retval = ex.ToString();
if (tran != null) tran.Rollback();
}
return retval;
}