示例#1
0
        /// <summary>
        /// 新开
        /// </summary>
        /// <returns>行号</returns>
        public int AddRow(int sign)
        {
            DataTable dt = null;

            dt = view.BindDocModelData;
            if (sign == 1)
            {
                _dataSet = showcardbase.AddRows(1, sign, Convert.ToInt16(dt.Rows[dt.Rows.Count - 1]["item_type"]));//  HIS.ZYDoc_BLL.OP_Base.AddRows(1, sign, Convert.ToInt16(dt.Rows[dt.Rows.Count - 1]["item_type"]));
            }
            else
            {
                _dataSet = showcardbase.AddRows(1, sign, 0);
            }
            int rowid;

            if (dt != null && dt.Rows.Count > 0)
            {
                rowid = dt.Rows.Count - 1;
                if (dt.Rows[rowid]["item_name"].ToString().Trim() == "")        //最后一行不为空才允许新增一行
                {
                    return(rowid);
                }
                else
                {
                    List <HIS.Model.ZY_DOC_ORDERMODELLIST_E> _zyDcoModel = new List <HIS.Model.ZY_DOC_ORDERMODELLIST_E>();
                    HIS.Model.ZY_DOC_ORDERMODELLIST_E        zyDocModel  = new HIS.Model.ZY_DOC_ORDERMODELLIST_E();
                    zyDocModel.XD = false;
                    _zyDcoModel.Add(zyDocModel);
                    DataTable ddt = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(_zyDcoModel);
                    dt.Rows.Add(ddt.Rows[0].ItemArray);
                    rowid = dt.Rows.Count - 1;
                    return(rowid);
                }
            }
            else
            {
                List <HIS.Model.ZY_DOC_ORDERMODELLIST_E> _zyDcoModel = new List <HIS.Model.ZY_DOC_ORDERMODELLIST_E>();
                HIS.Model.ZY_DOC_ORDERMODELLIST_E        zyDocModel  = new HIS.Model.ZY_DOC_ORDERMODELLIST_E();
                zyDocModel.XD = false;
                _zyDcoModel.Add(zyDocModel);
                view.BindDocModelData = null;
                view.BindDocModelData = HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(_zyDcoModel);
                dt = view.BindDocModelData;
            }
            rowid = dt.Rows.Count - 1;
            return(rowid);
        }
示例#2
0
 /// <summary>
 /// 新增
 /// </summary>
 /// <param name="orderkind"></param>
 /// <param name="sign"></param>
 /// <param name="order_type"></param>
 /// <returns></returns>
 public DataSet AddRows(int orderkind, int sign, int order_type)
 {
     return(showcardbase.AddRows(orderkind, sign, order_type));
 }