public void BeforeSave() { var curReslbbh = GetRightCardDataTable()[ResLbbh].ToString(); var code = ResourceRestFul.GetClient().GetMaxResCode(curReslbbh, curHsdwbh, true); GetRightCardDataTable()[ResKpbh] = code; GetRightCardDataTable()[ResZybh] = code; GetCurRow()[ResKpbh] = code; GetCurRow()[ResZybh] = code; }
public void HtConfirm() { var index = ListGrid.SelectedIndex; if (index < 0) { MessageBox.Show("请选择合同行数据!", "合同选择提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } var curHtState = GetCurRowState(); if (curHtState == HtState.HasConfirm) { MessageBox.Show("该合同已经被确认,无需再次确认!", "合同选择提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (curHtState == HtState.Stop) { MessageBox.Show("该合同已经被终止,无法确认!", "合同选择提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (curHtState == HtState.OutDay) { MessageBox.Show("该合同已经结束,无法确认!", "合同选择提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } var question = MessageBox.Show("合同确认后将不可修改,是否确认合同?", "合同确认提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); //取消 if (question == DialogResult.Cancel) { return; } //合同确认 var state = (int)HtState.HasConfirm; var htId = GetCurRow()[Htnm].ToString(); GetCurRow()[HtZsState] = state; ResourceRestFul.GetClient().SaveHtState(state, htId); GetCurRow()[HtZsStateMc] = HtStateDictionary.ConvertToString(HtState.HasConfirm); GetRightCardDataTable()[HtZsStateMc] = HtStateDictionary.ConvertToString(HtState.HasConfirm); MessageBox.Show("合同确认成功!", "合同确认提示", MessageBoxButtons.OK, MessageBoxIcon.Information); //成功后触发一下当前按钮状态 SelectRowChanged(this, null); }
public void ResChange() { var index = ListGrid.SelectedIndex; if (index < 0) { MessageBox.Show("请选择有效数据行!", "资源提示"); return; } var state = GetCurRowState(); if (state != ResourceState.HasConfirm) { MessageBox.Show("只有已确认状态的资源允许变更!"); return; } if (state == ResourceState.Editing) { MessageBox.Show("该资源未进行确认,请先确认后进行资源变更!"); return; } //资源编号 var curRowResCode = GetCurRow()[ResZybh].ToString(); //服务器端检查资源有否有正常合同 var htId = ResourceRestFul.GetClient().GetHtByRescourceCode(curRowResCode); if (string.IsNullOrEmpty(htId) == false) { MessageBox.Show("该资源有对应合同,合同未终止前无法进行资源变更!"); return; } //先灰色显示 this.BarBtnChange.VisualComponent.Enabled = false; var changeCol = "ResXM05"; var curValue = GetCurRow()[changeCol].ToString(); var differentValue = Guid.NewGuid(); GetCurRow()[changeCol] = differentValue; GetRightCardDataTable()[changeCol] = differentValue; //进行编辑 this.CompContext.ExcuteAction("Edit"); }
/// <summary> /// 2.检查当前资源是否有对应的合同信息 /// </summary> /// <returns></returns> private List <string> GetActionIdStr() { var curRow = GetCurRow(); var curRowResCode = curRow[ResZybh].ToString(); //服务器端检查 var htId = ResourceRestFul.GetClient().GetHtByRescourceCode(curRowResCode); if (string.IsNullOrEmpty(htId)) { //新增状态,双数据源的是Add,有的是Create return(new List <string> { "actionID=Add" }); } //TODO 应该是只读状态,因为界面上过滤调了,所以只有新增的情况啦 return(new List <string> { "actionID=", $"dataID={htId}" }); }
public void ResConfirm() { var index = ListGrid.SelectedIndex; if (index < 0) { MessageBox.Show("请选择资源行数据!", "资源选择提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } var resState = GetCurRowState(); if (resState != ResourceState.Editing) { MessageBox.Show("该资源已经被确认,无需再次确认", "资源选择提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } //1.先判断该资源是否确认过 var question = MessageBox.Show("资源确认后将不可修改,是否确认资源?", "资源确认提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); //取消 if (question == DialogResult.Cancel) { return; } //进入提交状态,设置资源状态为不可编辑状态 var state = (int)ResourceState.HasConfirm; var resId = GetCurRow()[ResNm].ToString(); GetCurRow()[ResState] = state; ResourceRestFul.GetClient().SaveResState(state, resId); GetCurRow()[ResStateName] = ResStateDictionary.ConvertToString(ResourceState.HasConfirm); GetRightCardDataTable()[ResStateName] = ResStateDictionary.ConvertToString(ResourceState.HasConfirm); MessageBox.Show("资源确认成功!", "资源确认提示", MessageBoxButtons.OK, MessageBoxIcon.Information); //成功后触发一下当前按钮状态 confirmRes = true; SelectRowChanged(this, null); }
public void SetResLayer() { //todo 根据资源类别获取最大级数替换成明细,默认是3级 int maxLayer = 3; var resLbMaxLayer = ResourceRestFul.GetClient().GetMaxResLbLayer(); if (!string.IsNullOrEmpty(resLbMaxLayer)) { maxLayer = Convert.ToInt32(resLbMaxLayer); } //先清空 ResLbLayer.VisualComponent.DataSource = null; for (int i = 1; i < maxLayer; i++) { var curLayer = i.ToString(); ResLbLayer.AppendItem(curLayer, curLayer); } //最后一级用明细表示 ResLbLayer.AppendItem("明细", maxLayer.ToString()); }
public void AfterSave() { //保存后必须设定对应的资源状态为已生成合同状态 //可能会有问题,比如再次编辑呢。。。。。应该也没事 //要判断是否联查进来的 if (CompContext.FormUri.Parameters.AllKeys.Contains("isLc")) { //保存走的是卡片,所以要卡片 GetCurRow()[HtZsState] = (int)HtState.Editing; GetCurRow()[HtZsStateMc] = HtStateDictionary.ConvertToString(HtState.Editing); //右边同步显示 GetRightCardDataTable()[HtZsState] = (int)HtState.Editing; GetRightCardDataTable()[HtZsStateMc] = HtStateDictionary.ConvertToString(HtState.Editing); //联查进来的要单独保存一下 var htnm = GetCurRow()["htnm"].ToString(); ResourceRestFul.GetClient().SaveHtState((int)HtState.Editing, htnm); } ResourceRestFul.GetClient().SaveResState((int)ResourceState.HasBuildHt, GetCurCardResId()); this.BarBtnChange.VisualComponent.Enabled = true; }
public void HtStop() { var index = ListGrid.SelectedIndex; if (index < 0) { MessageBox.Show("请选择合同行数据!", "合同选择提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } var curHtState = GetCurRowState(); if (curHtState != HtState.HasConfirm) { MessageBox.Show("只有已确认状态的合同允许终止!", "合同选择提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } var question = MessageBox.Show("合同终止后将不可恢复,是否终止合同?", "合同终止提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); //取消 if (question == DialogResult.Cancel) { return; } var htId = GetCurRow()[Htnm].ToString(); ResourceRestFul.GetClient().StopHt(htId); var stopState = (int)HtState.Stop; GetCurRow()[HtZsState] = stopState; GetCurRow()[HtZsStateMc] = HtStateDictionary.ConvertToString(HtState.Stop); GetRightCardDataTable()[HtZsStateMc] = HtStateDictionary.ConvertToString(HtState.Stop); //没有刷新,可能会有问题 MessageBox.Show("合同终止成功"); }
/// <summary> /// 根据选择的资源类别生成资源编号 /// </summary> /// <param name="typeCode"></param> /// <returns></returns> private string GetResCodeByType(string typeCode) { return(ResourceRestFul.GetClient().GetMaxResCode(typeCode, curHsdwbh, false)); }
public void UpdateResAndHtStateByEndTime() { ResourceRestFul.GetClient().UpdateResAndHtStateByEndTime(); }