Ejemplo n.º 1
0
        protected void btEdit_Click(object sender, EventArgs e)
        {
            MallInfoBLL _MallInfoBLL = new MallInfoBLL();
            MallInfo    _MallInfo    = new MallInfo();

            _MallInfo.Local        = this.TxtLoc.Text.Trim();
            _MallInfo.PhoneNum     = this.txtPhoneNum.Text.Trim();
            _MallInfo.Introduction = this.TxtIntroduce.Text.Trim();
            _MallInfo.OpenTime     = this.TxtOpenTime.Text.Trim();
            _MallInfo.CityID       = int.Parse(Request.QueryString["CityID"].ToString());
            _MallInfo.MallName     = this.txtMallName.Text.Trim();


            if (this.txtMallLgt.Text.Trim() != "")
            {
                _MallInfo.SLongitude = float.Parse(this.txtMallLgt.Text.Trim().ToString());
            }
            else
            {
                _MallInfo.SLongitude = 0.0f;
            }

            if (this.txtMallLat.Text.Trim() != "")
            {
                _MallInfo.Slatitude = float.Parse(txtMallLat.Text.Trim().ToString());
            }
            else
            {
                _MallInfo.Slatitude = 0.0f;
            }


            int CityID = int.Parse(Request.QueryString["CityID"].ToString());
            int MallID = int.Parse(Request.QueryString["MallID"].ToString());

            if (_MallInfoBLL.UpdMallInfo(MallID, _MallInfo))
            {
                Response.Write("<script language='javascript'>");
                Response.Write("alert('更改成功');");
                Response.Write("document.location.href='MallInfoList.aspx?&CityID=" + CityID.ToString() + "';");
                Response.Write("</script>");
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 更新酒店信息
        /// </summary>
        /// <param name="MallID"></param>
        /// <param name="_MallInfo"></param>
        /// <returns></returns>
        public bool UpdMallInfo(int MallID, MallInfo _MallInfo)
        {
            String Sql = "update MallInfo set Local=@Local,PhoneNum=@PhoneNum,Introduction=@Introduction,OpenTime=@OpenTime," +
                         "SLongitude=@SLongitude,Slatitude=@Slatitude where MallID = @MallID";

            SqlParameter[] Paras = new SqlParameter[]
            {
                new SqlParameter("@SLongitude", _MallInfo.SLongitude),
                new SqlParameter("@Slatitude", _MallInfo.Slatitude),
                new SqlParameter("@Local", _MallInfo.Local),
                new SqlParameter("@Introduction", _MallInfo.Introduction),
                new SqlParameter("@OpenTime", _MallInfo.OpenTime),
                new SqlParameter("@PhoneNum", _MallInfo.PhoneNum),
                new SqlParameter("@MallID", MallID)
            };

            if (SqlHelper.ExecuteNonQuery(Sql, Paras, CommandType.Text) > 0)
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 添加一个商场信息
        /// </summary>
        /// <param name="_MallInfo"></param>
        public bool AddMallInfo(MallInfo _MallInfo)
        {
            String Sql = "insert into MallInfo(Local,PhoneNum,Introduction,OpenTime,CityID,SLongitude,Slatitude,MallName) values" +
                         "(@Local,@PhoneNum,@Introduction,@OpenTime,@CityID,@SLongitude,@Slatitude,@MallName)";

            SqlParameter[] Paras = new SqlParameter[]
            {
                new SqlParameter("@Local", _MallInfo.Local),
                new SqlParameter("@PhoneNum", _MallInfo.PhoneNum),
                new SqlParameter("@Introduction", _MallInfo.Introduction),
                new SqlParameter("@OpenTime", _MallInfo.OpenTime),
                new SqlParameter("@CityID", _MallInfo.CityID),
                new SqlParameter("@SLongitude", _MallInfo.SLongitude),
                new SqlParameter("@Slatitude", _MallInfo.Slatitude),
                new SqlParameter("@MallName", _MallInfo.MallName)
            };

            if (SqlHelper.ExecuteNonQuery(Sql, Paras, CommandType.Text) > 0)
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 4
0
 public async Task <IActionResult> MallInfo(MallInfo mallInfo)
 {
     _context.MallInfo.Update(mallInfo);
     _context.SaveChanges();
     return(View(mallInfo));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 更新酒店信息
 /// </summary>
 /// <param name="MallID"></param>
 /// <param name="_MallInfo"></param>
 /// <returns></returns>
 public bool UpdMallInfo(int MallID, MallInfo _MallInfo)
 {
     return(this._MallInfoDAL.UpdMallInfo(MallID, _MallInfo));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 添加一个商场信息
 /// </summary>
 /// <param name="_MallInfo"></param>
 public bool AddMallInfo(MallInfo _MallInfo)
 {
     return(this._MallInfoDAL.AddMallInfo(_MallInfo));
 }