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; } }
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()); }