Ejemplo n.º 1
0
    protected void btnupload_Click(object sender, EventArgs e)
    {
        for (int i = 0; i < dgassignment.Rows.Count - 1; i++)
        {
            FileUpload FileUpload1 = ((FileUpload)(dgassignment.Rows[i].Cells[1].FindControl("flu")));
            if (FileUpload1.HasFile)
            {
                string fileName  = FileUpload1.PostedFile.FileName;
                string extension = System.IO.Path.GetExtension(fileName);
                if (extension == ".pdf" || extension == ".doc" || extension == ".docx")
                {
                    BLLAssignment objbll = new BLLAssignment();
                    objbll.Rollno       = user;
                    objbll.Name         = lblAdmin_USername.Text;
                    objbll.Course_code  = txtcoursecode.Text;
                    objbll.Course_title = txtcoursetitle.Text;
                    objbll.Title        = "Assignment";
                    //objbll.Total_marks = txtlesson.Text;
                    objbll.Assignment_path = ("SolutionAssignment/" + fileName);

                    FileUpload1.PostedFile.SaveAs(Server.MapPath("SolutionAssignment/") + fileName);
                    int a = objbll.InsertAssignmentSolution(objbll);
                    if (a == 1)
                    {
                        ASPxPopupControl1.ShowOnPageLoad = true;
                    }
                }
                else
                {
                    //lblresult.Text = "Choose Pdf or Doc file...";
                }
            }
        }
    }
 public void InsertAssignment()
 {
     if (FileUpload1.HasFile)
     {
         string fileName  = FileUpload1.PostedFile.FileName;
         string extension = System.IO.Path.GetExtension(fileName);
         if (extension == ".pdf" || extension == ".doc" || extension == ".docx")
         {
             BLLAssignment objbll = new BLLAssignment();
             objbll.Course_code     = txtcoursecode.Text;
             objbll.Course_title    = txtcoursetitle.Text;
             objbll.Title           = txttopic.Text;
             objbll.Lesson          = txtlesson.Text;
             objbll.Assignment_name = fileName;
             objbll.Assignment_path = ("Assignments/" + fileName);
             objbll.Total_marks     = txttotalmarks.Text;
             objbll.Due_date        = Convert.ToDateTime(dtduedate.Text);
             objbll.Createdby       = user;
             objbll.Modifiedby      = user;
             FileUpload1.PostedFile.SaveAs(Server.MapPath("Assignments/") + fileName);
             int a = objbll.InsertAssignment(objbll);
             if (a == 1)
             {
                 lblresult.Text  = "Assignment upload Successfully";
                 BtnSave.Enabled = false;
                 BtnNew.Enabled  = true;
             }
         }
         else
         {
             lblresult.Text = "Choose Pdf or Doc file...";
         }
     }
 }
