Пример #1
0
 private void Load_NavigateConten()
 {
     titleName.Text = "招商加盟";
     zlzw.BLL.MerchantsJoinListBLL merchantsJoinListBLL = new zlzw.BLL.MerchantsJoinListBLL();
     System.Data.DataTable dt = merchantsJoinListBLL.GetList("IsEnable=1").Tables[0];
     labContent.Text = dt.Rows[0]["MerchantsJoinConetnt"].ToString();
 }
        protected void btnSaveRefresh_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["Type"] == "1")
            {
                //编辑保存
                zlzw.Model.MerchantsJoinListModel merchantsJoinListModel = new zlzw.Model.MerchantsJoinListModel();
                merchantsJoinListModel.PublishName = Get_UserName(Request.Cookies["UserID"].Value);
                merchantsJoinListModel.MerchantsJoinConetnt = txbContent.Text;
                merchantsJoinListModel.IsEnable = 1;
                merchantsJoinListModel.PublisDate = DateTime.Parse(ViewState["PublishDate"].ToString());
                merchantsJoinListModel.MerchantsJoinGUID = new Guid(ViewState["MerchantsJoinGUID"].ToString());
                zlzw.BLL.MerchantsJoinListBLL merchantsJoinListBLL = new zlzw.BLL.MerchantsJoinListBLL();
                merchantsJoinListModel.MerchantsJoinID = int.Parse(Get_ID(merchantsJoinListBLL, Request.QueryString["value"]));

                merchantsJoinListBLL.Update(merchantsJoinListModel);
            }
            else
            {
                //添加保存

                zlzw.Model.MerchantsJoinListModel merchantsJoinListModel = new zlzw.Model.MerchantsJoinListModel();
                merchantsJoinListModel.PublishName = Get_UserName(Request.Cookies["UserID"].Value);
                merchantsJoinListModel.MerchantsJoinConetnt = txbContent.Text;
                merchantsJoinListModel.IsEnable = 1;
                merchantsJoinListModel.PublisDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
                zlzw.BLL.MerchantsJoinListBLL merchantsJoinListBLL = new zlzw.BLL.MerchantsJoinListBLL();
                merchantsJoinListBLL.Add(merchantsJoinListModel);
            }

            // 2. Close this window and Refresh parent window
            PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
        }
Пример #3
0
        private void MerchantsJoinList_BindGrid()
        {
            zlzw.BLL.MerchantsJoinListBLL merchantsJoinListBLL = new zlzw.BLL.MerchantsJoinListBLL();
            System.Data.DataTable dt = merchantsJoinListBLL.GetList(grid1.PageSize, grid1.PageIndex + 1, "*", "PublisDate", 0, "desc", "IsEnable=1").Tables[0];

            grid1.DataSource = dt;
            grid1.DataBind();
        }
Пример #4
0
 /// <summary>
 /// 获取总页数
 /// </summary>
 /// <returns></returns>
 private int Get_MerchantsJoinListTotalCount()
 {
     zlzw.BLL.MerchantsJoinListBLL merchantsJoinListBLL = new zlzw.BLL.MerchantsJoinListBLL();
     System.Data.DataTable dt = merchantsJoinListBLL.GetList("IsEnable=1").Tables[0];
     if (dt.Rows.Count > 0)
     {
         return dt.Rows.Count;
     }
     else
     {
         return 0;
     }
 }
 private void LoadData(string strType)
 {
     if (strType == "1")
     {
         string strID = Request.QueryString["value"];//操作ID
         zlzw.BLL.MerchantsJoinListBLL merchantsJoinListBLL = new zlzw.BLL.MerchantsJoinListBLL();
         zlzw.Model.MerchantsJoinListModel merchantsJoinListModel = merchantsJoinListBLL.GetModel(int.Parse(Get_ID(merchantsJoinListBLL, strID)));
         labPublishName.Text = merchantsJoinListModel.PublishName;//发布人
         txbContent.Text = merchantsJoinListModel.MerchantsJoinConetnt;//发布内容
         ViewState["PublishDate"] = merchantsJoinListModel.PublisDate.ToString();
         ViewState["MerchantsJoinGUID"] = merchantsJoinListModel.MerchantsJoinGUID.ToString();
         ToolbarText2.Text = "编辑一条招商加盟";
     }
     btnClose.OnClientClick = ActiveWindow.GetConfirmHideReference();
 }
Пример #6
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.MerchantsJoinListBLL merchantsJoinListBLL = new zlzw.BLL.MerchantsJoinListBLL();
                System.Data.DataTable dt = merchantsJoinListBLL.GetList("MerchantsJoinGUID='" + strSelectID + "'").Tables[0];
                zlzw.Model.MerchantsJoinListModel merchantsJoinListModel = merchantsJoinListBLL.GetModel(int.Parse(dt.Rows[0]["MerchantsJoinID"].ToString()));
                merchantsJoinListModel.IsEnable = 0;
                merchantsJoinListBLL.Update(merchantsJoinListModel);
                MerchantsJoinList_BindGrid();

                #endregion
            }
            else
            {
                return;
            }
        }