Ejemplo n.º 1
0
 public DataSet Insert_InstituteList(ChoiceFilling _obj)
 {
     try
     {
         _cn.Open();
         SqlCommand _cmd = new SqlCommand("Student_Choice_Filling_Insert", _cn);
         _cmd.Parameters.AddWithValue("@Created_By", _obj.studentid);
         _cmd.Parameters.AddWithValue("@Type", _obj.Type);
         _cmd.Parameters.AddWithValue("@Control", _obj.Control);
         _cmd.Parameters.AddWithValue("@Discipline_ID", _obj.Discipline_ID);
         _cmd.Parameters.AddWithValue("@ProgramLevel_Id", _obj.ProgramLevel_Id);
         _cmd.Parameters.AddWithValue("@Natureofcourse_Id", _obj.Natureofcourse_Id);
         _cmd.Parameters.AddWithValue("@InstituteID", _obj.InstituteID);
         _cmd.Parameters.AddWithValue("@Branch_Id", _obj.Branch_Id);
         _cmd.Parameters.AddWithValue("@Institute_List_JSON", _obj.Institute_List_JSON);
         _cmd.Parameters.AddWithValue("@StudentId", _obj.studentid);
         _cmd.CommandType = CommandType.StoredProcedure;
         SqlDataAdapter _adp = new SqlDataAdapter(_cmd);
         DataSet        _ds  = new DataSet();
         _adp.Fill(_ds);
         _adp.Dispose();
         _cmd.Dispose();
         return(_ds);
     }
     catch (Exception)
     {
         throw;
     }
     finally
     {
         _cn.Close();
     }
 }
Ejemplo n.º 2
0
 public DataSet Insert_InstituteList_New(ChoiceFilling _obj)
 {
     try
     {
         _cn.Open();
         SqlCommand _cmd = new SqlCommand("Student_Choice_Filling_Insert_New", _cn);
         _cmd.Parameters.AddWithValue("@Student_ID", _obj.studentid);
         _cmd.Parameters.AddWithValue("@InstituteCourse_ID", _obj.InstituteCourse_ID);
         _cmd.Parameters.AddWithValue("@CreatedBy", _obj.CreatedBy);
         _cmd.Parameters.AddWithValue("@CreatedIp", _obj.CreatedIp);
         _cmd.Parameters.AddWithValue("@SeatWaivertype", _obj.SeatWaivertype);
         _cmd.Parameters.AddWithValue("@Type", _obj.Type);
         _cmd.Parameters.AddWithValue("@Control", _obj.Control);
         _cmd.CommandType = CommandType.StoredProcedure;
         SqlDataAdapter _adp = new SqlDataAdapter(_cmd);
         DataSet        _ds  = new DataSet();
         _adp.Fill(_ds);
         _adp.Dispose();
         _cmd.Dispose();
         return(_ds);
     }
     catch (Exception)
     {
         throw;
     }
     finally
     {
         _cn.Close();
     }
 }
Ejemplo n.º 3
0
 public DataSet UpdateSequenceNumber_swap_move(ChoiceFilling _obj)
 {
     try
     {
         _cn.Open();
         SqlCommand _cmd = new SqlCommand("update_SequenceNumber_swap_move", _cn);
         _cmd.Parameters.AddWithValue("@Created_By", _obj.studentid);
         _cmd.Parameters.AddWithValue("@Type", _obj.Type);
         _cmd.Parameters.AddWithValue("@drpformid", _obj.drpformid);
         _cmd.Parameters.AddWithValue("@drptoid", _obj.drptoid);
         _cmd.Parameters.AddWithValue("@Created_Ip", _obj.CreatedIp);
         _cmd.Parameters.AddWithValue("@studentid", _obj.studentid);
         _cmd.CommandType = CommandType.StoredProcedure;
         SqlDataAdapter _adp = new SqlDataAdapter(_cmd);
         DataSet        _ds  = new DataSet();
         _adp.Fill(_ds);
         _adp.Dispose();
         _cmd.Dispose();
         return(_ds);
     }
     catch (Exception)
     {
         throw;
     }
     finally
     {
         _cn.Close();
     }
 }
Ejemplo n.º 4
0
 public DataSet student_submit_choice_filling(ChoiceFilling _obj)
 {
     try
     {
         _cn.Open();
         SqlCommand _cmd = new SqlCommand("student_submit_choice_filling", _cn);
         _cmd.Parameters.AddWithValue("@student_id", _obj.studentid);
         _cmd.Parameters.AddWithValue("@ip", _obj.CreatedIp);
         _cmd.CommandType = CommandType.StoredProcedure;
         SqlDataAdapter _adp = new SqlDataAdapter(_cmd);
         DataSet        _ds  = new DataSet();
         _adp.Fill(_ds);
         _adp.Dispose();
         _cmd.Dispose();
         return(_ds);
     }
     catch (Exception)
     {
         throw;
     }
     finally
     {
         _cn.Close();
     }
 }
Ejemplo n.º 5
0
        public JsonResult UpdateSequenceNumber_swap_move(ChoiceFilling obj)
        {
            ChoiceFillingRepository objRep = new ChoiceFillingRepository();
            //obj.Type = "SWAP";
            string localIP = "?";

            localIP       = Request.ServerVariables["REMOTE_ADDR"].ToString();
            obj.CreatedIp = localIP;
            obj.studentid = Session["studentid"].ToString();
            DataSet _ds  = objRep.UpdateSequenceNumber_swap_move(obj);
            bool    flag = true;

            if (_ds != null)
            {
                if (_ds.Tables[0].Rows.Count > 0)
                {
                    if (_ds.Tables[0].Rows[0]["FLAG"].ToString() == "0")
                    {
                        flag = false;
                    }
                }
            }
            return(Json(new
            {
                flag = flag
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
Ejemplo n.º 6
0
        public JsonResult Insert_InstituteList(ChoiceFilling _obj)
        {
            ChoiceFillingRepository objRep = new ChoiceFillingRepository();

            _obj.studentid = Session["studentid"].ToString();
            _obj.CreatedBy = Session["studentid"].ToString();
            _obj.CreatedIp = Session["localIP"].ToString();
            DataSet _ds  = objRep.Insert_InstituteList_New(_obj);
            bool    flag = true;

            if (_ds != null)
            {
                if (_ds.Tables[0].Rows.Count > 0)
                {
                    if (_ds.Tables[0].Rows[0]["FLAG"].ToString() == "0")
                    {
                        flag = false;
                    }
                }
            }
            return(Json(new
            {
                flag = flag
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
Ejemplo n.º 7
0
        public JsonResult student_submit_choice_filling(ChoiceFilling obj)
        {
            ChoiceFillingRepository objRep = new ChoiceFillingRepository();
            //obj.Type = "SWAP";
            string localIP = "?";

            localIP       = Request.ServerVariables["REMOTE_ADDR"].ToString();
            obj.CreatedIp = localIP;
            obj.studentid = Session["studentid"].ToString();
            DataSet   _ds           = objRep.student_submit_choice_filling(obj);
            bool      flag          = true;
            SendEmail _objseedemail = new SendEmail();

            if (_ds != null)
            {
                if (_ds.Tables[0].Rows.Count > 0)
                {
                    if (_ds.Tables[0].Rows[0]["FLAG"].ToString() == "0")
                    {
                        flag = false;
                    }
                    else
                    {
                        string        strform  = System.Configuration.ConfigurationManager.AppSettings["Emailusername"];
                        string        Subject  = "Study in India";
                        StringBuilder MailBody = new StringBuilder();
                        MailBody.Append("<br/>Dear Candidate, " + Session["studentname"].ToString() + ",<br/>");
                        MailBody.Append("<br/>Thank you for choosing Study in India!");
                        MailBody.Append("<br/>You have successfully submitted your choices for institutes.");
                        MailBody.Append("<br/>Results of the counseling will be shared with you shortly.");
                        MailBody.Append("<br/><br/><br/>Best,<br/>");
                        MailBody.Append("Study in India Team<br/>");
                        string bcc = "";
                        string cc  = "";
                        _objseedemail.SendEmailInBackgroundThread(strform, Session["Email"].ToString(), bcc, cc, Subject, MailBody.ToString(), "", true);
                    }
                }
            }
            return(Json(new
            {
                flag = flag
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
Ejemplo n.º 8
0
        public JsonResult SelectInstitute(ChoiceFilling obj)
        {
            ChoiceFillingRepository objRep = new ChoiceFillingRepository();

            obj.Type      = "GridDetails";
            obj.studentid = Session["studentid"].ToString();
            obj.CreatedBy = Session["studentid"].ToString();
            DataSet ds = objRep.Select_InstituteList(obj);
            List <ChoiceFilling> _list = new List <ChoiceFilling>();

            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        ChoiceFilling objChoice = new ChoiceFilling();
                        //objChoice.ID = row["ID"].ToString();
                        objChoice.tbl_InstituteCourse_ID = row["tbl_InstituteCourse_ID"].ToString();
                        objChoice.InstituteID            = row["InstituteId"].ToString();
                        //objChoice.Discipline = row["Discipline"].ToString();
                        objChoice.Natureofcourse = row["Natureofcourse"].ToString();
                        //objChoice.ProgramLevel = row["ProgramLevel"].ToString();
                        //   objChoice.BranchName = row["BranchName"].ToString();
                        objChoice.InstituteName = row["InstituteName"].ToString();
                        // objChoice.DisplayName = row["DisplayName"].ToString();
                        objChoice.state_name   = row["state_name"].ToString();
                        objChoice.G1SeatWaiver = row["G1SeatWaiver"].ToString();
                        objChoice.G2SeatWaiver = row["G2SeatWaiver"].ToString();
                        objChoice.G3SeatWaiver = row["G3SeatWaiver"].ToString();
                        objChoice.G4SeatWaiver = row["G4SeatWaiver"].ToString();
                        _list.Add(objChoice);
                    }
                }
            }
            return(Json(new
            {
                List = _list
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
Ejemplo n.º 9
0
        public ActionResult SelectInstitutePaging(ChoiceFilling obj)
        {
            var    draw   = Request.Form.GetValues("draw").FirstOrDefault();
            var    start  = Request.Form.GetValues("start").FirstOrDefault();
            var    length = Request.Form.GetValues("length").FirstOrDefault();
            string search = Request.Form.GetValues("search[value]").FirstOrDefault();
            // var data="";
            int pageSize = length != null?Convert.ToInt32(length) : 0;

            int skip = start != null?Convert.ToInt32(start) : 0;

            int recordsTotal = 0;
            ChoiceFillingRepository objRep = new ChoiceFillingRepository();

            obj.Type      = "GridDetails";
            obj.studentid = Session["studentid"].ToString();
            obj.CreatedBy = Session["studentid"].ToString();
            List <ChoiceFilling> _list = new List <ChoiceFilling>();
            DataSet ds = objRep.Select_InstituteList(obj);

            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        ChoiceFilling objChoice = new ChoiceFilling();
                        objChoice.tbl_InstituteCourse_ID = row["tbl_InstituteCourse_ID"].ToString();
                        objChoice.InstituteID            = row["InstituteId"].ToString();
                        objChoice.Natureofcourse         = row["Natureofcourse"].ToString();
                        objChoice.InstituteName          = row["InstituteName"].ToString();
                        objChoice.state_name             = row["state_name"].ToString();
                        objChoice.G1SeatWaiver           = row["G1SeatWaiver"].ToString();
                        objChoice.G2SeatWaiver           = row["G2SeatWaiver"].ToString();
                        objChoice.G3SeatWaiver           = row["G3SeatWaiver"].ToString();
                        objChoice.G4SeatWaiver           = row["G4SeatWaiver"].ToString();
                        _list.Add(objChoice);
                    }
                }
            }
            List <ChoiceFilling> list = new List <ChoiceFilling>();

            if (search == null)
            {
                list = _list;
            }
            else
            {
                // simulate search
                foreach (ChoiceFilling dataItem in _list)
                {
                    if (dataItem.InstituteName.ToUpper().Contains(search.ToUpper()) ||
                        dataItem.Natureofcourse.ToString().Contains(search.ToUpper()))
                    {
                        list.Add(dataItem);
                    }
                }
            }
            var v = list;

            recordsTotal = v.Count();
            var data = v.Skip(skip).Take(pageSize).ToList();

            return(Json(new { draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data = data }, JsonRequestBehavior.AllowGet));
        }