예제 #1
0
        public void PublishAchvmnt(Achvmnts pa, int id)
        {
            SqlCommand cmd = new SqlCommand("Update achievements Set publish=@Publish Where id = @Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            cmd.Parameters.AddWithValue("@Publish", (pa.Publish == null) ? Convert.DBNull : pa.Publish);
            addachvmnt(cmd);
        }
예제 #2
0
        public void UpdateAchvmnt(Achvmnts ua, int id)
        {
            SqlCommand cmd = new SqlCommand("Update achievements Set name=@Name,detail=@Detail Where id=@Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            cmd.Parameters.AddWithValue("@Name", (ua.Name == null) ? Convert.DBNull : ua.Name);
            cmd.Parameters.AddWithValue("@Detail", (ua.Detail == null) ? Convert.DBNull : ua.Detail);
            addachvmnt(cmd);
        }
예제 #3
0
        public void AddAchvmnt(Achvmnts a)
        {
            SqlCommand cmd = new SqlCommand("INSERT into achievements (name,detail,picture,date,month,year,time) VALUES (@Name,@Detail,@Picture,@Date,@Month,@Year,@Time)", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Name", (a.Name == null) ? Convert.DBNull : a.Name);
            cmd.Parameters.AddWithValue("@Detail", (a.Detail == null) ? Convert.DBNull : a.Detail);
            cmd.Parameters.AddWithValue("@Picture", (a.Picture == null) ? Convert.DBNull : a.Picture);
            cmd.Parameters.AddWithValue("@Date", (a.Date == null) ? Convert.DBNull : a.Date);
            cmd.Parameters.AddWithValue("@Month", (a.Month == null) ? Convert.DBNull : a.Month);
            cmd.Parameters.AddWithValue("@Year", (a.Year == null) ? Convert.DBNull : a.Year);
            cmd.Parameters.AddWithValue("@Time", (a.Time == null) ? Convert.DBNull : a.Time);
            addachvmnt(cmd);
        }
        public ActionResult Publish(Achvmnt pa, int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                if (ModelState.IsValid)
                {
                    Achvmnts PublishAchvmnt = new Achvmnts();
                    PublishAchvmnt.Publish = pa.Publish;
                    new Cateloge().PublishAchvmnt(PublishAchvmnt, id);
                    TempData["Msg"] = "This Achievement Have Published Successfully";
                    return(RedirectToAction("View", new { id = id }));
                }

                return(RedirectToAction("Index"));
            }
        }
 public void PublishAchvmnt(Achvmnts pa, int id)
 {
     new AddAndUpdtAchvmntDAL().PublishAchvmnt(pa, id);
 }
 public void UpdateAchvmnt_img(Achvmnts ua, int id)
 {
     new AddAndUpdtAchvmntDAL().UpdateAchvmnt_img(ua, id);
 }
 public void AddAchvmnt(Achvmnts a)
 {
     new AddAndUpdtAchvmntDAL().AddAchvmnt(a);
 }