/// <summary>
        /// 获得实体
        /// </summary>
        /// <returns></returns>
        private StorgeJS EntityGet()
        {
            StorgeJS entity = new StorgeJS();

            entity.ID = HTDataID;
            entity.SelectByID();
            entity.FormNo   = txtFormNo.Text.Trim();
            entity.FormDate = txtFormDate.DateTime.Date;
            entity.JSDateS  = txtJSDateS.DateTime.Date;
            entity.JSDateE  = txtJSDateE.DateTime.Date;
            entity.FormOPID = drpMakeOPID.EditValue.ToString();

            entity.Remark = txtRemark.Text.Trim();

            return(entity);
        }
        private void SetSubStatus()
        {
            ButtonItem btnJs       = ToolBarItemGet(-1, "btnJs");
            ButtonItem btnJsCancel = ToolBarItemGet(-1, "btnJsCancel");
            StorgeJS   entity      = new StorgeJS();

            entity.ID = HTDataID;
            entity.SelectByID();
            if (entity.JSFlag == 1)
            {
                btnJs.Enabled       = false;
                btnJsCancel.Enabled = true;
            }
            else
            {
                btnJs.Enabled       = true;
                btnJsCancel.Enabled = false;
            }
        }
        private void btnJs_Click(object sender, EventArgs e)
        {
            try
            {
                if (HTFormStatus == FormStatus.新增 || HTFormStatus == FormStatus.修改)
                {
                    this.ShowMessage("请先保存单据后再进行结算操作");
                    return;
                }
                StorgeJS entity = new StorgeJS();
                entity.ID = HTDataID;
                entity.SelectByID();
                if (entity.SubmitFlag == (int)YesOrNo.No)
                {
                    this.ShowMessage("请先提交单据后再进行结算");
                    return;
                }
                if (entity.JSFlag == (int)YesOrNo.Yes)
                {
                    this.ShowMessage("该单据已经进行结算,请核对");
                    return;
                }

                SqlParameter[] param = new SqlParameter[2];
                param[0]       = new SqlParameter("@JSID", SqlDbType.Int);
                param[0].Value = SysConvert.ToInt32(HTDataID);//ID

                param[1]       = new SqlParameter("@JSOPID", SqlDbType.VarChar, 50);
                param[1].Value = SysConvert.ToString(FParamConfig.LoginID);//结算人ID

                DataTable dt = SysUtils.ExecuteStoredProc("USP3_WH_JSEXEC", param);
                gridView1.GridControl.DataSource = dt;
                gridView1.GridControl.Show();
                BindGrid();
                SetSubStatus();
                lblJS.Text = "已结算";
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
        /// <summary>
        /// 设置
        /// </summary>
        public override void EntitySet()
        {
            StorgeJS entity = new StorgeJS();

            entity.ID = HTDataID;
            bool findFlag = entity.SelectByID();

            HTDataFormNo = entity.FormNo;

            txtFormNo.Text        = entity.FormNo.ToString();
            txtFormDate.DateTime  = entity.FormDate;
            txtJSDateS.DateTime   = entity.JSDateS;
            txtJSDateE.DateTime   = entity.JSDateE;
            drpMakeOPID.EditValue = entity.FormOPID;
            txtRemark.Text        = entity.Remark.ToString();
            HTDataSubmitFlag      = entity.SubmitFlag;
            HTDataDelFlag         = entity.DelFlag;
            lblJS.ForeColor       = Color.Red;
            if (!findFlag)
            {
            }
            switch (entity.JSFlag)
            {
            case 1:
                lblJS.Text = "已结算";

                break;

            case 0:
                lblJS.Text = "未结算";
                break;

            default:
                lblJS.Text = ""; break;
            }
            SetSubStatus();
            BindGrid();
        }