protected override bool ValidateEditCustom()
        {
            XEquipmentReceiveBusiness business = this.m_Business as XEquipmentReceiveBusiness;

            string status = business.GetStatus(this.m_CurrentModel.ID);

            if (status != "制证" && status != "签发")
            {
                XMessageBox.ShowError("当前状态为:[" + status + "],不能制证打印!");
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
        /// <summary>
        /// 自定义UI校验
        /// </summary>
        /// <returns></returns>
        protected override bool ValidateCustom()
        {
            XEquipmentReceiveBusiness business = this.m_Business as XEquipmentReceiveBusiness;

            if (this.m_EditStatus == XEditStatus.Edit)
            {
                string status = business.GetStatus(this.m_CurrentModel.ID);
                if (status != "接收")
                {
                    XMessageBox.ShowError("当前状态为:[" + status + "],不能修改!");
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 3
0
        protected override bool ValidateDeleteCustom()
        {
            foreach (XModelBase model in this.m_SelectedModels)
            {
                string key = this.GetModelKey(model);

                XEquipmentReceiveBusiness business = this.m_Business as XEquipmentReceiveBusiness;

                string status = business.GetStatus(model.ID);

                if (status != "接收")
                {
                    if (XCommon.LoginUsersInfo.Remark.IndexOf("强制删除") >= 0)
                    {
                        string invoiceno = business.GetScalar(model.ID, "InvoiceNo");
                        if (invoiceno != "")
                        {
                            XMessageBox.ShowError("选择的记录中包含已开接收单的记录" + Environment.NewLine + "请先在【接收单打印】中删除接收单!");
                            return(false);
                        }
                        else
                        {
                            if (XMessageBox.ShowQuestion("选择的记录中包含非接收状态的记录,是否强制删除!", "警告!", false) == System.Windows.Forms.DialogResult.No)
                            {
                                return(false);
                            }
                        }
                    }
                    else
                    {
                        XMessageBox.ShowError("选择的记录中包含非接收状态的记录,不能删除!");
                        return(false);
                    }
                }
            }

            return(true);
        }
Esempio n. 4
0
        protected override bool ValidataForm()
        {
            XEquipmentReceiveBusiness business = this.m_Business as XEquipmentReceiveBusiness;

            string status = business.GetStatus(this.m_CurrentModel.ID);

            if (status != "接收" && status != "检定")
            {
                XMessageBox.ShowError("当前状态为:[" + status + "],不能检定!");
                return(false);
            }

            string standId = this.txtStandId.ValueMember;

            if (standId == string.Empty)
            {
                XMessageBox.ShowError("请选择计量标准!");
                return(false);
            }

            if (this.txtCheckedReport.Text.Trim() == string.Empty)
            {
                XMessageBox.ShowError("请上传检定报告!");
                return(false);
            }

            if (this.m_StandardBusiness.IsToCheck(standId))
            {
                if (XMessageBox.ShowQuestion("选择的标准或标准下的设备已送检,是否继续?") ==
                    System.Windows.Forms.DialogResult.No)
                {
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 5
0
        protected override bool ValidataForm()
        {
            XEquipmentReceiveBusiness business = this.m_Business as XEquipmentReceiveBusiness;

            string status = business.GetStatus(this.m_CurrentModel.ID);

            if (status != "核验" && status != "签发")
            {
                XMessageBox.ShowError("当前状态为:[" + status + "],不能签发!");
                return(false);
            }

            //XEquipmentReceiveInfo receiveInfo = this.m_CurrentModel as XEquipmentReceiveInfo;
            //if (receiveInfo.PdfReportFileName == string.Empty)
            //{
            //    if (this.txtFilePath.Text.Trim() == string.Empty)
            //    {
            //        XMessageBox.ShowError("请上传PDF报告!");
            //        return false;
            //    }
            //}

            return(true);
        }