protected void odsPersonalReimburseDetails_Inserting(object sender, ObjectDataSourceMethodEventArgs e)
    {
        if (this.ViewState["ObjectId"] != null)
        {
            e.InputParameters["FormPersonalReimburseID"] = int.Parse(this.ViewState["ObjectId"].ToString());
        }
        UserControls_UCDateInput ucOccurDate = (UserControls_UCDateInput)this.fvPersonalReimburseDetails.FindControl("UCOccurDate");

        e.InputParameters["OccurDate"] = ucOccurDate.SelectedDate;

        if (DateTime.Parse(ucOccurDate.SelectedDate) > DateTime.Now)
        {
            PageUtility.ShowModelDlg(this, "发生日期填写不正确!");
            e.Cancel = true;
            return;
        }

        DropDownList dplExpenseManageType = (DropDownList)this.fvPersonalReimburseDetails.FindControl("dplExpenseManageType");

        e.InputParameters["ExpenseManageTypeID"] = dplExpenseManageType.SelectedItem.Value;
        TextBox txtAmount = (TextBox)this.fvPersonalReimburseDetails.FindControl("txtAmount");

        e.InputParameters["Amount"] = txtAmount.Text;
        TextBox txtRemark = (TextBox)this.fvPersonalReimburseDetails.FindControl("txtRemark");

        e.InputParameters["Remark"] = txtRemark.Text;
        e.InputParameters["User"]   = Session["StuffUser"];
    }
Пример #2
0
    protected void odsProxyReimburse_Inserting(object sender, ObjectDataSourceMethodEventArgs e)
    {
        UserControls_UCDateInput NewUCEndDate = (UserControls_UCDateInput)this.fvProxyReimburse.FindControl("NewUCEndDate");
        DateTime enddate = DateTime.Parse(NewUCEndDate.SelectedDate);

        e.InputParameters["EndDate"] = enddate;
    }
    protected void odsPersonalReimburseDetails_Updating(object sender, ObjectDataSourceMethodEventArgs e)
    {
        if (this.ViewState["ObjectId"] != null)
        {
            e.InputParameters["FormPersonalReimburseID"] = int.Parse(this.ViewState["ObjectId"].ToString());
        }

        UserControls_UCDateInput ucOccurDate = (UserControls_UCDateInput)this.gvPersonalReimburseDetails.Rows[gvPersonalReimburseDetails.EditIndex].FindControl("UCOccurDate");

        if (DateTime.Parse(ucOccurDate.SelectedDate) > DateTime.Now)
        {
            PageUtility.ShowModelDlg(this, "发生日期填写不正确!");
        }
        e.InputParameters["User"] = Session["StuffUser"];
    }
Пример #4
0
    protected bool IsUpdateDetailValid()
    {
        int     stuffUserID     = int.Parse(this.StuffUserFormView.DataKey["StuffUserId"].ToString());
        TextBox UserNameTextBox = (TextBox)this.StuffUserFormView.FindControl("UserNameTextBox");

        if (UserNameTextBox.Text.Trim() != string.Empty)
        {
            StuffUserBLL bll = new StuffUserBLL();
            if ((int)bll.StuffUserAdapter.QueryForUpdDistinct(stuffUserID, UserNameTextBox.Text.Trim()) > 0)
            {
                PageUtility.ShowModelDlg(this, "登陆帐号重复,请修改!");
                return(false);
            }
        }

        TextBox StuffIdTextBox = (TextBox)this.StuffUserFormView.FindControl("StuffIdTextBox");

        if (StuffIdTextBox.Text.Trim() != string.Empty)
        {
            StuffUserBLL bll = new StuffUserBLL();
            if ((int)bll.StuffUserAdapter.QueryForUpdDistinctStuffID(StuffIdTextBox.Text.Trim(), stuffUserID) > 0)
            {
                PageUtility.ShowModelDlg(this, "员工工号重复,请修改!");
                return(false);
            }
        }

        TextBox pwCtl = (TextBox)this.StuffUserFormView.FindControl("UserPasswordTextBox");

        if (pwCtl.Text.Trim().Length < 6)
        {
            PageUtility.ShowModelDlg(this, "密码长度不能小于6");
            return(false);
        }

        UserControls_UCDateInput UCAttendDate = (UserControls_UCDateInput)this.StuffUserFormView.FindControl("UCAttendDate");

        if (UCAttendDate.SelectedDate == string.Empty)
        {
            PageUtility.ShowModelDlg(this, "必须录入入职日期");
            return(false);
        }
        return(true);
    }
Пример #5
0
    protected void odsTravelReimburseDetails_Inserting(object sender, ObjectDataSourceMethodEventArgs e)
    {
        if (this.ViewState["ObjectId"] != null)
        {
            e.InputParameters["FormPersonalReimburseID"] = int.Parse(this.ViewState["ObjectId"].ToString());
        }
        UserControls_UCDateInput ucOccurDate = (UserControls_UCDateInput)this.fvTravelReimburseDetails.FindControl("UCOccurDate");

        e.InputParameters["OccurDate"] = ucOccurDate.SelectedDate;
        DropDownList dplExpenseManageType = (DropDownList)this.fvTravelReimburseDetails.FindControl("dplExpenseManageType");

        e.InputParameters["ExpenseManageTypeID"] = dplExpenseManageType.SelectedItem.Value;
        TextBox txtAmount = (TextBox)this.fvTravelReimburseDetails.FindControl("txtAmount");

        e.InputParameters["Amount"] = txtAmount.Text;
        TextBox txtRemark = (TextBox)this.fvTravelReimburseDetails.FindControl("txtRemark");

        e.InputParameters["Remark"] = txtRemark.Text;
        e.InputParameters["User"]   = Session["StuffUser"];
    }