예제 #1
0
    private void BindData()
    {
        inputReceiptAction inputReceiptAction = new inputReceiptAction();
        inputReceiptYear   inputReceiptYear   = new inputReceiptYear();

        if (this.ViewState["MAINID"] != null)
        {
            inputReceiptYear = inputReceiptAction.GetYearPlanInfo(this.ViewState["MAINID"].ToString());
        }
        else
        {
            inputReceiptYear = inputReceiptAction.GetYearPlanInfo("");
        }
        this.txtExaminePeople.Text   = inputReceiptYear.ExaminePeople;
        this.txtExamineTime.Text     = inputReceiptYear.ExamineTime.ToShortDateString();
        this.txtExamineTime.ReadOnly = true;
        this.txtRemark.Text          = inputReceiptYear.Remark;
        this.txtSerialNumber.Text    = inputReceiptYear.SerialNumber;
        this.txtTabPeople.Text       = inputReceiptYear.TabPeople;
        this.txtTabTime.Text         = inputReceiptYear.TabTime.ToShortDateString();
    }
예제 #2
0
    private void BindDropDownList(string MainID)
    {
        inputReceiptAction inputReceiptAction = new inputReceiptAction();
        DataTable          existPlanYear      = inputReceiptAction.GetExistPlanYear("");
        string             text = "";

        for (int i = DateTime.Today.Year - 10; i < DateTime.Today.Year + 10; i++)
        {
            bool flag = false;
            for (int j = 0; j < existPlanYear.Rows.Count; j++)
            {
                if (MainID == "")
                {
                    if (i.ToString() == existPlanYear.Rows[j][0].ToString())
                    {
                        flag = true;
                    }
                }
                else
                {
                    inputReceiptYear yearPlanInfo = inputReceiptAction.GetYearPlanInfo(MainID);
                    text = yearPlanInfo.PlanYear;
                    if (i.ToString() == existPlanYear.Rows[j][0].ToString() && i.ToString() != yearPlanInfo.PlanYear)
                    {
                        flag = true;
                    }
                }
            }
            if (!flag)
            {
                this.ddlPlanYear.Items.Add(new System.Web.UI.WebControls.ListItem(i.ToString() + "年度", i.ToString()));
            }
        }
        if (text != "")
        {
            this.ddlPlanYear.SelectedValue = text;
        }
    }