Ejemplo n.º 3
0
    public void LoadGrid()
    {
        BLLAssignment objbll = new BLLAssignment();

        objbll.Course_code  = txtcoursecode.Text;
        objbll.Course_title = txtcoursetitle.Text;
        List <BLLAssignment> objlist = new List <BLLAssignment>();

        objlist = objbll.SelectAssignment(objbll);
        if (objlist.Count > 0)
        {
            dgassignment.DataSource = objlist;
            dgassignment.DataBind();

            for (int i = 0; i <= dgassignment.Rows.Count - 1; i++)
            {
                DateTime currentdate = System.DateTime.Now;
                DateTime duedate     = objlist[i].Due_date;

                int a = DateTime.Compare(currentdate, duedate);
                if (a == 1)
                {
                    dgassignment.Rows[i].Cells[1].Enabled = false;
                }
                else
                {
                    dgassignment.Rows[i].Cells[1].Enabled = true;
                }
            }
        }
    }
    public List <BLLAssignment> SelectAssignment(BLLAssignment objbll)
    {
        List <BLLAssignment> objlist = new List <BLLAssignment>();

        SqlParameter[] param = new SqlParameter[2];

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

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

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectByMultimoreprogram("sp_selectassignment", param);
        while (dr.Read())
        {
            objbll                 = new BLLAssignment();
            objbll.Title           = dr["title"].ToString();
            objbll.Lesson          = dr["lesson"].ToString();
            objbll.Assignment_name = dr["assignment_name"].ToString();
            objbll.Assignment_path = dr["assignment_path"].ToString();
            objbll.Total_marks     = dr["total_marks"].ToString();
            objbll.Due_date        = Convert.ToDateTime(dr["due_date"].ToString());
            objbll.Insert_date     = Convert.ToDateTime(dr["insert_date"].ToString());
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
    public List <BLLAssignment> SelectAssignmentSolution(BLLAssignment objbll)
    {
        List <BLLAssignment> objlist = new List <BLLAssignment>();

        SqlParameter[] param = new SqlParameter[1];

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

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectByMultimoreprogram("sp_selectassignmentsolution", param);
        while (dr.Read())
        {
            objbll                 = new BLLAssignment();
            objbll.Id              = Convert.ToInt32(dr["id"].ToString());
            objbll.Rollno          = dr["rollno"].ToString();
            objbll.Name            = dr["name"].ToString();
            objbll.Course_code     = dr["course_code"].ToString();
            objbll.Course_title    = dr["course_title"].ToString();
            objbll.Title           = dr["topic"].ToString();
            objbll.Assignment_path = dr["assignment_path"].ToString();
            objbll.Insert_date     = Convert.ToDateTime(dr["insert_date"].ToString());
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
    public void LoadAssignments()
    {
        BLLAssignment objbll = new BLLAssignment();

        objbll.Course_code = cbcourses.SelectedItem.Value.ToString();
        List <BLLAssignment> objlist = new List <BLLAssignment>();

        objlist = objbll.SelectAssignmentSolution(objbll);
        if (objlist.Count > 0)
        {
            dgassignment.DataSource = objlist;
            dgassignment.DataBind();
        }
    }
    public int InsertAssignment(BLLAssignment objbll)
    {
        SqlParameter[] param = new SqlParameter[13];

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

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

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

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

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

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

        param[6]       = new SqlParameter("@total_marks", SqlDbType.NVarChar);
        param[6].Value = objbll.Total_marks;

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

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

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

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

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

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

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

        objcon.CloseConnection();
        return(a);
    }
Ejemplo n.º 8
0
    public void LoadGrid()
    {
        BLLAssignment objbll = new BLLAssignment();

        objbll.Course_code  = txtcoursecode.Text;
        objbll.Course_title = txtcoursetitle.Text;
        List <BLLAssignment> objlist = new List <BLLAssignment>();

        objlist = objbll.SelectAssignment(objbll);
        if (objlist.Count > 0)
        {
            dgassignment.DataSource = objlist;
            dgassignment.DataBind();
        }
    }
    public void LoadAssignmentName()
    {
        BLLAssignment objbll = new BLLAssignment();

        objbll.Course_code = cbcourses.SelectedItem.ToString();
        List <BLLAssignment> objlist = new List <BLLAssignment>();

        objlist = objbll.SelectAssignmentNamebycode(objbll);
        if (objlist.Count > 0)
        {
            cbname.DataSource = objlist;
            cbname.ValueField = "title";
            cbname.TextField  = "title";
            cbname.DataBind();
        }
    }
Ejemplo n.º 10
0
    public List <BLLAssignment> SelectAssignmentNamebycode(BLLAssignment objbll)
    {
        List <BLLAssignment> objlist = new List <BLLAssignment>();

        SqlParameter[] param = new SqlParameter[1];

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

        SqlDataReader dr;

        objcon.OpenConnection();
        dr = objcon.sqlcmdSelectByMultimoreprogram("sp_selectassignmentnamebycode", param);
        while (dr.Read())
        {
            objbll       = new BLLAssignment();
            objbll.Title = dr["title"].ToString();
            objlist.Add(objbll);
        }
        objcon.CloseConnection();
        return(objlist);
    }
Ejemplo n.º 11
0
    public int InsertAssignmentSolution(BLLAssignment objbll)
    {
        SqlParameter[] param = new SqlParameter[9];

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

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

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

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

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

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

        param[6]       = new SqlParameter("@assignment_path", SqlDbType.NVarChar);
        param[6].Value = objbll.Assignment_path;

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

        param[8]       = new SqlParameter("@status", SqlDbType.Bit);
        param[8].Value = "False";

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

        objcon.CloseConnection();
        return(a);
    }
Ejemplo n.º 12
0
    public List <BLLAssignment> SelectAssignmentSolution(BLLAssignment objbll)
    {
        DALAssignment objdal = new DALAssignment();

        return(objdal.SelectAssignmentSolution(objbll));
    }
Ejemplo n.º 13
0
    public List <BLLAssignment> SelectAssignmentNamebycode(BLLAssignment objbll)
    {
        DALAssignment objdal = new DALAssignment();

        return(objdal.SelectAssignmentNamebycode(objbll));
    }
Ejemplo n.º 14
0
    public int InsertAssignmentSolution(BLLAssignment objbll)
    {
        DALAssignment objdal = new DALAssignment();

        return(objdal.InsertAssignmentSolution(objbll));
    }