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());
        }
Ejemplo n.º 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.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;
            }
        }