Beispiel #1
0
        private void FatchStudent()
        {
            try
            {
                EWA_UploadResult objEWA = new EWA_UploadResult();
                BL_UploadResult  objBL  = new BL_UploadResult();
                objEWA.OrgId    = Session["OrgId"].ToString();
                objEWA.UserCode = Session["UserCode"].ToString();

                DataSet ds = objBL.FatchStudent_BL(objEWA);


                if (ds.Tables[0].Rows.Count != 0)
                {
                    lblName.Text   = ds.Tables[0].Rows[0][1].ToString();
                    lblCourse.Text = ds.Tables[0].Rows[0][2].ToString();
                    lblBranch.Text = ds.Tables[0].Rows[0][3].ToString();
                    lblClass.Text  = ds.Tables[0].Rows[0][4].ToString();
                    CourseId       = Convert.ToInt32(ds.Tables[0].Rows[0][5].ToString());
                    BranchId       = Convert.ToInt32(ds.Tables[0].Rows[0][6].ToString());
                    ClassId        = Convert.ToInt32(ds.Tables[0].Rows[0][7].ToString());
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Beispiel #2
0
        public int InsertUploadMark(EWA_UploadResult objEWA1)
        {
            BL_UploadResult objBL = new BL_UploadResult();
            int             rs    = objBL.InsertUploadMark_BL(objEWA1);

            return(rs);
        }
        public int InsertUploadMark_DL(EWA_UploadResult objEWA)
        {
            int flag = 0;

            try
            {
                con.Open();

                SqlCommand cmd = new SqlCommand("SP_UploadResult", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue(@"Action", objEWA.Action);
                cmd.Parameters.AddWithValue(@"ResultId", objEWA.ResultId);
                cmd.Parameters.AddWithValue(@"SubjectId", objEWA.SubjectId);
                cmd.Parameters.AddWithValue(@"Mark", objEWA.Mark);
                cmd.Parameters.AddWithValue(@"OutofMark", objEWA.Outofmark);

                flag = cmd.ExecuteNonQuery();

                return(flag);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                con.Close();
            }
        }
Beispiel #4
0
        private void FatchTest()
        {
            try
            {
                EWA_UploadResult objEWA = new EWA_UploadResult();
                BL_UploadResult  objBL  = new BL_UploadResult();
                objEWA.OrgId      = Session["OrgId"].ToString();
                objEWA.CourseId   = CourseId.ToString();
                objEWA.BranchId   = BranchId.ToString();
                objEWA.ClassId    = ClassId.ToString();
                objEWA.SemesterId = ddlSemester.SelectedValue.ToString();

                DataSet ds = objBL.FatchTest_BL(objEWA);

                ddlTest.DataSource = ds;
                if (ds.Tables[0].Rows.Count != 0)
                {
                    ddlTest.DataTextField  = "TestName";
                    ddlTest.DataValueField = "TestId";
                    ddlTest.DataBind();
                }
                else
                {
                    ddlTest.Items.Clear();
                }

                ddlTest.Items.Insert(0, new System.Web.UI.WebControls.ListItem("Select", "0"));
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
        public DataSet FatchResultPDF_DL1(EWA_UploadResult ObjEWA)
        {
            DataSet ds = new DataSet();

            try
            {
                prmList     = new string[12];
                prmList[0]  = "@Action";
                prmList[1]  = ObjEWA.Action;
                prmList[2]  = "@OrgId";
                prmList[3]  = ObjEWA.OrgId;
                prmList[4]  = "@CourseId";
                prmList[5]  = ObjEWA.CourseId;
                prmList[6]  = "@BranchId";
                prmList[7]  = ObjEWA.BranchId;
                prmList[8]  = "@ClassId";
                prmList[9]  = ObjEWA.ClassId;
                prmList[10] = "@AcademinYear";
                prmList[11] = ObjEWA.AcademinYear;

                ds = ObjHelper.FillControl(prmList, "SP_UploadResult");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    return(ds);
                }
                return(ds);
            }
            catch (Exception exp)
            {
                throw exp;
            }
        }
        public int InsertUploadResult_DL(EWA_UploadResult objEWA)
        {
            int flag = 0;

            try
            {
                con.Open();
                SqlCommand cmd = new SqlCommand("SP_UploadResult", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue(@"Action", objEWA.Action);
                cmd.Parameters.AddWithValue(@"TestId", objEWA.TestId);
                cmd.Parameters.AddWithValue(@"UserCode", objEWA.UserCode);
                cmd.Parameters.AddWithValue(@"Result", objEWA.Result);

                flag = cmd.ExecuteNonQuery();

                return(flag);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                con.Close();
            }
        }
        public int InsertUploadTest_DL(EWA_UploadResult objEWA)
        {
            int flag = 0;

            try
            {
                con.Open();
                SqlCommand cmd = new SqlCommand("SP_UploadResult", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue(@"Action", objEWA.Action);
                cmd.Parameters.AddWithValue(@"TestName", objEWA.TestName);
                cmd.Parameters.AddWithValue(@"CourseId", objEWA.CourseId);
                cmd.Parameters.AddWithValue(@"BranchId", objEWA.BranchId);
                cmd.Parameters.AddWithValue(@"ClassId", objEWA.ClassId);
                cmd.Parameters.AddWithValue(@"SemesterId", objEWA.SemesterId);
                cmd.Parameters.AddWithValue(@"OrgId", objEWA.OrgId);
                cmd.Parameters.AddWithValue(@"TotalMark", objEWA.TotalMark);
                cmd.Parameters.AddWithValue(@"Status", objEWA.Status);

                flag = cmd.ExecuteNonQuery();

                return(flag);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                con.Close();
            }
        }
Beispiel #8
0
        //lnkBtnDelete_Click
        #region lnkBtnDelete_Click

        protected void lnkBtnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                lock (this)
                {
                    LinkButton  lnkBtnId = (LinkButton)sender;
                    GridViewRow grdrow   = lnkBtnId.NamingContainer as GridViewRow;
                    ViewState["TestId"] = grdResults.DataKeys[grdrow.RowIndex].Values["TestId"].ToString();

                    BL_UploadResult  objBL  = new BL_UploadResult();
                    EWA_UploadResult objEWA = new EWA_UploadResult();

                    objEWA.Action = "DeleteResultPDF";
                    objEWA.TestId = ViewState["TestId"].ToString();

                    int flag = objBL.DeleteUploadResultPDF_BL(objEWA);

                    msgBox.ShowMessage("Delete Successfully !!!", "Delete", UserControls.MessageBox.MessageStyle.Successfull);
                    BindGrdResult();
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
        // Fatch Result
        #region [Fatch Result]

        public DataSet FatchResult_DL(EWA_UploadResult ObjEWA)
        {
            DataSet ds = new DataSet();

            try
            {
                prmList    = new string[6];
                prmList[0] = "@Action";
                prmList[1] = "FetchResult";
                prmList[2] = "@TestId";
                prmList[3] = ObjEWA.TestId;
                prmList[4] = "@UserCode";
                prmList[5] = ObjEWA.UserCode;


                ds = ObjHelper.FillControl(prmList, "SP_UploadResult");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    return(ds);
                }
                return(ds);
            }
            catch (Exception exp)
            {
                throw exp;
            }
        }
Beispiel #10
0
        protected void btnUpload_Click(object sender, EventArgs e)
        {
            try
            {
                string fileEXT = Path.GetExtension(FileUpload1.FileName);
                if (fileEXT.CompareTo(".pdf") == 0 || fileEXT.CompareTo(".PDF") == 0)
                {
                    BL_UploadResult  objBL  = new BL_UploadResult();
                    EWA_UploadResult objEWA = new EWA_UploadResult();

                    objEWA.Action       = "UploadResultPDF";
                    objEWA.TestName     = txtTestName.Text;
                    objEWA.OrgId        = Session["OrgId"].ToString();
                    objEWA.CourseId     = ddlCourse.SelectedValue.ToString();
                    objEWA.BranchId     = ddlBranch.SelectedValue.ToString();
                    objEWA.ClassId      = ddlClass.SelectedValue.ToString();
                    objEWA.AcademinYear = ddlAcademicyear.SelectedValue.ToString();
                    int fileLengthInKB = 0;
                    if (FileUpload1.HasFile)
                    {
                        int length = FileUpload1.PostedFile.ContentLength;
                        objEWA.UploadedFile = new byte[length];
                        objEWA.FileName     = FileUpload1.PostedFile.FileName.ToString();
                        objEWA.ContentType  = FileUpload1.PostedFile.ContentType;
                        fileLengthInKB      = FileUpload1.PostedFile.ContentLength / 1024;
                        HttpPostedFile file = FileUpload1.PostedFile;
                        file.InputStream.Read(objEWA.UploadedFile, 0, length);
                    }

                    if (fileLengthInKB > 1024)
                    {
                        msgBox.ShowMessage("Document should be less than or equal to 1MB !!!", "Information", UserControls.MessageBox.MessageStyle.Successfull);
                    }
                    else
                    {
                        int flag = objBL.InsertUploadResultPDF_BL(objEWA);

                        msgBox.ShowMessage("Result PDF Upload Successfully !!!", "Saved", UserControls.MessageBox.MessageStyle.Successfull);
                        clear();
                        BindGrdResult();
                    }
                }
                else
                {
                    msgBox.ShowMessage("Please choose .pdf file only.", "Information", CMS.UserControls.MessageBox.MessageStyle.Information);
                }
            }
            catch (Exception ex)
            {
                msgBox.ShowMessage("Unable to Save !!!", "Saved", UserControls.MessageBox.MessageStyle.Successfull);
            }
        }
Beispiel #11
0
        // Fatch Test
        #region [Fatch Test]

        public DataSet FatchTest_BL(EWA_UploadResult objEWA)
        {
            try
            {
                DL_UploadResult objDL = new DL_UploadResult();
                DataSet         ds    = objDL.FatchTest_DL(objEWA);
                return(ds);
            }
            catch (Exception exp)
            {
                throw exp;
            }
        }
Beispiel #12
0
 public int InsertUploadMark_BL(EWA_UploadResult objEWA)
 {
     try
     {
         DL_UploadResult objDL = new DL_UploadResult();
         int             rs    = objDL.InsertUploadMark_DL(objEWA);
         return(rs);
     }
     catch (Exception exp)
     {
         throw exp;
     }
 }
Beispiel #13
0
 public int DeleteUploadResultPDF_BL(EWA_UploadResult objEWA)
 {
     try
     {
         DL_UploadResult objDL = new DL_UploadResult();
         int             rs    = objDL.DeleteUploadResultPDF_DL(objEWA);
         return(rs);
     }
     catch (Exception exp)
     {
         throw exp;
     }
 }
        public int InsertUploadResultPDF_DL(EWA_UploadResult objEWA)
        {
            DataSet dss  = new DataSet();
            int     flag = 0;

            try
            {
                con.Open();
                SqlCommand cmd = new SqlCommand("SP_UploadResult", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue(@"Action", objEWA.Action);
                cmd.Parameters.AddWithValue(@"TestName", objEWA.TestName);
                cmd.Parameters.AddWithValue(@"OrgId", objEWA.OrgId);
                cmd.Parameters.AddWithValue(@"CourseId", objEWA.CourseId);
                cmd.Parameters.AddWithValue(@"BranchId", objEWA.BranchId);
                cmd.Parameters.AddWithValue(@"ClassId", objEWA.ClassId);
                cmd.Parameters.AddWithValue(@"AcademinYear", objEWA.AcademinYear);
                cmd.Parameters.AddWithValue(@"FileName", objEWA.FileName);
                cmd.Parameters.AddWithValue(@"ContentType", objEWA.ContentType);
                cmd.Parameters.AddWithValue(@"UploadedFile", objEWA.UploadedFile);

                SqlDataAdapter ad = new SqlDataAdapter(cmd);
                ad.Fill(dss);
                con.Close();

                if (dss.Tables[0].Rows.Count > 0)
                {
                    int i = 0;
                    while (dss.Tables[0].Rows.Count > i)
                    {
                        if (dss.Tables[0].Rows[i]["TokenId"].ToString() != "" && dss.Tables[0].Rows[i]["TokenId"].ToString() != "null" && dss.Tables[1].Rows[0]["SenderId"].ToString() != "")
                        {
                            SendPushNotification(dss.Tables[0].Rows[i]["TokenId"].ToString(), dss.Tables[0].Rows[i]["Subject"].ToString(), dss.Tables[0].Rows[i]["OrgName"].ToString(), dss.Tables[1].Rows[0]["SenderId"].ToString(), dss.Tables[1].Rows[0]["AppKey"].ToString());
                        }
                        i++;
                    }
                }

                return(1);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                con.Close();
            }
        }
Beispiel #15
0
        private void BindGrdResult()
        {
            try
            {
                BL_UploadResult  objBL  = new BL_UploadResult();
                EWA_UploadResult objEWA = new EWA_UploadResult();
                objEWA.Action   = "FatchResultPDF";
                objEWA.OrgId    = Session["OrgId"].ToString();
                objEWA.CourseId = ddlCourse.SelectedValue.ToString();
                objEWA.BranchId = ddlBranch.SelectedValue.ToString();
                objEWA.ClassId  = ddlClass.SelectedValue.ToString();
                DataSet ds = objBL.FatchResultPDF_BL(objEWA);

                grdResults.DataSource = ds;
                grdResults.DataBind();
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
        private void BindGrdResult()
        {
            try
            {
                BL_UploadResult  objBL  = new BL_UploadResult();
                EWA_UploadResult objEWA = new EWA_UploadResult();
                objEWA.Action   = "FatchResultPDF";
                objEWA.OrgId    = Session["OrgId"].ToString();
                objEWA.CourseId = Session["CourseId"].ToString();
                objEWA.BranchId = Session["BranchId"].ToString();
                objEWA.ClassId  = Session["ClassId"].ToString();

                DataSet ds = objBL.FatchResultPDF_BL(objEWA);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    lblNodata.Visible  = false;
                    grdResults.Visible = true;

                    grdResults.DataSource = ds;
                    grdResults.DataBind();
                }
                else
                {
                    DataTable dt = new DataTable();
                    grdResults.DataSource = dt;
                    grdResults.DataBind();
                    lblNodata.Visible = true;
                    //grdResults.Visible = false;
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
        private void FatchCourseBranchClass()
        {
            try
            {
                EWA_UploadResult objEWA = new EWA_UploadResult();
                BL_UploadResult  objBL  = new BL_UploadResult();
                objEWA.OrgId    = Session["OrgId"].ToString();
                objEWA.UserCode = Session["UserCode"].ToString();

                DataSet ds = objBL.FatchStudent_BL(objEWA);


                if (ds.Tables[0].Rows.Count != 0)
                {
                    Session["CourseId"] = Convert.ToInt32(ds.Tables[0].Rows[0][5].ToString());
                    Session["BranchId"] = Convert.ToInt32(ds.Tables[0].Rows[0][6].ToString());
                    Session["ClassId"]  = Convert.ToInt32(ds.Tables[0].Rows[0][7].ToString());
                }
            }
            catch (Exception exp)
            {
                // GeneralErr(exp.Message.ToString());
            }
        }
Beispiel #18
0
        private void FatchResult()
        {
            try
            {
                EWA_UploadResult objEWA = new EWA_UploadResult();
                BL_UploadResult  objBL  = new BL_UploadResult();
                objEWA.TestId   = ddlTest.SelectedValue.ToString();
                objEWA.UserCode = Session["UserCode"].ToString();

                DataSet ds = objBL.FatchResult_BL(objEWA);


                if (ds.Tables[0].Rows.Count != 0)
                {
                    lblSemester.Text = ddlSemester.SelectedItem.ToString();
                    //GridView1.DataSource = ds.Tables[0];
                    //GridView1.DataBind();
                    DataTable dt = new DataTable();
                    dt.Columns.Add("Subject");
                    dt.Columns.Add("Out Of Marks");
                    dt.Columns.Add("Obtain Marks");


                    DataRow dr;

                    int i = 0, totalobtain = 0, totaloutof = 0, rs = 0;
                    while (ds.Tables[0].Rows.Count > i)
                    {
                        dr    = dt.NewRow();
                        dr[0] = ds.Tables[0].Rows[i][0].ToString();
                        dr[1] = ds.Tables[0].Rows[i][2].ToString();
                        dr[2] = ds.Tables[0].Rows[i][1].ToString();

                        totalobtain = totalobtain + Convert.ToInt32(ds.Tables[0].Rows[i][1].ToString());
                        totaloutof  = totaloutof + Convert.ToInt32(ds.Tables[0].Rows[i][2].ToString());

                        if ((ds.Tables[0].Rows[i][3].ToString()).ToUpper() != "PASS")
                        {
                            rs = 1;
                        }
                        i++;
                        dt.Rows.Add(dr);
                    }

                    dr    = dt.NewRow();
                    dr[0] = "TOTAL";
                    dr[1] = totaloutof;
                    dr[2] = totalobtain;
                    dt.Rows.Add(dr);

                    GridView1.DataSource = dt;
                    GridView1.DataBind();

                    float per = (totalobtain * 100) / totaloutof;
                    lblPersentage.Text = per.ToString() + " %";

                    if (rs == 0)
                    {
                        lblResult.Text = "PASS";
                    }
                    else
                    {
                        lblResult.Text = "FAILED";
                    }

                    GridView1.Rows[GridView1.Rows.Count - 1].Font.Bold = true;
                    i = 0;
                    while (GridView1.Rows.Count > i)
                    {
                        GridView1.Rows[i].Cells[1].HorizontalAlign = HorizontalAlign.Center;
                        GridView1.Rows[i].Cells[2].HorizontalAlign = HorizontalAlign.Center;
                        i++;
                    }

                    Panel2.Visible = true;
                }
                else
                {
                    GeneralErr("Record Not Found...!");
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Beispiel #19
0
        public void BindUploadResult()
        {
            try
            {
                database         db      = new database();
                EWA_UploadResult objEWA1 = new EWA_UploadResult();
                EWA_Common       objEWA  = new EWA_Common();
                BL_Common        objBL   = new BL_Common();
                objEWA.OrgId    = Session["OrgId"].ToString();
                objEWA.BranchId = ddlBranch.SelectedValue.ToString();
                objEWA.CourseId = ddlCourse.SelectedValue.ToString();
                objEWA.ClassId  = ddlClass.SelectedValue.ToString();
                //objEWA.SemesterId = ddlSemester.SelectedValue.ToString();

                DataSet ds = objBL.BindResultFormat_BL(objEWA);


                int row = 0, rs = 0;
                if (grdResultFormat.Rows.Count > row && ds.Tables[0].Rows.Count > 0)
                {
                    EWA_UploadResult objEWA2 = new EWA_UploadResult();

                    objEWA2.Action     = "InsertUploadTest";
                    objEWA2.TestName   = txtTestName.Text;
                    objEWA2.TotalMark  = txtTotalMarks.Text;
                    objEWA2.OrgId      = Session["OrgId"].ToString();
                    objEWA2.BranchId   = ddlBranch.SelectedValue.ToString();
                    objEWA2.CourseId   = ddlCourse.SelectedValue.ToString();
                    objEWA2.ClassId    = ddlClass.SelectedValue.ToString();
                    objEWA2.SemesterId = null;
                    objEWA2.Status     = "1";

                    rs = InsertUploadTest(objEWA2);
                }
                else
                {
                    GeneralErr("Record Not Found...!");
                }

                while (grdResultFormat.Rows.Count > row && ds.Tables[1].Rows.Count > row)
                {
                    int countColumn          = grdResultFormat.Rows[0].Cells.Count;
                    EWA_UploadResult objEWA3 = new EWA_UploadResult();
                    objEWA3.Action   = "InsertUploadResult";
                    objEWA3.TestId   = db.getDbstatus_Value("SELECT MAX(TestId) FROM tblUploadTest");
                    objEWA3.UserCode = grdResultFormat.Rows[row].Cells[0].Text;
                    //  TextBox txtResult = (TextBox)grdResultFormat.Rows[row].Cells[countColumn - 1].FindControl("txt" + (countColumn - 1));


                    TextBox txtResult = (TextBox)grdResultFormat.Rows[row].FindControl("Textresult");
                    if (txtResult.Text == "")
                    {
                        objEWA3.Result = "-";
                    }
                    else
                    {
                        objEWA3.Result = txtResult.Text;
                    }


                    //TextBox txtResult = (TextBox)grdResultFormat.Rows[row].FindControl("txt3");
                    //if (txtResult.Text == "")
                    //    objEWA3.Result = "-";
                    //else
                    //    objEWA3.Result = txtResult.Text;



                    rs = InsertUploadResult(objEWA3);

                    string id = db.getDbstatus_Value("SELECT MAX(ResultId) FROM tblUploadResult");
                    int    i = 0, j = 2;
                    while (ds.Tables[0].Rows.Count > i && (countColumn - 1) > j)
                    {
                        //if (grdResultFormat.Rows[0].Cells[j].Text == ds.Tables[0].Rows[i][1].ToString())
                        //{
                        EWA_UploadResult objEWA4 = new EWA_UploadResult();
                        objEWA4.Action    = "InsertUploadMark";
                        objEWA4.ResultId  = id;
                        objEWA4.SubjectId = ds.Tables[0].Rows[i][0].ToString();

                        TextBox txtmark = (TextBox)grdResultFormat.Rows[row].Cells[j].FindControl("txt" + j);
                        //   TextBox txtmark = (TextBox)grdResultFormat.Rows[row].Cells[j].FindControl("txt" + j);
                        if (txtmark.Text == null)
                        {
                            objEWA4.Mark = "0";
                        }
                        else
                        {
                            objEWA4.Mark = txtmark.Text;
                        }

                        TextBox txtOutofmark = (TextBox)grdResultFormat.Rows[row].Cells[j + 1].FindControl("txt" + j + 1);
                        if (txtOutofmark.Text == null)
                        {
                            objEWA4.Outofmark = "0";
                        }
                        else
                        {
                            objEWA4.Outofmark = txtOutofmark.Text;
                        }

                        rs = InsertUploadMark(objEWA4);
                        //}
                        i++;
                        j = j + 2;
                    }
                    row++;
                }

                if (rs > 0)
                {
                    //GeneralErr("Successfully Result Upload");
                    msgBox.ShowMessage("Successfull Result Upload", "Successfull", CMS.UserControls.MessageBox.MessageStyle.Successfull);
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }