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); } }