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.StoreStatisticsListBLL storeStatisticsListBLL = new zlzw.BLL.StoreStatisticsListBLL(); zlzw.Model.StoreStatisticsListModal storeStatisticsListModal = storeStatisticsListBLL.GetModel(int.Parse(Get_StoreStatisticsID(strSelectID))); storeStatisticsListModal.IsEnable = 0; storeStatisticsListBLL.Update(storeStatisticsListModal); StoreStatisticsList_BindGrid(); #endregion } else { return; } }
protected void btnSaveRefresh_Click(object sender, EventArgs e) { if (Request.QueryString["Type"] == "1") { //编辑保存 zlzw.Model.StoreStatisticsListModal storeStatisticsListModal = new zlzw.Model.StoreStatisticsListModal(); storeStatisticsListModal.StoreDictionaryKey = drpStoreDictionaryKey.SelectedValue; storeStatisticsListModal.DictionaryKey = drpDictionaryKey.SelectedValue; if (txbStoreStatisticsDate.Text == "") { storeStatisticsListModal.StoreStatisticsDate = DateTime.Parse(ViewState["StoreStatisticsDate"].ToString()); } else { storeStatisticsListModal.StoreStatisticsDate = DateTime.Parse(txbStoreStatisticsDate.Text.ToString()); } storeStatisticsListModal.IndexValue = txbIndexValue.Text; storeStatisticsListModal.StoreStatisticsOrder = int.Parse(txbStoreStatisticsOrder.Text); storeStatisticsListModal.IsEnable = 1; storeStatisticsListModal.PublishDate = DateTime.Parse(ViewState["PublishDate"].ToString()); storeStatisticsListModal.StoreStatisticsGUID = new Guid(ViewState["StoreStatisticsGUID"].ToString()); storeStatisticsListModal.StoreStatisticsID = int.Parse(Get_StoreStatisticsID(Request.QueryString["value"])); zlzw.BLL.StoreStatisticsListBLL storeStatisticsListBLL = new zlzw.BLL.StoreStatisticsListBLL(); storeStatisticsListBLL.Update(storeStatisticsListModal); } else { //添加保存 zlzw.Model.StoreStatisticsListModal storeStatisticsListModal = new zlzw.Model.StoreStatisticsListModal(); storeStatisticsListModal.StoreDictionaryKey = drpStoreDictionaryKey.SelectedValue; storeStatisticsListModal.DictionaryKey = drpDictionaryKey.SelectedValue; storeStatisticsListModal.StoreStatisticsDate = DateTime.Parse(txbStoreStatisticsDate.Text.ToString()); storeStatisticsListModal.IndexValue = txbIndexValue.Text; storeStatisticsListModal.StoreStatisticsOrder = int.Parse(txbStoreStatisticsOrder.Text); storeStatisticsListModal.IsEnable = 1; storeStatisticsListModal.PublishDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")); storeStatisticsListModal.StoreStatisticsGUID = System.Guid.NewGuid(); zlzw.BLL.StoreStatisticsListBLL storeStatisticsListBLL = new zlzw.BLL.StoreStatisticsListBLL(); storeStatisticsListBLL.Add(storeStatisticsListModal); } // 2. Close this window and Refresh parent window PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); }