コード例 #1
0
        private string Get_StorefrontEleganceID(string strStorefrontEleganceGUID)
        {
            zlzw.BLL.StorefrontEleganceListBLL storefrontEleganceListBLL = new zlzw.BLL.StorefrontEleganceListBLL();
            DataTable dt = storefrontEleganceListBLL.GetList("StorefrontEleganceGUID='" + strStorefrontEleganceGUID + "'").Tables[0];

            return(dt.Rows[0]["StorefrontEleganceID"].ToString());
        }
コード例 #2
0
        protected void btnDel_Click(object sender, EventArgs e)
        {
            if (grid1.SelectedRowIndexArray != null && grid1.SelectedRowIndexArray.Length > 0)
            {
                string strSelectID = "0";
                for (int i = 0, count = grid1.SelectedRowIndexArray.Length; i < count; i++)
                {
                    int rowIndex = grid1.SelectedRowIndexArray[i];
                    foreach (object key in grid1.DataKeys[rowIndex])
                    {
                        strSelectID = key.ToString();
                    }
                }
                #region  除逻辑

                zlzw.BLL.StorefrontEleganceListBLL     storefrontEleganceListBLL   = new zlzw.BLL.StorefrontEleganceListBLL();
                zlzw.Model.StorefrontEleganceListModal storefrontEleganceListModal = storefrontEleganceListBLL.GetModel(int.Parse(Get_StorefrontEleganceID(strSelectID)));
                storefrontEleganceListModal.IsEnable = 0;
                storefrontEleganceListBLL.Update(storefrontEleganceListModal);
                StorefrontEleganceList_BindGrid();

                #endregion
            }
            else
            {
                return;
            }
        }
コード例 #3
0
        private void StorefrontEleganceList_BindGrid()
        {
            zlzw.BLL.StorefrontEleganceListBLL storefrontEleganceListBLL = new zlzw.BLL.StorefrontEleganceListBLL();
            DataTable dt = storefrontEleganceListBLL.GetList(grid1.PageSize, grid1.PageIndex + 1, "*", "PublishDate", 0, "desc", "IsEnable=1").Tables[0];

            grid1.DataSource = dt;
            grid1.DataBind();
        }
コード例 #4
0
        private void Load_StoreInfo(string strStoreKey)
        {
            zlzw.BLL.StorefrontEleganceListBLL storefrontEleganceListBLL = new zlzw.BLL.StorefrontEleganceListBLL();
            DataTable dt = storefrontEleganceListBLL.GetList("DictionaryKey='" + strStoreKey + "'").Tables[0];

            if (dt.Rows.Count > 0)
            {
                labStoreImage.Text = "<img src='" + dt.Rows[0]["StorefrontEleganceHeadImage"].ToString().Split('~')[1] + "' alt='' />";
                labStoreDesc.Text  = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + dt.Rows[0]["StorefrontEleganceDescription"].ToString();
                labPostJob.Text    = "<span style='color:#1D5087;font-size:14px;'>主推岗位:</span>" + dt.Rows[0]["PushJobs"].ToString();
            }
        }
コード例 #5
0
        /// <summary>
        /// 获取总页数
        /// </summary>
        /// <returns></returns>
        private int Get_StoreStatisticsListTotalCount()
        {
            zlzw.BLL.StorefrontEleganceListBLL storefrontEleganceListBLL = new zlzw.BLL.StorefrontEleganceListBLL();
            DataTable dt = storefrontEleganceListBLL.GetList("IsEnable=1").Tables[0];

            if (dt.Rows.Count > 0)
            {
                return(dt.Rows.Count);
            }
            else
            {
                return(0);
            }
        }
コード例 #6
0
        private void LoadData(string strType)
        {
            if (strType == "1")
            {
                string strID = Request.QueryString["value"];//操作ID
                zlzw.BLL.StorefrontEleganceListBLL storefrontEleganceListBLL = new zlzw.BLL.StorefrontEleganceListBLL();
                DataTable dt = storefrontEleganceListBLL.GetList("StorefrontEleganceGUID='" + strID + "'").Tables[0];
                zlzw.Model.StorefrontEleganceListModal storefrontEleganceListModal = storefrontEleganceListBLL.GetModel(int.Parse(dt.Rows[0]["StorefrontEleganceID"].ToString()));

                drpRegionList.SelectedValue             = storefrontEleganceListModal.Other01.ToString();
                drpStorefrontEleganceType.SelectedValue = storefrontEleganceListModal.DictionaryKey;                 //所属店铺
                txbStorefrontEleganceTitle.Text         = storefrontEleganceListModal.StorefrontEleganceTitle;       //店铺名称
                txbStorefrontEleganceDescription.Text   = storefrontEleganceListModal.StorefrontEleganceDescription; //店铺简介
                txbPushJobs.Text       = storefrontEleganceListModal.PushJobs;                                       //主推岗位
                labPreviweImg.ImageUrl = storefrontEleganceListModal.StorefrontEleganceHeadImage.Split('~')[1];

                ViewState["StorefrontEleganceHeadImage"] = storefrontEleganceListModal.StorefrontEleganceHeadImage; //门店简介
                ViewState["PublishDate"]            = storefrontEleganceListModal.PublishDate.ToString();
                ViewState["StorefrontEleganceGUID"] = storefrontEleganceListModal.StorefrontEleganceGUID;           //店面风采GUID
                ToolbarText2.Text = "编辑一个店面风采";
            }
            btnClose.OnClientClick = ActiveWindow.GetConfirmHideReference();
        }
