Beispiel #1
0
    private void ddlRemedy_AbnormalReasonID_Data()
    {
        var isSuccess = false;
        var msg       = "";
        var datas     = new List <AT_CodeMap_Bean>();
        var viewData  = new AT_CodeMap_Model()
        {
            TabName = "Punch",
            FldName = "PunchSeason"
        };

        ddlRemedy_AbnormalReasonID.Items.Clear();
        isSuccess = PunchUpdate.Select_AT_CodeMap(viewData, out datas, out msg);
        if (isSuccess && datas != null && datas.Count > 0)
        {
            viewData.SelectDDLDataList = PunchUpdate.GridDataFormat(datas); //Format Data
        }
        try
        {
            ddlRemedy_AbnormalReasonID.DataSource     = viewData.SelectDDLDataList;
            ddlRemedy_AbnormalReasonID.DataTextField  = "CodeCName";
            ddlRemedy_AbnormalReasonID.DataValueField = "Code";
            ddlRemedy_AbnormalReasonID.DataBind();
        }
        catch (Exception)
        {
            Util.MsgBox("非公務-補登原因撈取資料失敗,請通知相關設定人員!!");
        }
        ddlRemedy_AbnormalReasonID.Items.Insert(0, new ListItem("---請選擇---", ""));
    }
    protected void LoadData()
    {
        gvMain.Visible = true;
        var isSuccess = false;
        var msg       = "";
        var datas     = new List <Punch_Confirm_Remedy_Bean>();
        var viewData  = new Punch_Confirm_Remedy_Model()
        {
            ValidCompID   = StringIIF(UserInfo.getUserInfo().CompID),
            ValidID       = StringIIF(UserInfo.getUserInfo().UserID),
            ConfirmStatus = "2"
        };

        isSuccess = PunchUpdate.PunchAppdOperation_DoQuery(viewData, out datas, out msg);
        if (isSuccess && datas != null && datas.Count > 0)
        {
            viewData.SelectGridDataList = PunchUpdate.GridDataFormat(datas); //Format Data
        }
        gvMain.DataSource = viewData.SelectGridDataList;
        gvMain.DataBind();
    }
    private void DoQuery()
    {
        var isSuccess = false;
        var msg       = "";
        var datas     = new List <Punch_Confirm_Remedy_Bean>();
        var viewData  = new Punch_Confirm_Remedy_Model()
        {
            //CompID = StringIIF(UserInfo.getUserInfo().CompID),
            EmpID            = StringIIF(UserInfo.getUserInfo().UserID),
            StartPunchDate   = StringIIF(ucStartPunchDate.ucSelectedDate),
            EndPunchDate     = StringIIF(ucEndPunchDate.ucSelectedDate),
            ConfirmPunchFlag = StringIIF(ddlConfirmPunchFlag.SelectedValue),
            ConfirmStatus    = StringIIF(ddlConfirmStatus.SelectedValue),
            AbnormalFlag     = StringIIF(ddlAbnormalFlag.SelectedValue)
        };

        isSuccess = PunchUpdate.PunchUpdateInquire_DoQuery(viewData, out datas, out msg);
        if (isSuccess && datas != null && datas.Count > 0)
        {
            viewData.SelectGridDataList = PunchUpdate.GridDataFormat(datas); //Format Data
        }
        gvMain.DataSource = viewData.SelectGridDataList;
        gvMain.DataBind();
    }