Exemple #1
0
 private void btnPrint_Click(object sender, EventArgs e)
 {
     Word.Document dct = this.fcWord.ActiveDocument as Word.Document;
     if (dct != null)
     {
         dct.PrintOut();
         XEquipmentReceiveBusiness business = new XEquipmentReceiveBusiness();//this.m_Business as
         business.PrintBill(m_EquipmentReceiveInfo);
     }
 }
        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);
        }
        protected override void grdData_Click(object sender, EventArgs e)
        {
            if (this.grdData.CurrentRow != null)
            {
                XEquipmentCheckInfo checkInfo = this.grdData.CurrentRow.DataRow as XEquipmentCheckInfo;

                XEquipmentReceiveBusiness business = new XEquipmentReceiveBusiness();

                IList <XModelBase> receiveInfos = business.GetTop5Checked(checkInfo.RID);

                this.grdEquipmentRecieve.DataSource = receiveInfos;
                this.grdEquipmentRecieve.AutoSizeColumns();
            }
        }
        protected override bool SaveEdit()
        {
            XEquipmentReceiveBusiness business = this.m_Business as XEquipmentReceiveBusiness;

            if (this.chkIsBack.Checked)
            {
                //退回重新检定
                return(business.Back(this.m_CurrentModel));
            }
            else
            {
                return(business.Sign(this.m_CurrentModel, XCommon.LoginUsersInfo.RID));
            }
        }
Exemple #5
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);
        }
Exemple #6
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);
        }
Exemple #7
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);
        }
        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);
        }
Exemple #9
0
        protected override bool SaveEdit()
        {
            XEquipmentReceiveBusiness business = this.m_Business as XEquipmentReceiveBusiness;

            return(business.Checked(this.m_CurrentModel, XCommon.LoginUsersInfo.RID));
        }