Exemplo n.º 1
0
        /// <summary>
        /// 校验数据正确性
        /// </summary>
        /// <returns></returns>
        private bool ValidateValue()
        {
            if (this.fpSpread1_Sheet1.Rows.Count > 0)
            {
                this.fpSpread1.StopCellEditing();
                for (int i = 0; i < this.fpSpread1_Sheet1.Rows.Count; i++)
                {
                    string temp = this.fpSpread1_Sheet1.GetText(i, 1).ToString();
                    if (temp == "")
                    {
                        MessageBox.Show("功能名称不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return(false);
                    }
                    else if (!Neusoft.FrameWork.Public.String.ValidMaxLengh(temp, 50))
                    {
                        MessageBox.Show("功能名称过长");
                        return(false);
                    }
                    string Gongneng = this.fpSpread1_Sheet1.GetText(i, 2).ToString();
                    if (Gongneng == "")
                    {
                        MessageBox.Show("窗口名称不能为空", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return(false);
                    }
                    else if (!Neusoft.FrameWork.Public.String.ValidMaxLengh(Gongneng, 100))
                    {
                        MessageBox.Show("窗口名称过长");
                        return(false);
                    }
                    if (!Neusoft.FrameWork.Public.String.ValidMaxLengh(this.fpSpread1_Sheet1.GetText(i, 3).ToString(), 50))
                    {
                        MessageBox.Show("程序集名称过长");
                        return(false);
                    }
                    string FormShowType = fpSpread1_Sheet1.GetText(i, 4).ToString();

                    if (FormShowType == "" || FormShowType == "MDI" || FormShowType == "Form" || FormShowType == "FormDialog")
                    {
                    }
                    else
                    {
                        MessageBox.Show("显示模式 错误");
                        return(false);
                    }
                    string FormType = fpSpread1_Sheet1.GetText(i, 5).ToString();


                    string Mark = this.fpSpread1_Sheet1.GetText(i, 6).ToString();
                    if (!Neusoft.FrameWork.Public.String.ValidMaxLengh(Mark, 1000))
                    {
                        MessageBox.Show("tag过长");
                        return(false);
                    }
                    string SortId = this.fpSpread1_Sheet1.GetText(i, 7).ToString();
                    if (!Neusoft.FrameWork.Public.String.ValidMaxLengh(SortId, 6))
                    {
                        MessageBox.Show("顺序号过长");
                        return(false);
                    }
                }
                return(true);
            }
            else
            {
                return(true);
            }
        }