示例#1
0
    //=====================================================================
    //  FunctionName : GetModifyInputParameter
    /// <summary>
    /// 得到修改用户输入参数操作
    /// </summary>
    //=====================================================================
    protected override Boolean GetModifyInputParameter()
    {
        Boolean      boolReturn   = true;
        ValidateData validateData = new ValidateData();

        // 验证输入参数
        appData        = RICH.Common.BM.T_BG_0601.T_BG_0601BusinessEntity.GetDataByObjectID(ObjectID.Text);
        appData.OPCode = RICH.Common.Base.ApplicationData.ApplicationDataBase.OPType.ID;

        validateData = ValidateFBH(FBH.Text, false, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.FBH = Convert.ToString(validateData.Value.ToString());
            }

            else
            {
                appData.FBH = null;
            }
            FBH.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            FBH.BackColor   = System.Drawing.Color.YellowGreen;
            MessageContent += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn      = validateData.Result;
        }

        validateData = ValidateBT(BT.Text, false, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.BT = Convert.ToString(validateData.Value.ToString());
            }

            else
            {
                appData.BT = null;
            }
            BT.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            BT.BackColor    = System.Drawing.Color.YellowGreen;
            MessageContent += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn      = validateData.Result;
        }

        validateData = ValidateFBLM(FBLM.SelectedValue, false, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.FBLM = Convert.ToString(validateData.Value.ToString());
            }

            else
            {
                appData.FBLM = null;
            }
            FBLM.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            FBLM.BackColor  = System.Drawing.Color.YellowGreen;
            MessageContent += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn      = validateData.Result;
        }

        validateData = ValidateFBBM(FBBM.SelectedValue, true, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.FBBM = Convert.ToString(validateData.Value.ToString());
            }

            else
            {
                appData.FBBM = null;
            }
            FBBM.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            FBBM.BackColor  = System.Drawing.Color.YellowGreen;
            MessageContent += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn      = validateData.Result;
        }

        validateData = ValidateXXLX(XXLX.SelectedValue, false, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.XXLX = Convert.ToString(validateData.Value.ToString());
            }

            else
            {
                appData.XXLX = null;
            }
            XXLX.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            XXLX.BackColor  = System.Drawing.Color.YellowGreen;
            MessageContent += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn      = validateData.Result;
        }

        if (XXTPDZ.Upload())
        {
            appData.XXTPDZ = XXTPDZ.Text;
        }
        else
        {
            MessageContent += @"<font color=""red"">" + XXTPDZ.Message + "</font>";
            boolReturn      = false;
        }

        validateData = ValidateXXNR(XXNR.Text, false, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.XXNR = Convert.ToString(validateData.Value.ToString());
            }

            else
            {
                appData.XXNR = null;
            }
            XXNR.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            XXNR.BackColor  = System.Drawing.Color.YellowGreen;
            MessageContent += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn      = validateData.Result;
        }

        if (FJXZDZ.Upload())
        {
            appData.FJXZDZ = FJXZDZ.Text;
        }
        else
        {
            MessageContent += @"<font color=""red"">" + FJXZDZ.Message + "</font>";
            boolReturn      = false;
        }

        validateData = ValidateXXZT(XXZT.SelectedValue, true, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.XXZT = Convert.ToString(validateData.Value.ToString());
            }

            else
            {
                appData.XXZT = null;
            }
            XXZT.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            XXZT.BackColor  = System.Drawing.Color.YellowGreen;
            MessageContent += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn      = validateData.Result;
        }

        validateData = ValidateIsTop(IsTop.SelectedValue, true, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.IsTop = Convert.ToString(validateData.Value.ToString());
            }

            else
            {
                appData.IsTop = null;
            }
            IsTop.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            IsTop.BackColor = System.Drawing.Color.YellowGreen;
            MessageContent += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn      = validateData.Result;
        }

        validateData = ValidateTopSort(TopSort.Text, true, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.TopSort = Convert.ToInt32(validateData.Value.ToString());
            }
            TopSort.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            TopSort.BackColor = System.Drawing.Color.YellowGreen;
            MessageContent   += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn        = validateData.Result;
        }

        validateData = ValidateIsBest(IsBest.SelectedValue, true, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.IsBest = Convert.ToString(validateData.Value.ToString());
            }

            else
            {
                appData.IsBest = null;
            }
            IsBest.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            IsBest.BackColor = System.Drawing.Color.YellowGreen;
            MessageContent  += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn       = validateData.Result;
        }

        validateData = ValidateFBRJGH(FBRJGH.Text, true, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.FBRJGH = Convert.ToString(validateData.Value.ToString());
            }

            else
            {
                appData.FBRJGH = null;
            }
            FBRJGH.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            FBRJGH.BackColor = System.Drawing.Color.YellowGreen;
            MessageContent  += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn       = validateData.Result;
        }

        validateData = ValidateFBSJRQ(FBSJRQ.Text, true, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.FBSJRQ = Convert.ToDateTime(validateData.Value.ToString());
            }
            FBSJRQ.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            FBSJRQ.BackColor = System.Drawing.Color.YellowGreen;
            MessageContent  += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn       = validateData.Result;
        }

        validateData = ValidateFBIP(FBIP.Text, true, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.FBIP = Convert.ToString(validateData.Value.ToString());
            }

            else
            {
                appData.FBIP = null;
            }
            FBIP.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            FBIP.BackColor  = System.Drawing.Color.YellowGreen;
            MessageContent += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn      = validateData.Result;
        }

        return(boolReturn);
    }
