Ejemplo n.º 1
0
        /// <summary>
        /// 选择弹
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void listView2_MouseClick(object sender, MouseEventArgs e)
        {
            ListViewHitTestInfo info = listView2.HitTest(e.X, e.Y);

            if (info.Item != null)
            {
                var    item    = info.Item as ListViewItem;
                string mag_num = item.Text.Substring(0, item.Text.IndexOf("\n"));
                if (item.ImageIndex == 2)
                {
                    item.ImageIndex = 3;
                    magazine_number.Remove(mag_num);
                    string mii = magazine_info_bll.GetModelByMagazineNum(mag_num).MAGAZINE_INFO_ID;
                    magazine_info_id.Remove(mii);
                    apply_bullet_qty.Remove(mii);
                }
                else
                {
                    item.ImageIndex = 2;
                    magazine_number.Add(mag_num);
                    Model.magazine_info mi = magazine_info_bll.GetModelByMagazineNum(mag_num);
                    string mii             = mi.MAGAZINE_INFO_ID;
                    magazine_info_id.Add(mii);
                    bullet_model.Add(mi.BULLET_MODEL);
                    //输入子弹数量
                    inputBulletQty ib = new inputBulletQty(mii);
                    ib.ShowDialog();
                    if (!apply_bullet_qty.ContainsKey(mii))
                    {
                        apply_bullet_qty.Add(mii, ib.BulletQty);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Gunark.Model.magazine_info model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Gunark.Model.magazine_info model)
 {
     return(dal.Add(model));
 }