当前位置: 首页>>代码示例>>C#>>正文


C# DataManager.ToString方法代码示例

本文整理汇总了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;
        }
开发者ID:rehman922,项目名称:VIRETAIL,代码行数:97,代码来源:Masters.cs


注:本文中的DataManager.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。