Пример #1
0
        private static void fill_mem_death(ref xing xd)
        {
            string _str = "select * from death_tb";

            try
            {
                if (DATA_DEATH == null)
                {
                    DATA_DEATH = new SortedList <int, MTOMS.ic.deathC>();
                }
                if (DATA_DEATH.Keys.Count > 0)
                {
                    return;
                }
                using (var _dr = xd.SelectCommand(_str))
                {
                    ic.deathC obj = null;
                    while (_dr.Read())
                    {
                        obj             = new MTOMS.ic.deathC();
                        obj.un_id       = _dr["un_id"].ToInt32();
                        obj.mem_id      = _dr["mem_id"].ToInt32();
                        obj.reason      = _dr["death_cause"] == null ? string.Empty : _dr["death_cause"].ToStringNullable();
                        obj.comment     = _dr["comment"] == null ? string.Empty : _dr["comment"].ToStringNullable();
                        obj.death_date  = _dr.GetMySqlDateTime("death_date").Value;
                        obj.death_fs_id = fn.GetFSID(obj.death_date);
                        obj.pc_us_id    = _dr["pc_us_id"].ToInt32();
                        if (_dr["lch_id"] != null)
                        {
                            obj.lch_id = _dr["lch_id"].ToInt32();
                        }
                        if (_dr["lch_type_id"] != null)
                        {
                            obj.lch_type_id = _dr["lch_type_id"].ToInt32();
                        }
                        DATA_DEATH.Add(obj.un_id, obj);
                        datam.DATA_MEMBER[obj.mem_id].objDeath = obj;
                    }
                    _dr.Close(); _dr.Dispose();
                }
            }
            catch (VistaDB.Diagnostic.VistaDBException ex)
            {
                MessageBox.Show(ex.Message);
                throw new Exception("Data Loading Failed");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #2
0
        private void buttonsave_Click(object sender, EventArgs e)
        {
            string _str = "Are You Sure You Want To Proceed With This Operation ??";

            if (!dbm.WarningMessage(_str, "Death Transfer Warning"))
            {
                return;
            }
            ic.deathC _tc = new MTOMS.ic.deathC();

            string[] _cols = new string[]
            {
                "mem_id",
                "cat_id",
                "death_cause",
                "comment",
                "death_date",
                "death_fs_id",
                "edate",
                "pc_us_id",
                "exp_type",
                "lch_id",
                "lch_type_id"
            };
            object[] _row = new object[]
            {
                _tc.mem_id = mem_obj.mem_id,
                0,
                _tc.reason      = fnn.GetIGridCellValue(fGrid, "cause", "desc"),
                _tc.comment     = fnn.GetIGridCellValue(fGrid, "comment", "desc"),
                _tc.death_date  = Convert.ToDateTime(fGrid.Rows["death_date"].Cells["desc"].AuxValue),
                _tc.death_fs_id = fn.GetFSID(_tc.death_date),
                datam.CURR_DATE,
                datam.PC_US_ID,
                emm.export_type.insert.ToByte(),
                _tc.lch_id      = datam.LCH_ID,
                _tc.lch_type_id = datam.LCH_TYPE_ID
            };
            using (xing xd = new xing())
            {
                _tc.un_id = xd.SingleInsertCommandInt("death_tb", _cols, _row);
                xd.InsertUpdateDelete(string.Format("update member_tb set mem_status_type_id={0},{1},pc_us_id={2} where mem_id={3}", em.xmem_status.Deceased.ToByte(), dbm.ETS, datam.PC_US_ID, mem_obj.mem_id));
                xd.CommitTransaction();
            }
            datam.DATA_DEATH.Add(_tc.un_id, _tc);
            mem_obj.mem_status_id = em.xmem_status.Deceased.ToByte();
            mem_obj.objDeath      = _tc;
            this.Close();
        }