コード例 #7
0
        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["Type"] == "1")
            {
                //编辑保存
                zlzw.Model.StorefrontEleganceListModal storefrontEleganceListModal = new zlzw.Model.StorefrontEleganceListModal();
                storefrontEleganceListModal.StorefrontEleganceGUID = new Guid(ViewState["StorefrontEleganceGUID"].ToString()); //店面风采GUID
                storefrontEleganceListModal.Other01                       = drpRegionList.SelectedValue;
                storefrontEleganceListModal.DictionaryKey                 = drpStorefrontEleganceType.SelectedValue;           //所属门店
                storefrontEleganceListModal.StorefrontEleganceTitle       = txbStorefrontEleganceTitle.Text;                   //门店名称
                storefrontEleganceListModal.StorefrontEleganceDescription = txbStorefrontEleganceDescription.Text;             //门店简介
                storefrontEleganceListModal.PushJobs                      = txbPushJobs.Text;                                  //主推岗位
                if (btnStorefrontEleganceHeadImage.PostedFile.ContentLength > 0)
                {
                    btnStorefrontEleganceHeadImage.SaveAs(Server.MapPath(ViewState["StorefrontEleganceHeadImage"].ToString()));
                    storefrontEleganceListModal.StorefrontEleganceHeadImage = ViewState["StorefrontEleganceHeadImage"].ToString();//保存页面头部门店介绍路径
                }
                else
                {
                    storefrontEleganceListModal.StorefrontEleganceHeadImage = ViewState["StorefrontEleganceHeadImage"].ToString();
                }

                storefrontEleganceListModal.IsEnable               = 1;
                storefrontEleganceListModal.PublishDate            = DateTime.Parse(ViewState["PublishDate"].ToString());
                storefrontEleganceListModal.StorefrontEleganceID   = int.Parse(Get_StorefrontEleganceID(Request.QueryString["value"]));
                storefrontEleganceListModal.StorefrontEleganceGUID = new Guid(Request.QueryString["value"]);
                zlzw.BLL.StorefrontEleganceListBLL storefrontEleganceListBLL = new zlzw.BLL.StorefrontEleganceListBLL();
                storefrontEleganceListBLL.Update(storefrontEleganceListModal);
            }
            else
            {
                //添加保存

                zlzw.Model.StorefrontEleganceListModal storefrontEleganceListModal = new zlzw.Model.StorefrontEleganceListModal();
                storefrontEleganceListModal.DictionaryKey                 = drpStorefrontEleganceType.SelectedValue; //所属门店
                storefrontEleganceListModal.Other01                       = drpRegionList.SelectedValue;
                storefrontEleganceListModal.StorefrontEleganceTitle       = txbStorefrontEleganceTitle.Text;         //门店名称
                storefrontEleganceListModal.StorefrontEleganceDescription = txbStorefrontEleganceDescription.Text;   //门店简介
                storefrontEleganceListModal.PushJobs                      = txbPushJobs.Text;                        //主推岗位
                if (btnStorefrontEleganceHeadImage.PostedFile.ContentLength > 0)
                {
                    string fileName = DateTime.Now.Ticks.ToString() + "_" + btnStorefrontEleganceHeadImage.FileName;
                    btnStorefrontEleganceHeadImage.SaveAs(Server.MapPath("~/storefrontEleganceImages/" + fileName));
                    storefrontEleganceListModal.StorefrontEleganceHeadImage = "~/storefrontEleganceImages/" + fileName;//保存页面头部门店介绍路径
                }
                else
                {
                    storefrontEleganceListModal.StorefrontEleganceHeadImage = ViewState["StorefrontEleganceHeadImage"].ToString();
                }

                storefrontEleganceListModal.IsEnable = 1;
                storefrontEleganceListModal.StorefrontEleganceGUID = Guid.NewGuid();//店面风采GUID
                storefrontEleganceListModal.PublishDate            = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));

                zlzw.BLL.StorefrontEleganceListBLL storefrontEleganceListBLL = new zlzw.BLL.StorefrontEleganceListBLL();
                storefrontEleganceListBLL.Add(storefrontEleganceListModal);
            }

            // 2. Close this window and Refresh parent window
            PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
        }