示例#1
0
        /// <summary>
        /// 出库校验
        /// </summary>
        /// <param name="grid"></param>
        /// <param name="currentrow"></param>
        /// <param name="con"></param>
        /// <param name="inputValue"></param>
        /// <param name="errorInfo"></param>
        /// <returns></returns>
        protected bool DoAfterSelOutCheck(KgmGrid grid, Resco.Controls.SmartGrid.CustomEditEventArgs e, EditControlInterface con, string inputValue, out string errorInfo)
        {
            errorInfo = string.Empty;
            //判断是否是buttonclick将信息带出来 如果是则直接取editvalue

            string shineValue = e.Cell.Row[QSConstValue.ROWSHINEVALUE].ToString();
            string shineText  = e.Cell.Row[QSConstValue.ROWSHINETEXT].ToString();

            //改用调用API方式
            SYS_SingleTableInfo filter = AppUtil.InitFilterModelAPI(e, string.Format(" AND ({0} = '{1}') ", shineValue, inputValue, shineText));
            string    jsonData         = WebAPIUtil.ConvertObjToJson(filter);
            DataTable dtBasic          = WebAPIUtil.PostAPIByJsonToGeneric <DataTable>("api/basicdocument/GetSingleTableInfo", jsonData);

            if (dtBasic == null || dtBasic.Rows.Count == 0)
            {
                errorInfo = "未能获取信息,请输入正确的编码!";
                e.Cell.Row[QSConstValue.VALUEMEMBER] = e.Cell.Row[QSConstValue.DISPLAYMEMBER] = string.Empty;
                return(false);
            }

            con.EditValue = dtBasic.Rows[0][QSConstValue.VALUEMEMBER].ToString();
            con.EditText  = dtBasic.Rows[0][QSConstValue.DISPLAYMEMBER].ToString();

            return(true);
        }
示例#2
0
        /// <summary>
        ///  新建单据在选择业务单据号后的处理
        /// </summary>
        /// <param name="dtSource">数据源</param>f
        /// <param name=QSConstValue.VALUEMEMBER>实际输入的值</param>
        /// <param name="errorInfo">错误信息</param>
        /// <returns>True False</returns>
        protected bool DoAfterSelOrderNo(KgmGrid grid, EditControlInterface con, string inputvalue, out string errorInfo)
        {
            errorInfo = string.Empty;
            string biztype = string.Empty;

            try
            {
                biztype = grid.GetRowCellData("CVOUCHID", QSConstValue.VALUEMEMBER).ToString();
                if (string.IsNullOrEmpty(biztype))
                {
                    errorInfo = "业务类型不能为空!";
                    return(false);
                }
            }
            catch
            {
            }
            //设置过滤条件
            string rowfilter = string.Format(" AND ORDERNO = '{0}' ", inputvalue);
            //根据过滤条件读取单据信息
            //ADO
            //DataTable dtorderList = bll.GetSourceList(rowfilter, bU8Sys);

            //API
            SYS_SourceList model = new SYS_SourceList();

            model.Condition = rowfilter;
            model.Bu8sys    = bU8Sys;
            string    jsonData    = WebAPIUtil.ConvertObjToJson(model);
            DataTable dtorderList = WebAPIUtil.PostAPIByJsonToGeneric <DataTable>("api/basic/GetSourceList", jsonData);

            if (dtorderList == null || dtorderList.Rows.Count == 0)
            {
                errorInfo = "未能获取到单据信息,请确认单据是否正确!";
                return(false);
            }

            //循环赋值
            if (!AppUtil.SetValueToGirdSource(grid, dtorderList.Rows[0], false))
            {
                return(false);
            }

            con.EditValue = dtorderList.Rows[0]["ORDERID"].ToString();
            con.EditText  = dtorderList.Rows[0]["ORDERNO"].ToString();


            //列表内的客户设置为不可用
            //grid.SetRowCellData("CCUSCODE", new string[] { QSConstValue.BEDIT }, new object[] { false });

            return(true);
        }
示例#3
0
        /// <summary>
        ///  新建单据在选择业务单据号后的处理
        /// </summary>
        /// <param name="dtSource">数据源</param>
        /// <param name=QSConstValue.VALUEMEMBER>实际输入的值</param>
        /// <param name="errorInfo">错误信息</param>
        /// <returns>True False</returns>
        protected bool DoAfterSelOrderNo(KgmGrid grid, EditControlInterface con, string inputvalue, out string errorInfo)
        {
            errorInfo = string.Empty;
            var biztype = string.Empty;

            try
            {
                biztype = grid.GetRowCellData("CVOUCHID", QSConstValue.VALUEMEMBER).ToString();
                if (string.IsNullOrEmpty(biztype))
                {
                    errorInfo = "业务类型不能为空!";
                    return(false);
                }
            }
            catch (Exception ex)
            {
                AppUtil.ShowError(ex.ToString());
            }
            //设置过滤条件
            string rowfilter = string.Format(" AND ORDERNO = '{0}' ", inputvalue);
            //根据过滤条件读取单据信息
            //DataTable dtorderList = tbll.GetTVInfo(rowfilter);
            string jsonData = WebAPIUtil.ConvertObjToJson(rowfilter);

            DataTable dtorderList = WebAPIUtil.PostAPIByJsonToGeneric <DataTable>("api/tray/GetTVInfo", jsonData);

            if (dtorderList == null || dtorderList.Rows.Count == 0)
            {
                errorInfo = "未能获取到单据信息,请确认单据是否正确!";
                return(false);
            }

            //循环赋值
            if (!AppUtil.SetValueToGirdSource(grid, dtorderList.Rows[0], false))
            {
                return(false);
            }

            return(true);
        }
示例#4
0
        /// <summary>
        ///  新建单据在选择业务单据号后的处理
        /// </summary>
        /// <param name="dtSource">数据源</param>
        /// <param name=QSConstValue.VALUEMEMBER>实际输入的值</param>
        /// <param name="errorInfo">错误信息</param>
        /// <returns>True False</returns>
        protected bool DoAfterSelVouchType(KgmGrid grid, EditControlInterface con, string inputvalue, out string errorInfo)
        {
            errorInfo = string.Empty;
            //设置过滤条件
            string rowfilter = string.Format(" AND A.MODULEID = '{0}' AND (CVOUCHID = '{1}' OR CVOUCHNAME = '{1}' OR CSOURCE = '{1}')", QSCommonValue.OP_Module.ModuleId, inputvalue);
            //根据过滤条件读取单据信息
            //ADO
            //DataTable dtVouchType = bll.GetVouchModel(rowfilter);

            //API
            VouchModel model = new VouchModel();

            model.Condition = rowfilter;
            model.DBNAME    = QSCommonValue.BarDbConfigInfo.U8DatabaseName;
            string    jsonData    = WebAPIUtil.ConvertObjToJson(model);
            DataTable dtVouchType = WebAPIUtil.PostAPIByJsonToGeneric <DataTable>("api/basic/GetVouchModel", jsonData);


            if (dtVouchType == null || dtVouchType.Rows.Count == 0)
            {
                errorInfo = "未能获取到业务类型信息,请确认编码是否正确!";
                return(false);
            }

            con.EditText  = dtVouchType.Rows[0]["CSOURCE"].ToString();
            con.EditValue = dtVouchType.Rows[0]["CVOUCHID"].ToString();
            //循环赋值
            if (!AppUtil.SetValueToGirdSource(grid, dtVouchType.Rows[0], false))
            {
                return(false);
            }

            QSCommonValue.KgmVouchType = dtVouchType.Rows[0];


            return(true);
        }