コード例 #1
0
    public int UpdateProgram(BLLProgram objbll)
    {
        SqlParameter[] param = new SqlParameter[5];

        param[0]       = new SqlParameter("@program_id", SqlDbType.NVarChar);
        param[0].Value = objbll.Program_id;

        param[1]       = new SqlParameter("@program_name", SqlDbType.NVarChar);
        param[1].Value = objbll.Program_name;

        param[2]       = new SqlParameter("@credit_hours", SqlDbType.NVarChar);
        param[2].Value = objbll.Credit_hours;

        param[3]       = new SqlParameter("@modifiedby ", SqlDbType.NVarChar);
        param[3].Value = objbll.Modifiedby;

        param[4]       = new SqlParameter("@Update_Date", SqlDbType.DateTime);
        param[4].Value = objbll.Update_date;

        objcon.OpenConnection();
        int a = objcon.sqlcmdUpdateById("sp_updateprogram", param);

        objcon.CloseConnection();
        return(a);
    }
コード例 #2
0
    public List <BLLProgram> SelectProgram()
    {
        List <BLLProgram> objlist = new List <BLLProgram>();
        BLLProgram        objbll  = new BLLProgram();

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectAll("sp_selectprogram");
        while (dr.Read())
        {
            objbll              = new BLLProgram();
            objbll.Id           = Convert.ToInt32(dr["id"].ToString());
            objbll.Program_id   = dr["program_id"].ToString();
            objbll.Program_name = dr["program_name"].ToString();
            objbll.Credit_hours = dr["credit_hours"].ToString();
            objbll.Status       = Convert.ToBoolean(dr["status"].ToString());
            objbll.Createdby    = dr["createdby"].ToString();
            objbll.Modifiedby   = dr["modifiedby"].ToString();
            objbll.Insert_date  = Convert.ToDateTime(dr["insert_date"].ToString());
            objbll.Update_date  = Convert.ToDateTime(dr["update_date"].ToString());
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
コード例 #3
0
    public int InsertProgram(BLLProgram objbll)
    {
        SqlParameter[] param = new SqlParameter[8];

        param[0]       = new SqlParameter("@program_id", SqlDbType.NVarChar);
        param[0].Value = objbll.Program_id;

        param[1]       = new SqlParameter("@program_name", SqlDbType.NVarChar);
        param[1].Value = objbll.Program_name;

        param[2]       = new SqlParameter("@credit_hours", SqlDbType.NVarChar);
        param[2].Value = objbll.Credit_hours;

        param[3]       = new SqlParameter("@status", SqlDbType.Bit);
        param[3].Value = objbll.Status;

        param[4]       = new SqlParameter("@createdby", SqlDbType.NVarChar);
        param[4].Value = objbll.Createdby;

        param[5]       = new SqlParameter("@modifiedby ", SqlDbType.NVarChar);
        param[5].Value = objbll.Modifiedby;

        param[6]       = new SqlParameter("@Insert_Date", SqlDbType.DateTime);
        param[6].Value = objbll.Insert_date;

        param[7]       = new SqlParameter("@Update_Date", SqlDbType.DateTime);
        param[7].Value = objbll.Update_date;

        objcon.OpenConnection();
        int a = objcon.sqlcmdInsert("sp_insertprogram", param);

        objcon.CloseConnection();
        return(a);
    }
コード例 #4
0
    public List <BLLProgram> SelectProgrambyid(BLLProgram objbll)
    {
        List <BLLProgram> objlist = new List <BLLProgram>();

        SqlParameter param = new SqlParameter();

        param       = new SqlParameter("@program_id", SqlDbType.NVarChar);
        param.Value = objbll.Program_id;

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectById("sp_selectprogrambyid", param);
        while (dr.Read())
        {
            objbll              = new BLLProgram();
            objbll.Id           = Convert.ToInt32(dr["id"].ToString());
            objbll.Program_id   = dr["program_id"].ToString();
            objbll.Program_name = dr["program_name"].ToString();
            objbll.Credit_hours = dr["credit_hours"].ToString();
            objbll.Status       = Convert.ToBoolean(dr["status"].ToString());
            objbll.Createdby    = dr["createdby"].ToString();
            objbll.Modifiedby   = dr["modifiedby"].ToString();
            objbll.Insert_date  = Convert.ToDateTime(dr["insert_date"].ToString());
            objbll.Update_date  = Convert.ToDateTime(dr["update_date"].ToString());
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
コード例 #5
0
    public void SelectProgram()
    {
        List <BLLProgram> objlist = new List <BLLProgram>();
        BLLProgram        objbll  = new BLLProgram();

        objlist = objbll.SelectProgram();
        if (objlist.Count > 0)
        {
            dgprogram.DataSource = objlist;
            dgprogram.DataBind();
            for (int i = 0; i <= dgprogram.Rows.Count - 1; i++)
            {
                string update = (string)Session["update"];
                string delete = (string)Session["delete"];
                if (update == "yes")
                {
                    dgprogram.Rows[i].Cells[2].Enabled = true;
                }
                else
                {
                    dgprogram.Rows[i].Cells[2].Enabled = false;
                }
                if (delete == "yes")
                {
                    dgprogram.Rows[i].Cells[3].Enabled = true;
                }
                else
                {
                    dgprogram.Rows[i].Cells[3].Enabled = false;
                }
            }
        }
    }
    private void LoadProgram()
    {
        List <ATTProgram> ProgramLST = BLLProgram.GetProgramList(int.Parse(Session["OrgID"].ToString()), 0, "N", "N", "N", "N", "N", "N");

        Session["Programs"]            = ProgramLST;
        this.lstProgram.DataSource     = ProgramLST;
        this.lstProgram.DataValueField = "ProgramID";
        this.lstProgram.DataTextField  = "ProgramName";
        this.DataBind();
    }
コード例 #7
0
    protected void btndelete_Click(object sender, EventArgs e)
    {
        LinkButton obj    = (LinkButton)(sender);
        string     val    = obj.CommandArgument.ToString();
        BLLProgram objbll = new BLLProgram();

        objbll.Program_id = val;
        int a = objbll.DeleteProgram(objbll);

        SelectProgram();
    }
コード例 #8
0
    public int DeleteProgram(BLLProgram objbll)
    {
        SqlParameter[] param = new SqlParameter[1];

        param[0]       = new SqlParameter("@program_id", SqlDbType.NVarChar);
        param[0].Value = objbll.Program_id;

        objcon.OpenConnection();
        int a = objcon.sqlcmdUpdateById("sp_deleteprogram", param);

        objcon.CloseConnection();
        return(a);
    }
コード例 #9
0
    public void SelectProgram()
    {
        List <BLLProgram> objlist = new List <BLLProgram>();
        BLLProgram        objbll  = new BLLProgram();

        objlist = objbll.SelectProgram();
        if (objlist.Count > 0)
        {
            cmdprogram.DataSource = objlist;
            cmdprogram.ValueField = "program_id";
            cmdprogram.TextField  = "program_name";
            cmdprogram.DataBind();
        }
    }
コード例 #10
0
    public void LoadForm()
    {
        BLLProgram objbll = new BLLProgram();

        objbll.Program_id = (string)Session["prg_update"];
        List <BLLProgram> objlist = new List <BLLProgram>();

        objlist = objbll.SelectProgrambyid(objbll);
        if (objlist.Count > 0)
        {
            txtprogramid.Text   = objlist[0].Program_id;
            txtprogramname.Text = objlist[0].Program_name;
            txtcredithours.Text = objlist[0].Credit_hours;
        }
    }
 void LoadProgram(int OrgID)
 {
     try
     {
         Session["DLPDS_Program_List"]      = BLLProgram.GetProgramList(OrgID, 0, "Y", "N", "N", "Y", "Y", "Y");
         this.ddlProgram_Rqd.DataSource     = Session["DLPDS_Program_List"];
         this.ddlProgram_Rqd.DataTextField  = "ProgramName";
         this.ddlProgram_Rqd.DataValueField = "ProgramID";
         this.ddlProgram_Rqd.DataBind();
     }
     catch (Exception ex)
     {
         this.lblStatus.Text        = "Page loading...";
         this.lblStatusMessage.Text = ex.Message;
         this.programmaticModalPopup.Show();
     }
 }
コード例 #12
0
    public void UpdateProgram()
    {
        BLLProgram objbll = new BLLProgram();

        objbll.Program_id   = (string)Session["prg_update"];
        objbll.Program_name = txtprogramname.Text;
        objbll.Credit_hours = txtcredithours.Text;
        objbll.Modifiedby   = user;
        int a = objbll.UpdateProgram(objbll);

        if (a == 1)
        {
            lblresult.Text  = "Program Update Successfully....";
            BtnSave.Enabled = false;
            BtnNew.Enabled  = true;
        }
    }
コード例 #13
0
    void GetProgram()
    {
        List <ATTProgram> ProgramList = BLLProgram.GetProgramList(int.Parse(Session["OrgID"].ToString()), 0, "N", "N", "N", "N", "N", "N");

        try
        {
            lstProgram.DataSource     = ProgramList;
            lstProgram.DataTextField  = "ProgramName";
            lstProgram.DataValueField = "ProgramID";
            lstProgram.DataBind();
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
            return;
        }
    }
コード例 #14
0
    public void InsertProgram()
    {
        BLLProgram objbll = new BLLProgram();

        objbll.Program_id   = txtprogramid.Text;
        objbll.Program_name = txtprogramname.Text;
        objbll.Credit_hours = txtcredithours.Text;
        objbll.Createdby    = user;
        objbll.Modifiedby   = user;
        int a = objbll.InsertProgram(objbll);

        if (a == 1)
        {
            lblresult.Text  = "Program Save Successfully....";
            BtnSave.Enabled = false;
            BtnNew.Enabled  = true;
        }
    }
コード例 #15
0
    public List <BLLProgram> SelectProgrambyid(BLLProgram objbll)
    {
        DALProgram objdal = new DALProgram();

        return(objdal.SelectProgrambyid(objbll));
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        List <ATTProgram> ProgramLST = (List <ATTProgram>)Session["Programs"];


        ATTProgram objProgram = new ATTProgram(
            int.Parse(Session["OrgID"].ToString()),
            (this.lstProgram.SelectedIndex != -1) ? ProgramLST[lstProgram.SelectedIndex].ProgramID : 0,
            this.txtProgramName_RQD.Text,
            int.Parse(this.ddlProgramType.SelectedValue),
            this.txtPrgDescription.Text,
            (this.chkActive.Checked == true) ? "Y" : "N",
            this.txtLaunchDate_REQD.Text,
            this.txtduration.Text,
            int.Parse(this.ddlDurationType.SelectedValue),
            "",
            this.txtLocation.Text,
            (this.lstProgram.SelectedIndex != -1) ? "E" : "A"
            );
        ObjectValidation OV = BLLProgram.Validate(objProgram);

        if (OV.IsValid == false)
        {
            this.lblStatusMessage.Text = OV.ErrorMessage;
            this.programmaticModalPopup.Show();
            return;
        }



        //PREPARES COORDINATORS TO BE SAVED
        foreach (GridViewRow gvRow in grdProgramCoordinator.Rows)
        {
            if (CheckNull.NullString(gvRow.Cells[6].Text) != "")
            {
                ATTProgramCoordinator objPrgCoordinator = new ATTProgramCoordinator
                                                          (
                    int.Parse(Session["OrgID"].ToString()),
                    0,
                    int.Parse(gvRow.Cells[1].Text),
                    gvRow.Cells[3].Text,
                    double.Parse(gvRow.Cells[2].Text),
                    int.Parse(gvRow.Cells[4].Text),
                    gvRow.Cells[5].Text,
                    gvRow.Cells[6].Text
                                                          );
                objProgram.PrgCoordinatorLST.Add(objPrgCoordinator);
            }
        }

        //PREPARES SPONSORS TO BE SAVED

        foreach (GridViewRow gvRow in grdSponsor.Rows)
        {
            if (CheckNull.NullString(gvRow.Cells[5].Text) != "")
            {
                ATTProgramSponsor objPrgSponsor = new ATTProgramSponsor
                                                  (
                    int.Parse(Session["OrgID"].ToString()),
                    0, int.Parse(gvRow.Cells[0].Text),
                    CheckNull.NullString(gvRow.Cells[4].Text),
                    CheckNull.NulldblValue(gvRow.Cells[2].Text),
                    CheckNull.NullString(gvRow.Cells[3].Text),
                    "",
                    gvRow.Cells[5].Text
                                                  );

                objPrgSponsor.SponsorOBJ.SponsorName = gvRow.Cells[1].Text;
                objProgram.PrgSponsorLST.Add(objPrgSponsor);
            }
        }


        //PREPARES SESSIONS TO BE SAVED

        foreach (GridViewRow gvRow in grdSession.Rows)
        {
            if (CheckNull.NullString(gvRow.Cells[4].Text) != "")
            {
                objProgram.SessionLST.Add(new ATTSession
                                          (
                                              int.Parse(Session["OrgID"].ToString()),
                                              0,
                                              CheckNull.NullintValue(gvRow.Cells[0].Text),
                                              gvRow.Cells[1].Text,
                                              CheckNull.NullString(gvRow.Cells[2].Text),
                                              CheckNull.NullString(gvRow.Cells[3].Text),
                                              CheckNull.NullString(gvRow.Cells[2].Text),
                                              gvRow.Cells[4].Text
                                          ));
            }
        }

        //PREPARES COURSES TO BE SAVED

        foreach (GridViewRow gvRow in grdCourses.Rows)
        {
            if (CheckNull.NullString(gvRow.Cells[4].Text) != "")
            {
                objProgram.CourseLST.Add(new ATTCourse
                                         (
                                             int.Parse(Session["OrgID"].ToString()), 0,
                                             CheckNull.NullintValue(gvRow.Cells[0].Text),
                                             gvRow.Cells[1].Text,
                                             CheckNull.NullString(gvRow.Cells[2].Text),
                                             gvRow.Cells[3].Text,
                                             gvRow.Cells[4].Text
                                         ));
            }
        }


        BLLProgram.AddProgram(objProgram);
        if (lstProgram.SelectedIndex == -1)
        {
            ProgramLST.Add(objProgram);
        }
        else
        {
            //EDITS THE PROGRAM
            ProgramLST[lstProgram.SelectedIndex].ProgramName    = this.txtProgramName_RQD.Text;
            ProgramLST[lstProgram.SelectedIndex].ProgramTypeID  = int.Parse(this.ddlProgramType.SelectedValue);
            ProgramLST[lstProgram.SelectedIndex].Active         = (this.chkActive.Checked == true) ? "Y" : "N";
            ProgramLST[lstProgram.SelectedIndex].Description    = this.txtPrgDescription.Text;
            ProgramLST[lstProgram.SelectedIndex].LaunchDate     = this.txtLaunchDate_REQD.Text;
            ProgramLST[lstProgram.SelectedIndex].Duration       = this.txtduration.Text;
            ProgramLST[lstProgram.SelectedIndex].DurationTypeID = int.Parse(this.ddlDurationType.SelectedValue);
            ProgramLST[lstProgram.SelectedIndex].Location       = this.txtLocation.Text;


            //EDITS THE PROGRAM COORDINATOR LIST
            ProgramLST[lstProgram.SelectedIndex].PrgCoordinatorLST.Clear();
            foreach (GridViewRow gvRow in this.grdProgramCoordinator.Rows)
            {
                if (CheckNull.NullString(gvRow.Cells[6].Text) == "")
                {
                    ATTProgramCoordinator objPrgCoordinator = new ATTProgramCoordinator
                                                              (
                        int.Parse(Session["OrgID"].ToString()),
                        int.Parse(lstProgram.SelectedValue),
                        int.Parse(gvRow.Cells[1].Text),
                        gvRow.Cells[3].Text,
                        double.Parse(gvRow.Cells[2].Text),
                        int.Parse(gvRow.Cells[4].Text),
                        gvRow.Cells[5].Text,
                        ""
                                                              );
                    ProgramLST[lstProgram.SelectedIndex].PrgCoordinatorLST.Add(objPrgCoordinator);
                }
            }

            foreach (ATTProgramCoordinator obj in objProgram.PrgCoordinatorLST)
            {
                ProgramLST[lstProgram.SelectedIndex].PrgCoordinatorLST.Add(obj);
            }

            //EDITS THE SPONSOR LiST
            ProgramLST[lstProgram.SelectedIndex].PrgSponsorLST.Clear();
            foreach (GridViewRow gvRow in this.grdSponsor.Rows)
            {
                ATTProgramSponsor obj;
                if (gvRow.Cells[5].Text != "D")
                {
                    obj = new ATTProgramSponsor(
                        int.Parse(Session["OrgID"].ToString()),
                        0, int.Parse(gvRow.Cells[0].Text),
                        CheckNull.NullString(gvRow.Cells[4].Text),
                        CheckNull.NulldblValue(gvRow.Cells[2].Text),
                        CheckNull.NullString(gvRow.Cells[3].Text),
                        "",
                        ""
                        );
                    obj.SponsorOBJ.SponsorName = gvRow.Cells[1].Text;
                    ProgramLST[lstProgram.SelectedIndex].PrgSponsorLST.Add(obj);
                }
            }

            //EDITS THE SESSION LIST
            ProgramLST[lstProgram.SelectedIndex].SessionLST.Clear();
            foreach (GridViewRow gvRow in this.grdSession.Rows)
            {
                if (CheckNull.NullString(gvRow.Cells[4].Text) == "")
                {
                    ProgramLST[lstProgram.SelectedIndex].SessionLST.Add(new ATTSession
                                                                        (
                                                                            int.Parse(Session["OrgID"].ToString()),
                                                                            0,
                                                                            CheckNull.NullintValue(gvRow.Cells[0].Text),
                                                                            gvRow.Cells[1].Text,
                                                                            CheckNull.NullString(gvRow.Cells[2].Text),
                                                                            CheckNull.NullString(gvRow.Cells[3].Text),
                                                                            CheckNull.NullString(gvRow.Cells[2].Text),
                                                                            ""
                                                                        ));
                }
            }
            foreach (ATTSession obj in objProgram.SessionLST)
            {
                ProgramLST[lstProgram.SelectedIndex].SessionLST.Add(obj);
            }


            //EDITS COURSE LIST
            ProgramLST[lstProgram.SelectedIndex].CourseLST.Clear();
            foreach (GridViewRow gvRow in grdCourses.Rows)
            {
                if (CheckNull.NullString(gvRow.Cells[4].Text) == "")
                {
                    ProgramLST[lstProgram.SelectedIndex].CourseLST.Add(new ATTCourse
                                                                       (
                                                                           int.Parse(Session["OrgID"].ToString()), 0,
                                                                           CheckNull.NullintValue(gvRow.Cells[0].Text),
                                                                           gvRow.Cells[1].Text,
                                                                           CheckNull.NullString(gvRow.Cells[2].Text),
                                                                           gvRow.Cells[3].Text,
                                                                           ""
                                                                       ));
                }
            }
            foreach (ATTCourse obj in objProgram.CourseLST)
            {
                ProgramLST[lstProgram.SelectedIndex].CourseLST.Add(obj);
            }
        }
        //END IF


        this.lstProgram.DataSource     = ProgramLST;
        this.lstProgram.DataValueField = "ProgramID";
        this.lstProgram.DataTextField  = "ProgramName";
        this.DataBind();

        clearAll(1);
    }
コード例 #17
0
    public int InsertProgram(BLLProgram objbll)
    {
        DALProgram objdal = new DALProgram();

        return(objdal.InsertProgram(objbll));
    }
コード例 #18
0
    public int UpdateProgram(BLLProgram objbll)
    {
        DALProgram objdal = new DALProgram();

        return(objdal.UpdateProgram(objbll));
    }
コード例 #19
0
    public int DeleteProgram(BLLProgram objbll)
    {
        DALProgram objdal = new DALProgram();

        return(objdal.DeleteProgram(objbll));
    }