Exemplo n.º 1
0
        public bool Set(AboutUsInfo model)
        {
            bool retrunValue = true;
            try
            {
                string spName = "uspAboutInsertUpdate";
                SqlParameter[] param = {
                SqlHelper.SqlParameter("@aboutus_id", System.Data.SqlDbType.Int, model.AboutUsId),
                SqlHelper.SqlParameter("@aboutus1", System.Data.SqlDbType.VarChar, model.AboutUs1, true),
                SqlHelper.SqlParameter("@aboutus2", System.Data.SqlDbType.VarChar, model.AboutUs2, true),
                SqlHelper.SqlParameter("@aboutus3", System.Data.SqlDbType.VarChar, model.AboutUs3, true),
                SqlHelper.SqlParameter("@userId", System.Data.SqlDbType.VarChar,model.LoginUser , true)
                };

                int Resultval = SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringLocalTransaction, System.Data.CommandType.StoredProcedure, spName, param);

                if (Resultval <= 0)
                {
                    retrunValue = false;
                }

            }
            catch (Exception ex)
            {
                retrunValue = false;
            }

            return retrunValue;
        }
Exemplo n.º 2
0
        public AboutUsInfo Get(AboutUsInfo model)
        {
            AboutUsInfo returnValue = new AboutUsInfo();
            try
            {
                string spName = "uspAboutInsertUpdate";
                SqlParameter[] param =  {
                SqlHelper.SqlParameter("@aboutus_id", System.Data.SqlDbType.Int, model.AboutUsId)
                };

                using (SqlDataReader rdr = SqlHelper.ExecuteReader(SqlHelper.ConnectionStringLocalTransaction, System.Data.CommandType.StoredProcedure, spName, param))
                {
                    while (rdr.Read())
                    {
                        returnValue.AboutUsId = rdr.GetInt32(0);
                        returnValue.AboutUs1 = rdr.GetString(1);
                        returnValue.AboutUs2 = rdr.GetString(2);
                        returnValue.AboutUs3 = rdr.GetString(3);

                    }
                }
            }
            catch (Exception ex)
            {

            }

            return returnValue;
        }
Exemplo n.º 3
0
 public ActionResult About()
 {
     AboutUs aboutUs = new AboutUs();
     //AboutUsInfo returnValue = aboutUs.Get(new AboutUsInfo());
     AboutUsInfo returnValue = new AboutUsInfo();
     return View(returnValue);
 }
Exemplo n.º 4
0
        public ActionResult About(AboutUsInfo model)
        {
            AboutUs aboutUs = new AboutUs();
            bool returnVal = true;
            if (ModelState.IsValid)
            {
                if (model.AboutUsId > 0)
                {
                    returnVal = aboutUs.Set(model);
                }
                else
                {
                    returnVal = aboutUs.Insert(model);
                }
            }

            return this.Json(returnVal, JsonRequestBehavior.AllowGet);
        }
Exemplo n.º 5
0
 public bool Set(AboutUsInfo model)
 {
     AboutUsDAL obj = new AboutUsDAL();
     return obj.Set(model);
 }
Exemplo n.º 6
0
 public bool Insert(AboutUsInfo model)
 {
     AboutUsDAL obj = new AboutUsDAL();
     return obj.Insert(model);
 }
Exemplo n.º 7
0
 public AboutUsInfo Get(AboutUsInfo model)
 {
     AboutUsDAL obj = new AboutUsDAL();
     return obj.Get(model);
 }