/// <summary> /// dataGridView1格式化 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (e.ColumnIndex == 2) { if (e.Value.ToString() != "" && e.Value.ToString() != "null") { if (user_bll.Exists(e.Value.ToString())) { e.Value = user_bll.GetModel(e.Value.ToString()).USER_REALNAME; } } } if (e.ColumnIndex == 3 /*绑定数据源中列的序号*/) { if (object.Equals(e.Value, 1)) { e.Value = "申请弹仓"; } else if (object.Equals(e.Value, 2)) { e.Value = "枪弹入柜"; } else if (object.Equals(e.Value, 3)) { e.Value = "申请枪弹"; } else if (object.Equals(e.Value, 4)) { e.Value = "枪支封存"; } else if (object.Equals(e.Value, 5)) { e.Value = "枪支报废"; } else if (object.Equals(e.Value, 6)) { e.Value = "枪支保养"; } else if (object.Equals(e.Value, 7)) { e.Value = "枪支调拨"; } else if (object.Equals(e.Value, 8)) { e.Value = "紧急取枪弹"; } else if (object.Equals(e.Value, 9)) { e.Value = "枪弹检查"; } else if (object.Equals(e.Value, 10)) { e.Value = "枪支解封"; } else if (object.Equals(e.Value, 11)) { e.Value = "枪支寄存"; } else if (object.Equals(e.Value, 12)) { e.Value = "枪支解存"; } else if (object.Equals(e.Value, 13)) { e.Value = "快速取枪弹"; } else if (object.Equals(e.Value, 14)) { e.Value = "枪支点验"; } } if (e.ColumnIndex == 1 /*绑定数据源中列的序号*/) { if (object.Equals(e.Value, "1")) { e.Value = "申请"; } else if (object.Equals(e.Value, "2")) { e.Value = "审核"; } else if (object.Equals(e.Value, "3")) { e.Value = "审批完成"; } else if (object.Equals(e.Value, "4")) { e.Value = "拒绝"; } else if (object.Equals(e.Value, "5")) { e.Value = "进行中"; } else if (object.Equals(e.Value, "6")) { e.Value = "完成"; } else if (object.Equals(e.Value, "7")) { e.Value = "超期未还"; } } }
/// <summary> /// 下载指纹 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button2_Click(object sender, EventArgs e) { int count = 0; //获取选中的行数 for (int i = 0; i < dataGridView7.RowCount; i++) { if ((bool)dataGridView7.Rows[i].Cells[0].EditedFormattedValue) { count++; } } if (count <= 0) { MessageBox.Show("请选择人员!", "提示"); return; } if (MessageBox.Show(this, "您确定要下载么?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information).ToString() == "Yes") { Bll.user user_bll = new Gunark.BLL.user(); for (int i = 0; i < dataGridView7.RowCount; i++) { if ((bool)dataGridView7.Rows[i].Cells[0].EditedFormattedValue) { string userPoliceNum = dataGridView7.Rows[i].Cells[1].Value.ToString(); WebService.fingerUser[] fingerPrint_list = webService.getFingerUserInfo(userPoliceNum, user_bll.GetModel(userPoliceNum).UNITINFO_CODE); for(int j = 0;j<fingerPrint_list.Length;j++) { if (!fingerPrint_bll.ExistsByFingerPrintId(fingerPrint_list[j].fingerPrintId)) { Model.fingerprint fingerPrint = new Gunark.Model.fingerprint(); fingerPrint.USER_FINGERPRINT_ID = fingerPrint_list[j].fingerPrintId; fingerPrint.USER_POLICENUMB = fingerPrint_list[j].userPoliceNumb; fingerPrint.USER_NAME = fingerPrint_list[j].userName; fingerPrint.FINGER_NUMBER = fingerPrint_list[j].fingerNumber.ToString(); fingerPrint.UNIT_ID = fingerPrint_list[j].unitCode; fingerPrint.USER_FINGERPRINT = fingerPrint_list[j].userFingerPrint; fingerPrint.IS_UPDATE = 0; fingerPrint_bll.Add(fingerPrint); DownloadPrinter.download(fingerPrint); } } } } for (int i = dataGridView7.Rows.Count-1; i >= 0;i--) { if ((bool)dataGridView7.Rows[i].Cells[0].EditedFormattedValue) { finger_user_list.RemoveAt(i); } } dataGridView7.DataSource = null; dataGridView7.DataSource = finger_user_list; } }
/// <summary> /// 显示枪弹 /// </summary> private void Display() { /*---------------------------------------------------------------- *按照班组显示枪弹(显示验指纹的执勤民警那一组的枪弹) * 1)找到user对象 * 2)通过user对象找到组对象 * 3)查找枪、弹、组表,找出本组枪弹 * 4)显示枪、弹信息 * **----------------------------------------------------------------*/ string userid = PubFlag.policeNum; Model.user user = user_bll.GetModel(userid); List <Model.gbg> gbg_list = gbg_bll.GetModelList("GROUP_ID = '" + user.GROUP_ID + "'"); //枪的信息 this.listView1.View = View.LargeIcon; this.listView1.LargeImageList = this.imageList1; this.listView1.BeginUpdate(); for (int i = 0; i < gbg_list.Count; i++) { try { ListViewItem lvi = new ListViewItem(); string pos_num = gbg_list[i].GUN_LOCATION.ToString(); lvi.ImageIndex = 1; // 枪号找对应枪型 if (!"3".Equals(gun_position_info_bll.GetModelByGunPosNum(pos_num).GUN_POSITION_STATUS)) { continue; } lvi.Text = gbg_list[i].GUN_LOCATION + "\n" + gun_position_info_bll.GetModelByGunPosNum(pos_num).GUN_TYPE; this.listView1.Items.Add(lvi); } catch { continue; } } this.listView1.EndUpdate(); //弹的信息 this.listView2.View = View.LargeIcon; this.listView2.LargeImageList = this.imageList1; this.listView2.BeginUpdate(); for (int i = 0; i < gbg_list.Count; i++) { try { ListViewItem lvi = new ListViewItem(); lvi.ImageIndex = 3; // 弹仓号 if (gbg_list[i].BULLET_LOCATION != 0) { lvi.Text = gbg_list[i].BULLET_LOCATION.ToString() + "\n" + getBulletType(magazine_info_bll.GetModelByMagazineNum(gbg_list[i].BULLET_LOCATION.ToString()).BULLET_MODEL); } else { lvi.Text = (i + 1) + "\n" + getBulletType(magazine_info_bll.GetModelByMagazineNum((i + 1).ToString()).BULLET_MODEL); } this.listView2.Items.Add(lvi); } catch { continue; } } this.listView2.EndUpdate(); }