/// <summary> /// 删除数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void RemoveData(object sender, CommandEventArgs e) { if (!string.IsNullOrEmpty(e.CommandArgument.ToString())) //判断是否有Id值 { CustomerTradeCode _CustomerTradeCode = new CustomerTradeCode(); _CustomerTradeCode.CB04001 = Convert.ToInt32(e.CommandArgument.ToString()); _CustomerTradeCode.CB04997 = 1; int num = Math.Abs(_CustomerBLL.RemoveCustomerTradeCode(_CustomerTradeCode)); new Sinoo.Common.MessageShow().RemoveMessage(this.Page, num, string.Empty); if (num < 1) { return; } int CurrentPageIndex = this.AspNetPager1.CurrentPageIndex; //当前页 int PageCount = this.AspNetPager1.PageCount; //页总数 int RecordCount = this.AspNetPager1.RecordCount; //记录数 int PageSize = this.AspNetPager1.PageSize; //第页条数 int PageIndex = CurrentPageIndex == PageCount ? (PageCount * PageSize - RecordCount == (PageSize - 1) ? CurrentPageIndex - 1 : CurrentPageIndex) : CurrentPageIndex; InitData(PageIndex); } }
/// <summary> /// 保存数据 /// </summary> private void SaveData() { if (!string.IsNullOrEmpty(this.txtCB04002.Text)) { CustomerTradeCode _CustomerTradeCode = new CustomerTradeCode(); _CustomerTradeCode.CB04002 = this.txtCB04002.Text.Trim(); _CustomerTradeCode.CB04003 = Convert.ToInt32(this.drpCB04003.SelectedValue); _CustomerTradeCode.CB04005 = this.txtCB04005.Text.Trim(); int num = Math.Abs(_CustomerBLL.InsertCustomerTradeCode(_CustomerTradeCode)); //执行新增操作 new Sinoo.Common.MessageShow().InsertMessage(this, num, "DataClear();"); } }
/// <summary> /// 保存数据 /// </summary> private void SaveData() { if (!string.IsNullOrEmpty(this.txtCB04002.Text)) { CustomerTradeCode _CustomerTradeCode = new CustomerTradeCode(); _CustomerTradeCode.CB04001 = Convert.ToInt32(Request.QueryString["CB04001"]); _CustomerTradeCode.CB04002 = this.txtCB04002.Text.Trim(); _CustomerTradeCode.CB04003 = Convert.ToInt32(this.drpCB04003.SelectedValue); _CustomerTradeCode.CB04005 = this.txtCB04005.Text.Trim(); int num = Math.Abs(_CustomerBLL.UpdateCustomerTradeCode(_CustomerTradeCode)); //执行更新操作 new Sinoo.Common.MessageShow().UpdateMessage(this , num , string.Format("location.href='{0}'", LinkReturn())); } }
/// <summary> /// 删除客户行业代码资料数据 /// </summary> /// <param name="_CB04">实体类</param> /// <returns>结果数据</returns> public int RemoveCustomerTradeCode(CustomerTradeCode _CustomerTradeCode) { try { int num = Provider.ExecuteNonQuery("PRO_CB04", 1, new SqlParameter[] { new SqlParameter() { ParameterName = @"CB04001", Value = _CustomerTradeCode.CB04001, DbType = DbType.Int32 }, new SqlParameter() { ParameterName = @"CB04002", Value = "", DbType = DbType.String }, new SqlParameter() { ParameterName = @"CB04003", Value = 0, DbType = DbType.Int32 }, new SqlParameter() { ParameterName = @"CB04005", Value = "", DbType = DbType.String }, new SqlParameter() { ParameterName = @"CB04997", Value = _CustomerTradeCode.CB04997, DbType = DbType.Int32 }, new SqlParameter() { ParameterName = @"Order", Value = "CB04_Remove", DbType = DbType.String } }); return(num); } catch (Exception ex) { throw ex; } }