protected void lnk_Delete_Click(object sender, System.EventArgs e) { if (!base.IsAuthorizedOp(ActionType.Delete.ToString())) { base.ShowAjaxMsg(this.UpdatePanel1, "Không có thẩm quyền"); } else { int @int = WebUtils.GetInt((sender as LinkButton).CommandArgument); ExchangeApplyInfo dataById = ExchangeApply.GetDataById(@int); if (dataById == null) { base.ShowAjaxMsg(this.UpdatePanel1, "Những thông tin này không được tìm thấy, các dữ liệu không tồn tại hoặc đã bị xóa"); } else if (ExchangeApply.Delete(@int)) { this.BindData(); PageBase.log.AddEvent(base.LoginAccount.AccountName, string.Concat(new string[] { "删除订单[", dataById.OrderNo, "]的商品[", dataById.GoodsName, "]换货申请" })); base.ShowAjaxMsg(this.UpdatePanel1, "Thao tác thành công"); } else { base.ShowAjaxMsg(this.UpdatePanel1, "Thao tác thất bại"); } } }
private void BindData() { int recordCount = 0; int num = 0; string strSort = " AutoID DESC "; this.SinGooPager1.PageSize = WebUtils.GetInt(this.drpPageSize.SelectedValue); this.Repeater1.DataSource = ExchangeApply.GetPagerList(this.GetCondition(), strSort, this.SinGooPager1.PageIndex, this.SinGooPager1.PageSize, ref recordCount, ref num); this.Repeater1.DataBind(); this.SinGooPager1.RecordCount = recordCount; }
protected void Page_Load(object sender, System.EventArgs e) { if (!base.IsPostBack) { this.apply = ExchangeApply.GetDataById(base.OpID); if (this.apply != null) { this.bz.Text = this.apply.AdminRemark; if (this.apply.Status != 0) { this.btnok.Visible = false; this.btncancel.Visible = false; } } } }
protected void btn_DelBat_Click(object sender, System.EventArgs e) { if (!base.IsAuthorizedOp(ActionType.Delete.ToString())) { base.ShowAjaxMsg(this.UpdatePanel1, "Không có thẩm quyền"); } else { string repeaterCheckIDs = base.GetRepeaterCheckIDs(this.Repeater1, "chk", "autoid"); if (!string.IsNullOrEmpty(repeaterCheckIDs)) { if (ExchangeApply.Delete(repeaterCheckIDs)) { this.BindData(); PageBase.log.AddEvent(base.LoginAccount.AccountName, "批量删除换货申请成功"); base.ShowAjaxMsg(this.UpdatePanel1, "Thao tác thành công"); } else { base.ShowAjaxMsg(this.UpdatePanel1, "Thao tác thất bại"); } } } }
private void RemoveApplyInStudentGroups(List<KeyValuePair<Student, List<ExchangeApply>>> studentGroups,ExchangeApply apply) { for (int i = studentGroups.Count - 1; i >= 0; i--) { if (studentGroups[i].Key == apply.OwnerStudnet) { studentGroups[i].Value.Remove(apply); } } }
private ExchangeApply ParseApply(int rowNO, int projNameCol, int studentIdCol, int applySortCol, int studentAppliesCol) { Range row = _sheet.Rows[rowNO]; ApplyProject project = ParseProject(row, projNameCol); Student student = ParseStudent(row, studentIdCol, applySortCol, studentAppliesCol); ExchangeApply apply = new ExchangeApply(project, student); for (int colIndex = 1; colIndex < _columnCount; colIndex++) { Range cell = row.Cells[colIndex]; string infoValue = SheetHelper.GetCellText(cell); string infoName = _headRow.GetColumnName(colIndex); apply.AppendInfo(infoName, infoValue); } return apply; }
private void AppendBySort(List<ExchangeApply> applies, ExchangeApply apply) { int index = applies.Count -1; if (applies.Count == 0 || applies[index].CompareTo(apply) >= 0) { applies.Add(apply); } else { index -= 1; for (; index >= 0; index--) { if (applies[index].CompareTo(apply) >= 0) { applies.Insert(index + 1, apply); break; } } if (index < 0) { applies.Insert(0, apply); } } }
private void AppendByPriority(List<ExchangeApply> applies, ExchangeApply apply) { if (applies.Count == 0 || applies[applies.Count - 1].Priority < apply.Priority) { applies.Add(apply); } else { int index = applies.Count - 2; for (; index >= 0; index--) { if (applies[index].Priority < apply.Priority) { applies.Insert(index + 1, apply); break; } } if (index < 0) { applies.Insert(0, apply); } } }