Exemple #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);
        }
Exemple #2
0
        private void BindScanList()
        {
            DataTable dtScan = WebAPIUtil.GetAPIByJsonToGeneric <DataTable>(string.Format("/api/scan/GetTempScan/{0}/{1}", QSCommonValue.ListHead.Rows[0]["F_EnCode"].ToString(), QSCommonValue.CurrentUser.Userid));

            QSCommonValue.ScanBody = dtScan;
            dgScan.DataSource      = dtScan;
            lblCount.Text          = "合计件数:" + dtScan.Rows.Count.ToString();
        }
Exemple #3
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);
        }
Exemple #4
0
        /// <summary>
        /// 登录
        /// </summary>
        /// <returns></returns>
        private bool Login(StatusLable lblstatus, out string strErrorMsg)
        {
            strErrorMsg = string.Empty;

            if (txtUserId.Text == string.Empty)
            {
                strErrorMsg = "请输入用户代码!";
                return(false);
            }

            //只在第一次登陆执行
            if (!initLogtin(lblstatus, out strErrorMsg))
            {
                return(false);
            }

            lblstatus.UpdateMessage("正在登录系统...");
            QSCommonValue.token = string.Empty;

            LoginSystemModel LogModel = new LoginSystemModel();

            LogModel.Account     = txtUserId.Text;
            LogModel.Password    = txtUserPwd.Text;
            LogModel.LoginSystem = LoginSystemModel.LoginSystemEnum.移动端系统;

            string jsonData = WebAPIUtil.ConvertObjToJson(LogModel);
            //KgmApiResultEntity result = WebAPIUtil.PostAPIByJsonToAPIResult("/api/Auth/GetUserToken", jsonData);
            KgmApiResultEntity result = WebAPIUtil.PostAPIByJsonToAPIResult("api/Auth/GetUserToken", jsonData);

            if (!result.result)
            {
                strErrorMsg = result.message;
                return(false);
            }
            else
            {
                QSCommonValue.token = result.message;
            }

            return(true);
        }
        /// <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);
        }
Exemple #6
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);
        }
Exemple #7
0
        private void btnFinish_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                DataTable dt = dgScan.DataSource as DataTable;
                if (dt == null || dt.Rows.Count == 0)
                {
                    AppUtil.ShowError("请至少扫描一条记录!");
                    return;
                }

                dt = WebAPIUtil.GetAPIByJsonToGeneric <DataTable>(string.Format("/api/scan/GetTempScanCy/{0}/{1}", QSCommonValue.ListHead.Rows[0]["F_EnCode"].ToString(), QSCommonValue.operModule));

                DataView dv = new DataView(dt);
                dv.RowFilter = "CYQTY <> 0";
                if (dv.Count > 0 && AppUtil.ShowQuestion("仍有货品未扫描完毕,是否确认完成?") != DialogResult.Yes)
                {
                    return;
                }
                WebAPIUtil.GetToAPIByJsonToAPIResult(string.Format("/api/scan/TempScanFinish/{0}/{1}", QSCommonValue.ListHead.Rows[0]["F_EnCode"].ToString(), QSCommonValue.operModule));
                AppUtil.ShowInformation("操作完成!");
                this.ParentForm.LoadView(typeof(FrmHead), false, true);
            }
            catch (Exception ex)
            {
                logger.ErrorException("FrmScan窗体txtorderNo_KeyDown事件:" + ex.Message, ex);
                AppUtil.ShowError("操作失败!原因:" + ex.Message);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
                txtbarcode.Focus();
                txtbarcode.Text = string.Empty;
            }
        }
Exemple #8
0
        private void txtorderNo_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode != Keys.Enter)
            {
                return;
            }
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                if (AppUtil.AlertMust(txtcPosCode, "货位不允许为空") || AppUtil.AlertMust(txtbarcode, "条码不允许为空") ||
                    AppUtil.AlertMust(txtQty, "数量不允许为空"))
                {
                    return;
                }

                SaveScan s = new SaveScan();
                s.BARCODE   = txtbarcode.Text;
                s.BDEL      = chkDel.Checked;
                s.CPOSCODE  = txtcPosCode.Text;
                s.CWHCODE   = QSCommonValue.ListHead.Rows[0]["F_WarehouseId"].ToString();
                s.OPERUSER  = QSCommonValue.CurrentUser.Userid;
                s.ORDERNO   = QSCommonValue.ListHead.Rows[0]["F_EnCode"].ToString();
                s.ORDERTYPE = QSCommonValue.operModule;

                try
                {
                    s.QTY = decimal.Parse(txtQty.Text);
                }
                catch
                {
                    AppUtil.ShowError("输入的数量格式不正确!");
                    return;
                }



                string             jsonData = WebAPIUtil.ConvertObjToJson(s);
                KgmApiResultEntity result   = WebAPIUtil.PostAPIByJsonToAPIResult("/api/scan/SaveTempScan", jsonData);
                if (result.result)
                {
                    BindScanList();
                    txtbarcode.Focus();
                    txtbarcode.Text = string.Empty;
                    txtQty.Text     = "1";
                    chkDel.Checked  = chkStatus.Checked = false;
                }
                else
                {
                    AppUtil.ShowError(result.message);
                }
            }
            catch (Exception ex)
            {
                logger.ErrorException("FrmScan窗体txtorderNo_KeyDown事件:" + ex.Message, ex);
                AppUtil.ShowError("操作失败!原因:" + ex.Message);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Exemple #9
0
        private void BindScanCyList()
        {
            DataTable dtScan = WebAPIUtil.GetAPIByJsonToGeneric <DataTable>(string.Format("/api/scan/GetTempScanCy/{0}/{1}", QSCommonValue.ListHead.Rows[0]["F_EnCode"].ToString(), QSCommonValue.operModule));

            dgHead.DataSource = dtScan;
        }
Exemple #10
0
        private void txtorderNo_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                if (e.KeyCode != Keys.Enter)
                {
                    return;
                }

                DataSet ds = WebAPIUtil.GetAPIByJsonToGeneric <DataSet>(string.Format("api/scan/GetList/{0}/{1}", txtorderNo.Text, QSCommonValue.operModule));
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    txtorderNo.Focus();
                    txtorderNo.SelectAll();
                    AppUtil.ShowError("未能找到单据信息,请确认单号是否正确!");
                    return;
                }

                if (Convert.ToInt32(ds.Tables[0].Rows[0]["F_Status"]) > 1)
                {
                    txtorderNo.Focus();
                    txtorderNo.SelectAll();
                    AppUtil.ShowError("单据已经完成!");
                    return;
                }

                if (QSCommonValue.operModule == "PD")
                {
                    if (Convert.ToInt32(ds.Tables[0].Rows[0]["F_Status"]) > 0)
                    {
                        txtorderNo.Focus();
                        txtorderNo.SelectAll();
                        AppUtil.ShowError("单据已经完成!");
                        return;
                    }
                }
                else
                {
                    if (Convert.ToInt32(ds.Tables[0].Rows[0]["F_Status"]) == 0)
                    {
                        txtorderNo.Focus();
                        txtorderNo.SelectAll();
                        AppUtil.ShowError("单据尚未审核!");
                        return;
                    }
                }

                QSCommonValue.ListHead = ds.Tables[0];
                QSCommonValue.Body     = ds.Tables[1];
                dgHead.DataSource      = QSCommonValue.Body;
            }
            catch (Exception ex)
            {
                logger.ErrorException("FrmHead窗体txtorderNo_KeyDown事件:" + ex.Message, ex);
                AppUtil.ShowError("操作失败!原因:" + ex.Message);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }