Ejemplo n.º 1
0
 public DataSet Select_InstituteList(Mockcounselling _obj)
 {
     try
     {
         _cn.Open();
         SqlCommand _cmd = new SqlCommand("Mockcounselling_Student", _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("@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 JsonResult Select_Result(Mockcounselling obj)
        {
            MockResultRepository objRep = new MockResultRepository();

            obj.Type            = "AllotedSeat";
            obj.studentid       = Session["studentid"].ToString();
            obj.ProgramLevel_Id = Session["ProgramlevelId"].ToString();
            obj.Discipline_ID   = Session["Discipline_Id"].ToString();
            DataSet ds = objRep.Select_InstituteList(obj);
            List <Mockcounselling> _list = new List <Mockcounselling>();

            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        Mockcounselling objChoice = new Mockcounselling();
                        objChoice.ID             = row["ID"].ToString();//Primary key
                        objChoice.InstituteID    = row["Institute_Id"].ToString();
                        objChoice.InstituteName  = row["InstituteName"].ToString();
                        objChoice.SequenceNumber = row["SequenceNumber"].ToString();
                        objChoice.Natureofcourse = row["NoC"].ToString();
                        objChoice.ProgramLevel   = row["ProgramLevel"].ToString();
                        objChoice.BranchName     = row["BranchName"].ToString();
                        objChoice.Discipline     = row["Discipline"].ToString();
                        objChoice.SeatWaivertype = row["SeatWaivertype"].ToString();
                        objChoice.Isalloted      = row["Isalloted"].ToString();
                        _list.Add(objChoice);
                    }
                }
            }
            return(Json(new
            {
                List = _list
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }