Пример #1
0
    protected void btnSAVE_Click(object sender, EventArgs e)
    {
        CurrType currTypeData = new CurrType();

        currTypeData.CurrTypeCode = code;
        currTypeData.LevelCode    = ddlDegree.SelectedValue;
        currTypeData.CurrTypeName = txtCURRTYPE.Text;

        string currTypeUpdate = new CurrType().updateCurrType(currTypeData);

        if (currTypeUpdate == "Success")
        {
            Response.Redirect("listSTUDY_CURRTYPE.aspx");
        }
    }
Пример #2
0
    protected void btnSAVE_Click(object sender, EventArgs e)
    {
        CurrType currTypeData = new CurrType();

        currTypeData.CurrTypeCode = new TQF.TQFUtility().getMaxID("CURRTYPECODE", "CURRTYPE");
        currTypeData.LevelCode    = ddlDegree.SelectedValue;
        currTypeData.CurrTypeName = txtCURRTYPE.Text;

        string currFormatInsert = new CurrType().insertCurrType(currTypeData);

        if (currFormatInsert == "Success")
        {
            Response.Redirect("listSTUDY_CURRTYPE.aspx");
        }
    }
Пример #3
0
    protected void ddlCURRFORMAT_SelectedIndexChanged(object sender, EventArgs e)
    {
        string currFormatLevel = new CurrFormat().getCurrFormat(ddlCURRFORMAT.SelectedValue).LevelCode;

        List <CurrType> currType = new CurrType().getCurrType();

        ddlCURRTYPE.Items.Clear();
        ddlCURRTYPE.Items.Insert(ddlCURRTYPE.Items.Count, new ListItem("--- เลือกลักษณะโครงสร้างหลักสูตร ---", "0000"));
        foreach (CurrType row in currType)
        {
            if (row.LevelCode == currFormatLevel)
            {
                ddlCURRTYPE.Items.Insert(ddlCURRTYPE.Items.Count, new ListItem(row.CurrTypeName, row.CurrTypeCode));
            }
        }
    }
Пример #4
0
    /// <summary>
    /// เรียกดูข้อมูลจากตาราง CURRTYPE
    /// </summary>
    /// <param name="CurrTypeCode">รหัสประเภทหลักสูตร</param>
    /// <returns>ข้อมูลจากตาราง CURRTYPE</returns>
    public CurrType getCurrType(string CurrTypeCode)
    {
        CurrType CurrTypeData = new CurrType();

        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

        oracleObj.SelectCommand = "Select * From CURRTYPE Where CURRTYPECODE='" + CurrTypeCode + "'";
        DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty);

        foreach (DataRowView rowData in allData)
        {
            CurrTypeData.CurrTypeCode = rowData["CURRTYPECODE"].ToString();
            CurrTypeData.LevelCode    = rowData["LEVELCODE"].ToString();
            CurrTypeData.CurrTypeName = rowData["CURRTYPENAME"].ToString();
        }

        return(CurrTypeData);
    }
Пример #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["login_data"] == null)
        {
            Response.Redirect("../index.aspx");
        }
        else
        {
            //ตรวจสอบสิทธิ์
            login_data = (UserLoginData)Session["login_data"];
            if (autro_obj.CheckGroupUser(login_data, group_var.officer_department) || autro_obj.CheckGroupUser(login_data, group_var.officer_faculty))
            {
                // ======== Process ===========
                code = Request.QueryString["token"];

                CurrType currTypeData = new CurrType().getCurrType(code);

                if (!Page.IsPostBack)
                {
                    List <TQF.Levels> level = new TQF.Levels().getLevels();

                    foreach (TQF.Levels row in level)
                    {
                        ddlDegree.Items.Insert(ddlDegree.Items.Count, new ListItem(row.LevelName, row.LevelCode));
                    }
                    ddlDegree.Items.FindByValue(currTypeData.LevelCode).Selected = true;

                    txtCURRTYPE.Text = currTypeData.CurrTypeName;
                }
                //=============================
            }
            else
            {
                HttpContext.Current.Session["response"] = "ตรวจสอบไม่พบสิทธิ์การเข้าใช้งาน";
                HttpContext.Current.Response.Redirect("err_response.aspx");
            }
        }
    }
Пример #6
0
    /// <summary>
    /// เรียกดูข้อมูลจากตาราง CURRTYPE
    /// </summary>
    /// <returns>ข้อมูลจากตาราง CURRTYPE</returns>
    public List <CurrType> getCurrType()
    {
        List <CurrType> CurrTypeData = new List <CurrType>();

        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

        oracleObj.SelectCommand = "Select * From CURRTYPE Order By CURRTYPECODE";
        DataView allData = (DataView)oracleObj.Select(DataSourceSelectArguments.Empty);

        foreach (DataRowView rowData in allData)
        {
            CurrType CurrTypeRow = new CurrType();

            CurrTypeRow.CurrTypeCode = rowData["CURRTYPECODE"].ToString();
            CurrTypeRow.LevelCode    = rowData["LEVELCODE"].ToString();
            CurrTypeRow.CurrTypeName = rowData["CURRTYPENAME"].ToString();

            CurrTypeData.Add(CurrTypeRow);
        }

        return(CurrTypeData);
    }