示例#2
0
    //=====================================================================
    //  FunctionName : GetAddInputParameter
    /// <summary>
    /// 得到添加用户输入参数操作
    /// </summary>
    //=====================================================================
    protected override Boolean GetAddInputParameter()
    {
        Boolean      boolReturn   = true;
        ValidateData validateData = new ValidateData();

        // 验证输入参数

        validateData = ValidateBT(BT.Text, false, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.BT = Convert.ToString(validateData.Value.ToString());
            }
            BT.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            BT.BackColor    = System.Drawing.Color.YellowGreen;
            MessageContent += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn      = validateData.Result;
        }

        validateData = ValidateFBLM(FBLM.SelectedValue, false, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.FBLM = Convert.ToString(validateData.Value.ToString());
            }
            FBLM.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            FBLM.BackColor  = System.Drawing.Color.YellowGreen;
            MessageContent += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn      = validateData.Result;
        }

        validateData = ValidateFBBM(FBBM.SelectedValue, true, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.FBBM = Convert.ToString(validateData.Value.ToString());
            }
            FBBM.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            FBBM.BackColor  = System.Drawing.Color.YellowGreen;
            MessageContent += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn      = validateData.Result;
        }

        validateData = ValidateXXLX(XXLX.SelectedValue, false, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.XXLX = Convert.ToString(validateData.Value.ToString());
            }
            XXLX.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            XXLX.BackColor  = System.Drawing.Color.YellowGreen;
            MessageContent += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn      = validateData.Result;
        }

        if (XXTPDZ.Upload())
        {
            appData.XXTPDZ = XXTPDZ.Text;
        }
        else
        {
            MessageContent += @"<font color=""red"">" + XXTPDZ.Message + "</font>";
            boolReturn      = false;
        }

        validateData = ValidateXXNR(XXNR.Text, false, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.XXNR = Convert.ToString(validateData.Value.ToString());
            }
            XXNR.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            XXNR.BackColor  = System.Drawing.Color.YellowGreen;
            MessageContent += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn      = validateData.Result;
        }

        if (FJXZDZ.Upload())
        {
            appData.FJXZDZ = FJXZDZ.Text;
        }
        else
        {
            MessageContent += @"<font color=""red"">" + FJXZDZ.Message + "</font>";
            boolReturn      = false;
        }

        appData.XXZT = "02";

        validateData = ValidateIsTop(IsTop.SelectedValue, true, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.IsTop = Convert.ToString(validateData.Value.ToString());
            }
            IsTop.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            IsTop.BackColor = System.Drawing.Color.YellowGreen;
            MessageContent += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn      = validateData.Result;
        }

        validateData = ValidateTopSort(TopSort.Text, true, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.TopSort = Convert.ToInt32(validateData.Value.ToString());
            }
            TopSort.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            TopSort.BackColor = System.Drawing.Color.YellowGreen;
            MessageContent   += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn        = validateData.Result;
        }

        validateData = ValidateIsBest(IsBest.SelectedValue, true, false);
        if (validateData.Result)
        {
            if (!validateData.IsNull)
            {
                appData.IsBest = Convert.ToString(validateData.Value.ToString());
            }
            IsBest.BackColor = System.Drawing.Color.Empty;
        }
        else
        {
            IsBest.BackColor = System.Drawing.Color.YellowGreen;
            MessageContent  += @"<font color=""red"">" + validateData.Message + "</font>";
            boolReturn       = validateData.Result;
        }

        appData.FBRJGH = (string)Session[ConstantsManager.SESSION_USER_ID];

        appData.FBSJRQ = DateTime.Now;

        appData.FBIP = (string)Request.ServerVariables["REMOTE_ADDR"];

        // 自动生成编号
        T_BG_0601ApplicationLogic instanceT_BG_0601ApplicationLogic
            = (T_BG_0601ApplicationLogic)CreateApplicationLogicInstance(typeof(T_BG_0601ApplicationLogic));

        appData.FBH = instanceT_BG_0601ApplicationLogic.AutoGenerateFBH(appData);

        appData.XXZT = "02";

        appData.FBRJGH = (string)Session[ConstantsManager.SESSION_USER_ID];

        appData.FBSJRQ = DateTime.Now;

        appData.FBIP = (string)Request.ServerVariables["REMOTE_ADDR"];

        return(boolReturn);
    }