protected void odsBudget_Inserting(object sender, ObjectDataSourceMethodEventArgs e)
    {
        UserControls_OUSelect ucNewOuSelect = (UserControls_OUSelect)this.BudgetAddFormView.FindControl("ucNewOuSelect");

        if (ucNewOuSelect.OUId == null)
        {
            PageUtility.ShowModelDlg(this.Page, "请选择预算部门!");
            e.Cancel = true;
            return;
        }

        UserControls_YearAndMonthUserControl ucNewPeriod = (UserControls_YearAndMonthUserControl)this.BudgetAddFormView.FindControl("ucNewPeriod");
        string period = ((TextBox)(ucNewPeriod.FindControl("txtDate"))).Text.Trim();

        if (period == string.Empty)
        {
            PageUtility.ShowModelDlg(this.Page, "请录入费用期间!");
            e.Cancel = true;
            return;
        }
        else
        {
            DateTime yearAndMonth = DateTime.Parse(period.Substring(0, 4) + "-" + period.Substring(4, 2) + "-01");
            e.InputParameters["Period"] = yearAndMonth;
        }
        e.InputParameters["UserID"]     = ((AuthorizationDS.StuffUserRow) this.Session["StuffUser"]).StuffUserId;
        e.InputParameters["PositionID"] = ((AuthorizationDS.PositionRow) this.Session["Position"]).PositionId;
    }
Example #2
0
    protected void odsBudget_Inserting(object sender, ObjectDataSourceMethodEventArgs e)
    {
        UserControls_CustomerControl ucNewCustomerSelect = (UserControls_CustomerControl)this.BudgetAddFormView.FindControl("ucNewCustomerSelect");

        if (ucNewCustomerSelect.CustomerID == string.Empty)
        {
            PageUtility.ShowModelDlg(this.Page, "请选择预算客户!");
            e.Cancel = true;
            return;
        }

        UserControls_YearAndMonthUserControl ucNewPeriod = (UserControls_YearAndMonthUserControl)this.BudgetAddFormView.FindControl("ucNewPeriod");
        string period = ((TextBox)(ucNewPeriod.FindControl("txtDate"))).Text.Trim();

        if (period == string.Empty)
        {
            PageUtility.ShowModelDlg(this.Page, "请录入费用期间!");
            e.Cancel = true;
            return;
        }
        else
        {
            DateTime yearAndMonth = DateTime.Parse(period.Substring(0, 4) + "-" + period.Substring(4, 2) + "-01");
            e.InputParameters["Period"] = yearAndMonth;
        }

        TextBox txtModifyReason = (TextBox)this.BudgetAddFormView.FindControl("txtNewModifyReason");

        if (txtModifyReason.Text == string.Empty)
        {
            e.InputParameters["ModifyReason"] = string.Empty;
        }

        TextBox txtNewAdjustBudget = (TextBox)this.BudgetAddFormView.FindControl("txtNewAdjustBudget");

        if (txtNewAdjustBudget.Text == string.Empty)
        {
            e.InputParameters["AdjustBudget"] = decimal.Zero;
        }
        TextBox txtNewTransferBudget = (TextBox)this.BudgetAddFormView.FindControl("txtNewTransferBudget");

        if (txtNewTransferBudget.Text == string.Empty)
        {
            e.InputParameters["TransferBudget"] = decimal.Zero;
        }
        e.InputParameters["UserID"]     = ((AuthorizationDS.StuffUserRow) this.Session["StuffUser"]).StuffUserId;
        e.InputParameters["PositionID"] = ((AuthorizationDS.PositionRow) this.Session["Position"]).PositionId;
    }
Example #3
0
    protected void odsAccruedPeriod_Inserting(object sender, ObjectDataSourceMethodEventArgs e)
    {
        UserControls_YearAndMonthUserControl ucNewPeriod = (UserControls_YearAndMonthUserControl)this.fvAccruedPeriod.FindControl("ucNewPeriod");
        string period = ((TextBox)(ucNewPeriod.FindControl("txtDate"))).Text.Trim();

        if (period == string.Empty)
        {
            PageUtility.ShowModelDlg(this.Page, "请录入费用期间!");
            e.Cancel = true;
            return;
        }
        else
        {
            DateTime yearAndMonth = DateTime.Parse(period.Substring(0, 4) + "-" + period.Substring(4, 2) + "-01");
            e.InputParameters["AccruedPeriod"] = yearAndMonth;
        }
    }