Exemplo n.º 1
0
        private void MallBind()
        {
            int         MallID       = int.Parse(Request.QueryString["MallID"].ToString());
            MallInfoBLL _MallInfoBLL = new MallInfoBLL();
            DataTable   DT           = _MallInfoBLL.GetMallInfoByID(MallID);

            this.TxtLoc.Text       = DT.Rows[0]["Local"].ToString();
            this.txtPhoneNum.Text  = DT.Rows[0]["PhoneNum"].ToString();
            this.TxtIntroduce.Text = DT.Rows[0]["Introduction"].ToString();
            this.TxtOpenTime.Text  = DT.Rows[0]["OpenTime"].ToString();

            this.txtMallName.Text    = DT.Rows[0]["MallName"].ToString();
            this.txtMallName.Enabled = false;

            if (float.Parse(DT.Rows[0]["SLongitude"].ToString()) != 0.0f)
            {
                this.txtMallLgt.Text = DT.Rows[0]["SLongitude"].ToString();
            }
            else
            {
                this.txtMallLgt.Text = "";
            }

            if (float.Parse(DT.Rows[0]["Slatitude"].ToString()) != 0.0f)
            {
                this.txtMallLat.Text = DT.Rows[0]["Slatitude"].ToString();
            }
            else
            {
                this.txtMallLat.Text = "";
            }
        }
        protected void AspNetPager4_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
        {
            MallInfoBLL _MallInfoBLL = new MallInfoBLL();

            CityID    = int.Parse(this.DropDownCity.SelectedValue.ToString());
            PageStart = e.NewPageIndex;
            DT        = _MallInfoBLL.GetCityMallSplit(CityID, this.AspNetPager4.PageSize, PageStart);
        }
        protected void DropDownMall_SelectedIndexChanged(object sender, EventArgs e)
        {
            MallID = int.Parse(this.DropDownMall.SelectedValue);
            MallInfoBLL _MallInfoBLL = new MallInfoBLL();

            CityID = _MallInfoBLL.GetMallCityID(MallID);
            this.DrpDownCity.SelectedValue = CityID.ToString();
        }
        protected void DropDownCity_SelectedIndexChanged(object sender, EventArgs e)
        {
            CityID    = int.Parse(this.DropDownCity.SelectedValue.ToString());
            PageStart = 1;
            this.AspNetPager4.CurrentPageIndex = PageStart;
            MallInfoBLL _MallInfoBLL = new MallInfoBLL();

            DT = _MallInfoBLL.GetCityMallSplit(CityID, this.AspNetPager4.PageSize, PageStart);
        }
        private void MallBind(int CityID)
        {
            MallInfoBLL _MallInfoBLL = new MallInfoBLL();

            DataTable MallDT = _MallInfoBLL.GetCityMall(CityID);

            this.DropDownMall.Items.Clear();
            this.DropDownMall.DataSource     = MallDT;
            this.DropDownMall.DataTextField  = "MallName";
            this.DropDownMall.DataValueField = "MallID";
            this.DropDownMall.DataBind();
        }
Exemplo n.º 6
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>");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                bool IsSysAdmin = true;
                bool IsSceAdmin = true;

                if (null == Session["IsSYS"] || (Boolean)Session["IsSYS"] != true)
                {
                    IsSysAdmin = false;
                    IsSceAdmin = false;

                    AdminInfoBLL _AdminInfoBLL = new AdminInfoBLL();
                    RoleBLL      _RoleBLL      = new RoleBLL();
                    int          AdminID       = int.Parse(Session["AdminID"].ToString());
                    int          RoleID        = _RoleBLL.GetRoleIDByAdminID(AdminID);
                    IsSceAdmin = _AdminInfoBLL.CheckFunction(RoleID, "购物场所管理");
                }

                if (!(IsSysAdmin || IsSceAdmin))
                {
                    Response.Redirect("../../NotAllowed.aspx");
                }
                else
                {
                    this.CityBind();
                    CityID = int.Parse(this.DropDownCity.SelectedValue.ToString());
                    if (Request.QueryString["CityID"] != null && Request.QueryString["CityID"] != "")
                    {
                        CityID = int.Parse(Request.QueryString["CityID"].ToString());
                        this.DropDownCity.SelectedValue = CityID.ToString();
                    }
                    MallInfoBLL _MallInfoBLL = new MallInfoBLL();
                    DT = _MallInfoBLL.GetCityMallSplit(CityID, this.AspNetPager4.PageSize, PageStart);
                }
            }
        }
        //根据购物场所删除购物场所信息
        protected void deleteThis()
        {
            int CityID = int.Parse(Request.QueryString["CityID"].ToString());

            try
            {
                Array delWitch  = rqid.Split('|');
                bool  isTrue    = false;
                bool  isPicTrue = false;
                for (int i = 0; i < delWitch.Length - 1; i++)
                {
                    int delid = Convert.ToInt32(delWitch.GetValue(i));


                    MallInfoBLL _MallInfoBLL = new MallInfoBLL();
                    PicInfoBLL  _PicInfoBLL  = new PicInfoBLL();

                    if (_MallInfoBLL.DelMallInfoByID(delid))
                    {
                        isTrue = true;

                        DataTable PicDT = _PicInfoBLL.GetMallPic(delid);
                        if (PicDT.Rows.Count > 0)
                        {
                            for (int j = 0; j < PicDT.Rows.Count; j++)
                            {
                                int tempID = int.Parse(PicDT.Rows[j]["PicID"].ToString());
                                if (_PicInfoBLL.DelMallPic(tempID) && _PicInfoBLL.DelPicByID(tempID))
                                {
                                    isPicTrue = true;
                                }
                                else
                                {
                                    isPicTrue = false;
                                    break;
                                }
                            }
                        }
                        else
                        {
                            isPicTrue = true;
                        }
                    }
                    else
                    {
                        isTrue = false;
                    }

                    if (isTrue == false || isPicTrue == false)
                    {
                        break;
                    }
                }
                if (!(isTrue == false || isPicTrue == false))
                {
                    Response.Write("<script language='javascript'>");
                    Response.Write("alert('删除成功!');");
                    Response.Write("document.location.href='MallInfoList.aspx?CityID=" + CityID.ToString() + "';");
                    Response.Write("</script>");
                }
                else
                {
                    Response.Write("<script language='javascript'>");
                    Response.Write("alert('删除失败!');");
                    Response.Write("document.location.href='MallInfoList.aspx?CityID" + CityID.ToString() + "';");
                    Response.Write("</script>");
                }
            }
            catch
            {
                Response.Write("<script language='javascript'>");
                Response.Write("alert('删除失败!');");
                Response.Write("document.location.href='MallInfoList.aspx?CityID" + CityID.ToString() + "';");
                Response.Write("</script>");
            }
        }