private void btnAddRow_Click(object sender, EventArgs e) { SalesConsultantDto loss = new SalesConsultantDto(); List <SalesConsultantDto> inspectionList = grcSaleContant.DataSource as List <SalesConsultantDto>; DataSet ds = service.SearchSalesConsultanMaxSeqNO(CommonHandler.GetComboBoxSelectedValue(cboProject).ToString(), _shopCode); int seqNO = 0; if (ds != null && ds.Tables[0].Rows.Count > 0) { seqNO = Convert.ToInt32(ds.Tables[0].Rows[0]["SeqNO"]); } if (seqNO == 0) { loss.SeqNO = 1; } else { foreach (SalesConsultantDto inp in inspectionList) { if (Convert.ToInt32(inp.SeqNO) > seqNO) { seqNO = inp.SeqNO; } } loss.SeqNO = seqNO + 1; } dataHandler.AddRow(loss); }
private void SearchSaleContant() { List <SalesConsultantDto> sourcechapterList = new List <SalesConsultantDto>(); string projectCode = CommonHandler.GetComboBoxSelectedValue(cboProject).ToString(); DataSet ds = service.SearchSalesConsultant(projectCode, _shopCode, txtSubjectCode.Text, _memberType); if (ds.Tables.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { SalesConsultantDto chapter = new SalesConsultantDto(); chapter.SeqNO = Convert.ToInt32(ds.Tables[0].Rows[i]["SeqNO"]); chapter.SalesConsultant = Convert.ToString(ds.Tables[0].Rows[i]["SalesConsultant"]); if (ds.Tables[0].Rows[i]["Score"] == DBNull.Value) { if (string.IsNullOrEmpty(txtFullScore.Text)) { chapter.Score = null; } else { chapter.Score = Convert.ToDecimal(txtFullScore.Text); } //chapter.Notinvolved = false; } else { //if (Convert.ToDecimal(ds.Tables[0].Rows[i]["Score"]) == 9999) //{ // chapter.Notinvolved = true; // chapter.Score = null; //} //else //{ chapter.Score = Convert.ToDecimal(ds.Tables[0].Rows[i]["Score"]); chapter.Notinvolved = false; //} } chapter.LossDesc = Convert.ToString(ds.Tables[0].Rows[i]["LossDesc"]); sourcechapterList.Add(chapter); } grcSaleContant.DataSource = sourcechapterList; if (_memberType == "01") { gridColumn2.Caption = "顾问名称"; } else { gridColumn2.Caption = "接待人员名称"; } } }
private void btnLossDescDetail_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { SalesConsultantDto sales = grvSaleContant.GetFocusedRow() as SalesConsultantDto; if (sales.StatusType == 'I' || sales.StatusType == 'U') { CommonHandler.ShowMessage(MessageType.Information, "请先保存"); return; } panelControl2.Visible = true; SalesConsultantDto sale = grvSaleContant.GetRow(grvSaleContant.FocusedRowHandle) as SalesConsultantDto; _fatherSeqNO = sale.SeqNO; SearchLossDesc(sale.LossDesc); }
private void SearchRecheckDtl() { string projectCode = CommonHandler.GetComboBoxSelectedValue(cboProject).ToString(); string shopCode = btnShopCode.Text; List <SalesConsultantDto> reCheckDtlList = new List <SalesConsultantDto>(); DataSet ds = webService.SearchSalesConsultantReport(projectCode, shopCode, ""); if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { SalesConsultantDto reCheckDtl = new SalesConsultantDto(); reCheckDtl.ProjectCode = Convert.ToString(ds.Tables[0].Rows[i]["ProjectCode"]); reCheckDtl.SubjectCode = Convert.ToString(ds.Tables[0].Rows[i]["SubjectCode"]); reCheckDtl.ShopCode = Convert.ToString(ds.Tables[0].Rows[i]["ShopCode"]); reCheckDtl.ShopName = Convert.ToString(ds.Tables[0].Rows[i]["ShopName"]); if (ds.Tables[0].Rows[i]["Score"] == DBNull.Value) { reCheckDtl.ScoreStr = "/"; } else { reCheckDtl.ScoreStr = Convert.ToString(ds.Tables[0].Rows[i]["Score"]); } reCheckDtl.SeqNO = Convert.ToInt32(ds.Tables[0].Rows[i]["SeqNO"]); reCheckDtl.SalesConsultant = Convert.ToString(ds.Tables[0].Rows[i]["SalesConsultant"]); reCheckDtl.LossDesc = Convert.ToString(ds.Tables[0].Rows[i]["LossDesc"]); reCheckDtl.MemberType = Convert.ToString(ds.Tables[0].Rows[i]["MemberType"]); reCheckDtlList.Add(reCheckDtl); } grcReCheckDtl.DataSource = reCheckDtlList; } else { CommonHandler.ShowMessage(MessageType.Information, "没有数据"); grcReCheckDtl.DataSource = null; } }
private void grvSaleContant_ShowingEditor(object sender, CancelEventArgs e) { SalesConsultantDto sales = grvSaleContant.GetFocusedRow() as SalesConsultantDto; if (sales.Notinvolved == true) { grvSaleContant.SetRowCellValue(grvSaleContant.FocusedRowHandle, gcScore, ""); if (grvSaleContant.FocusedColumn == gcScore) { CommonHandler.ShowMessage(MessageType.Information, "如果需要修改,请先去掉勾选"); e.Cancel = true; } else { e.Cancel = false; } } else { e.Cancel = false; } }