private void btnBillAdd_Click(object sender, EventArgs e) { selection1.ClearSelection(); selection2.ClearSelection(); FrmClientTuoShouJCAdd frm = new FrmClientTuoShouJCAdd("0"); frm.Text = "市县客户托收单增加"; frm.Tag = "JC_KHTSD_ADD"; if (frm.ShowDialog() == DialogResult.OK) { unitOfWork1.DropIdentityMap(); xpServerCollectionSource1.Reload(); } }
private void btnBillAlter_Click(object sender, EventArgs e) { bool check = false; if (selection1.SelectedCount == 0) { check = false; MessageBox.Show("请选择要修改的采购销售单"); } else if (selection1.SelectedCount != 1) { check = false; MessageBox.Show("每次只能修改一张采购销售单"); } else { check = true; } if (check == true) { bool fgshowfrom = false; int RowIndex = selection1.GetSelectedRowIndex(0); int RowHandle = gridView1.GetRowHandle(RowIndex); string strZT = gridView1.GetRowCellDisplayText(RowHandle, colZT).ToString().Trim(); string strZTID = gridView1.GetRowCellValue(RowHandle, colZTID).ToString(); string strXSTSDID = gridView1.GetRowCellValue(RowHandle, colXSTSDID).ToString(); string strCZYID = gridView1.GetRowCellDisplayText(RowHandle, colCZYID).ToString().Trim(); if (strZT != "02") { fgshowfrom = false; MessageBox.Show("只有存盘状态下的结算单才可以被修改"); } else if (strZTID != FrmLogin.getZTID.ToString()) { fgshowfrom = false; MessageBox.Show("只有自己帐套下的结算单才可以被修改"); } else if (strCZYID != FrmLogin.getUserID.ToString()) { fgshowfrom = false; MessageBox.Show("只有自己新建的结算单才可以被修改"); } else { fgshowfrom = true; } if (fgshowfrom == true) { FrmClientTuoShouJCAdd frm = new FrmClientTuoShouJCAdd(strXSTSDID); frm.Text = "市县——客户托收单——修改"; frm.Tag = "JC_KHTSD_ALTER"; if (frm.ShowDialog() == DialogResult.OK) { selection1.ClearSelection(); SelectCountClear(); unitOfWork1.DropIdentityMap(); xpServerCollectionSource1.Reload(); gridView1.BestFitColumns(); } } } }