Пример #7
0
 private void Validate(CurrType desiredType) {
     if (desiredType != currType) {
         throw new InvalidOperationException($"Attempting to get {desiredType} when {currType} is set");
     }
 }
Пример #8
0
 public Either(TA val) {
     currType = CurrType.Alternate;
     alternate = val;
     primary = default(TP);
 }
Пример #9
0
 public Either(TP val) {
     currType = CurrType.Primary;
     primary = val;
     alternate = default(TA);
 }
Пример #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["login_data"] == null)
        {
            Response.Redirect("../index.aspx");
        }
        else
        {
            //ตรวจสอบสิทธิ์
            login_data = (UserLoginData)Session["login_data"];
            if (autro_obj.CheckGroupUser(login_data, group_var.officer_department) || autro_obj.CheckGroupUser(login_data, group_var.officer_faculty))
            {
                // ======== Process ===========
                // Head Table
                string[] ar = { "โครงสร้างหลักสูตร", "ระดับการศึกษา", "แก้ไข", "ลบ" };
                tblStudyCurrType.Attributes.Add("class", "table table-bordered table-striped table-hover");
                tblStudyCurrType.Attributes.Add("id", "dt_basic");
                TableHeaderRow tRowHead = new TableHeaderRow();
                tRowHead.TableSection = TableRowSection.TableHeader;
                for (int cellCtr = 1; cellCtr <= ar.Length; cellCtr++)
                {
                    // Create a new cell and add it to the row.
                    TableHeaderCell cellHead = new TableHeaderCell();
                    cellHead.Text = ar[cellCtr - 1];
                    tRowHead.Cells.Add(cellHead);
                }
                tblStudyCurrType.Rows.Add(tRowHead);

                List <CurrType> currType = new List <CurrType>();
                currType = new CurrType().getCurrType();
                foreach (CurrType data in currType)
                {
                    TableRow tRowBody = new TableRow();
                    tRowBody.TableSection = TableRowSection.TableBody;

                    TableCell cellCurrFormatName = new TableCell();
                    cellCurrFormatName.Text = data.CurrTypeName;
                    //cellCurrFormatName.Width = 200;
                    tRowBody.Cells.Add(cellCurrFormatName);

                    TableCell cellLevelCode = new TableCell();
                    cellLevelCode.Text  = new Levels().getLevels(data.LevelCode).LevelName;
                    cellLevelCode.Width = 200;
                    tRowBody.Cells.Add(cellLevelCode);

                    TableCell cellEdit = new TableCell();
                    string    urlEdit  = "editSTUDY_CURRTYPE.aspx?token=" + data.CurrTypeCode;
                    HyperLink hypEdit  = new HyperLink();
                    hypEdit.Attributes.Add("data-target", "#editModal");
                    hypEdit.Attributes.Add("data-toggle", "modal");
                    hypEdit.Text        = "<h4><i class='fa fa-edit'></i></h4>";
                    hypEdit.NavigateUrl = urlEdit;
                    hypEdit.ToolTip     = "Edit";
                    cellEdit.Controls.Add(hypEdit);
                    cellEdit.CssClass = "text-center";
                    cellEdit.Width    = 100;
                    tRowBody.Cells.Add(cellEdit);

                    TableCell cellDel = new TableCell();
                    string    urlDel  = "deleteSTUDY_CURRTYPE.aspx?token=" + data.CurrTypeCode;
                    HyperLink hypDel  = new HyperLink();
                    hypDel.Attributes.Add("data-target", "#deleteModal");
                    hypDel.Attributes.Add("data-toggle", "modal");
                    hypDel.Text        = "<h4><i class='fa fa-trash-o'></i></h4>";
                    hypDel.NavigateUrl = urlDel;
                    hypDel.ToolTip     = "Delete";
                    cellDel.Controls.Add(hypDel);
                    cellDel.CssClass = "text-center";
                    cellDel.Width    = 100;
                    tRowBody.Cells.Add(cellDel);

                    tblStudyCurrType.Rows.Add(tRowBody);
                }
                //=============================
            }
            else
            {
                HttpContext.Current.Session["response"] = "ตรวจสอบไม่พบสิทธิ์การเข้าใช้งาน";
                HttpContext.Current.Response.Redirect("err_response.aspx");
            }
        }
    }