//设置单据界面右下角 ”确定,取消“按钮的显示和隐藏 private void SetButtonState() { //if (this.PageStatus == UFSoft.UBF.UI.IView.PartStateType.Insert) // ButtonManger.SetToolBarNewStatus(Toolbar2, 0); //else // ButtonManger.SetToolBarModifyStatus(Toolbar2, 0); //如果页面是通过TitleLink进入则显示确定取消按钮 if (NavigateManager.IsTitleLink(this)) { this.BtnOk.Visible = true; this.BtnClose.Visible = true; BtnList.Enabled = false; } else if (NavigateManager.IsModelPopup(this)) { this.BtnOk.Visible = true; this.BtnClose.Visible = true; //this.OnInstaledArk122.Visible = false; BtnList.Enabled = false; } else { this.BtnOk.Visible = false; this.BtnClose.Visible = false; this.OnInstaledArk122.Visible = false; BtnList.Enabled = true; } }
/// <summary> /// 控制按钮状态 /// </summary> private void SetControlStatus() { if (UFIDA.U9.UI.PDHelper.NavigateManager.IsModelPopup(this) || UFIDA.U9.UI.PDHelper.NavigateManager.IsTitleLink(this)) { this.BtnOk.Visible = true; this.BtnClose.Visible = true; } else { this.BtnOk.Visible = false; this.BtnClose.Visible = false; } this.BtnAttachment.Enabled = false; //附件不可见 this.BtnPrint.Enabled = false; //打印不可见 if (this.Model.AllFormType.FocusedRecord.DataRecordState == DataRowState.Added) //新增未保存 { this.BtnDelete.Enabled = false; //删除按钮 } if (this.Model.AllFormType.FocusedRecord.ID < 1) { this.BtnCopy.Enabled = false; } //控制“确定”、“取消”按钮 if (NavigateManager.IsTitleLink(this)) { this.BtnOk.Visible = true; this.BtnClose.Visible = true; BtnList.Enabled = false; } else if (NavigateManager.IsModelPopup(this)) { this.BtnOk.Visible = false; this.BtnClose.Visible = false; BtnList.Enabled = false; } else { this.BtnOk.Visible = false; this.BtnClose.Visible = false; BtnList.Enabled = true; } }
//OnAllocation0_Click... private void OnAllocation0_Click_Extend(object sender, EventArgs e) { //调用模版提供的默认实现.--默认实现可能会调用相应的Action. //出运明细单保存 //if(this.Code70.Text.Trim() == "") // throw new Exception("没有发票号组编码"); //if (this.Model.BillNoItemHead.FocusedRecord == null) // throw new Exception("没有发票号组信息"); if (this.Model.BillNoItemHead_BillNoItemLine.Records.Count <= 0) { //throw new Exception("没有发票号信息"); this.Model.ErrorMessage.Message = "没有发票号信息"; return; } //else if (this.Model.BillNoItemHead_BillNoItemLine.Records.Count == 1) //{ // if (this.Model.BillNoItemHead_BillNoItemLine.FocusedRecord.ID <= 0) // { // this.Model.ErrorMessage.Message = "请录入发票号"; // return; // } //} //勾选的出运明细单必须是同一种装柜方式 if (this.Model.BilAlllcationShipPlanView.SelectRecords.Count <= 0) { //this.Model.ErrorMessage.Message = "没有选择出运明细单"; //return; throw new Exception("没有选择出运明细单"); } UFIDA.U9.Cust.GS.FT.OperateShipPlanBP.Proxy.AllocationBillNoProxy proxy = new OperateShipPlanBP.Proxy.AllocationBillNoProxy(); List <long> listShipPlan = new List <long>(); //不同币种、接单组织、外销员、出运日期的出运明细单不允许分配同一个发票号组 string parkType = "", currenty = "", saleMan = ""; int count = 0; long org = 0; DateTime shipPlanDate = DateTime.Now; foreach (BilAlllcationShipPlanViewRecord recourd in this.Model.BilAlllcationShipPlanView.SelectRecords) { ////放在BP校验 //if (count > 0) //{ // if (parkType != "" && parkType != recourd.ParkingType) //出运明细单必须是同一种装柜方式; // { // throw new Exception("出运明细单" + recourd.ShipPlanDetailHead_DocNo + "与其他不为同一种装柜方式"); // } // //不同币种、接单组织、外销员、出运日期的出运明细单不允许分配同一个发票号组; // if (currenty != recourd.Currency) // { // throw new Exception("出运明细单" + recourd.ShipPlanDetailHead_DocNo + "与其他明细单不为同一种币种"); // } // if (org != recourd.Org) // { // throw new Exception("出运明细单" + recourd.ShipPlanDetailHead_DocNo + "与其他明细单不为相同接单组织"); // } // if (saleMan != recourd.SaleMan) // { // throw new Exception("出运明细单" + recourd.ShipPlanDetailHead_DocNo + "与其他明细单不为同一个业务员"); // } // if (shipPlanDate.ToString("yyyy-MM-dd") != (recourd.Date??DateTime.Now).ToString("yyyy-MM-dd")) // { // throw new Exception("出运明细单" + recourd.ShipPlanDetailHead_DocNo + "与其他明细单出运日期不同"); // } //} if (!listShipPlan.Contains(recourd.ShipPlanDetailHead ?? 0)) { listShipPlan.Add(recourd.ShipPlanDetailHead ?? 0); } parkType = recourd.ParkingType; currenty = recourd.Currency; saleMan = recourd.SaleMan; org = recourd.Org ?? 0; count++; } BtnSave_Click_DefaultImpl(sender, e); proxy.ShipPlanList = listShipPlan; proxy.Type = 0; proxy.BillNoItemHead = this.Model.BillNoItemHead.FocusedRecord.ID; //if (BtnOk.Visible) //{ // BtnOk_Click(sender, e); //} int result = proxy.Do(); if (result > 0) { if (NavigateManager.IsTitleLink(this) || NavigateManager.IsModelPopup(this)) { //BtnOk_Click(sender, e); this.CloseDialog(true); } else { //分配的发票号组更新到明细单界面 } } OnAllocation0_Click_DefaultImpl(sender, e); }