private void Button_反审核_Click(object sender, RoutedEventArgs e) { if (this.DataGrid_本期凭证.SelectedCells.Count != 0) { this.StackPanel_MoreButton.Visibility = System.Windows.Visibility.Collapsed; if (vsy.ValidateRuning() == false) { MessageBoxCommon.Show("试用期已过,不能使用此功能!"); return; } if (CommonInfo.权限值 >= 2) { bool?result = MessageBoxDel.Show("注意", "确认反审核凭证?"); if (result == false) { return; } Model_凭证管理 asd = this.DataGrid_本期凭证.SelectedCells[0].Item as Model_凭证管理; new PA.ViewModel.ViewModel_凭证管理().UnReview(asd.ID); ReflashData(); } else { MessageBoxCommon.Show("您的权限不够,不能进行审核!"); } } else { MessageBoxCommon.Show("请先选择数据"); } }
private void Button_打印_Click(object sender, RoutedEventArgs e) { this.StackPanel_MoreButton.Visibility = System.Windows.Visibility.Collapsed; if (this.DataGrid_本期凭证.SelectedCells.Count != 0) { Model_凭证管理 asd = this.DataGrid_本期凭证.SelectedCells[0].Item as Model_凭证管理; new PA.Helper.ExcelHelper.ExcelWriter().ExportVouchers(asd.ID); } }
private void DataGrid_本期凭证_Row_MouseDoubleClick(object sender, RoutedEventArgs e) { if (this.DataGrid_本期凭证.SelectedCells.Count != 0) { Model_凭证管理 asd = this.DataGrid_本期凭证.SelectedCells[0].Item as Model_凭证管理; Guid guid = asd.ID; PA.View.Windows.Win_记账凭证 win = new PA.View.Windows.Win_记账凭证(guid); win.ShowDialog(); } }
private void Button_Del_Click(object sender, RoutedEventArgs e) { if (this.DataGrid_本期凭证.SelectedCells.Count != 0) { bool?result = MessageBoxDel.Show("注意", "确认删除数据?"); if (result == true) { Model_凭证管理 asd = this.DataGrid_本期凭证.SelectedCells[0].Item as Model_凭证管理; new PA.ViewModel.ViewModel_凭证管理().Delete(asd.ID); ReflashData(); } } }
private void Button_Review_Click(object sender, RoutedEventArgs e) { if (vsy.ValidateRuning() == false) { MessageBoxCommon.Show("试用期已过,不能使用此功能!"); return; } if (this.DataGrid_本期凭证.SelectedCells.Count != 0) { if (CommonInfo.权限值 >= 1) { Model_凭证管理 asd = this.DataGrid_本期凭证.SelectedCells[0].Item as Model_凭证管理; new PA.ViewModel.ViewModel_凭证管理().Review(asd.ID); ReflashData(); } else { MessageBoxCommon.Show("您的权限不够,不能进行审核!"); } } }
/// <summary> /// 凭证管理 /// </summary> /// <param name="whereParm"></param> /// <returns></returns> internal List <Model_凭证管理> GetData(string whereParm) { List <Model_凭证管理> datas = new List <Model_凭证管理>(); Guid LastID = Guid.Empty; Model_凭证管理 LastData = new Model_凭证管理(); string sql = "SELECT " + "voucher.ID," + "detail.VOUCHER_NO," + "voucher.OP_TIME," + "detail.ABSTRACT," + "detail.SUBJECT_ID," //科目编号 //+ "detail.DETAIL,"//子细目编号 + "subject.subject_name," //科目名 + "detail.DEBIT," + "detail.CREDIT," + "voucher.PERIOD," + "voucher.REVIEW_MARK" + " FROM " + DBTablesName.T_VOUCHER + " voucher," + DBTablesName.T_VOUCHER_DETAIL + " detail " + " LEFT JOIN " + DBTablesName.T_SUBJECT + " subject ON detail.SUBJECT_ID = subject.subject_id" + " WHERE " + "voucher.ID = detail.PARENTID and DELETE_MARK=0 " + whereParm + " ORDER BY " + "voucher.PERIOD,voucher.OP_TIME,detail.VOUCHER_NO"; DataSet ds = db.Query(sql); foreach (DataRow dr in ds.Tables[0].Rows) { if (LastID != Guid.Parse(dr[0].ToString())) //新凭证 { if (LastID != Guid.Empty) { datas.Add(LastData); } LastID = Guid.Parse(dr[0].ToString()); Model_凭证管理 data = new Model_凭证管理(); LastData = data; LastData.ID = Guid.Parse(dr[0].ToString()); LastData.凭证号 = dr[1].ToString(); LastData.制表时间 = Convert.ToDateTime(dr[2]).ToString(DateFormat); LastData.摘要 = dr[3].ToString(); LastData.科目编号 = dr[4].ToString(); LastData.科目名称 = dr[5].ToString(); LastData.借方金额 = (dr[6].ToString() == "0") ? "" : dr[6].ToString(); LastData.贷方金额 = (dr[7].ToString() == "0") ? "" : dr[7].ToString(); LastData.当前期数 = dr[8].ToString(); LastData.审核状态 = (dr[9].ToString() == "0")?"未审核":"已审核"; } else //旧凭证 { LastData.凭证号 += "\n" + dr[1].ToString(); LastData.摘要 += "\n" + dr[3].ToString(); LastData.科目编号 += "\n" + dr[4].ToString(); LastData.科目名称 += "\n" + dr[5].ToString(); LastData.借方金额 += "\n" + ((dr[6].ToString() == "0") ? "" : dr[6].ToString()); LastData.贷方金额 += "\n" + ((dr[7].ToString() == "0") ? "" : dr[7].ToString()); } } if (ds.Tables[0].Rows.Count != 0) { datas.Add(LastData); } return(datas); }