예제 #1
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);
        }
예제 #2
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);
        }
예제 #3
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);
        }