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

            try
            {
                if (DATA_DISPLINE == null)
                {
                    DATA_DISPLINE = new SortedList <int, MTOMS.ic.displineC>();
                }
                if (DATA_DISPLINE.Keys.Count > 0)
                {
                    return;
                }
                using (var _dr = xd.SelectCommand(_str))
                {
                    ic.displineC obj = null;
                    while (_dr.Read())
                    {
                        obj        = new MTOMS.ic.displineC();
                        obj.un_id  = _dr["un_id"].ToInt32();
                        obj.mem_id = _dr["mem_id"].ToInt32();
                        //obj.cat_id = _dr["cat_id"].ToInt32();
                        obj.reason     = _dr["reason"] == null ? string.Empty : _dr["reason"].ToStringNullable();
                        obj.start_date = Convert.ToDateTime(_dr["start_date"]);
                        obj.end_date   = Convert.ToDateTime(_dr["end_date"]);
                        //obj.action = _dr["action"] == null ? string.Empty : _dr["action"].ToStringNullable();
                        //obj.e_date = Convert.ToDateTime(_dr["edate"]);
                        obj.pc_us_id = _dr["pc_us_id"].ToInt32();
                        //obj.pc_us_name = _dr["pc_us_name"].ToStringNullable();
                        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_DISPLINE.Add(obj.un_id, 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
 public bool save_Mem_displine(ic.displineC obj, ref xing xd)
 {
     if (xd == null)
     {
         return(false);
     }
     if (obj == null)
     {
         return(false);
     }
     String[] tb_col = null;
     object[] _row   = null;
     tb_col = new String[]
     {
         "mem_id", "cat_id", "reason", "start_date", "end_date",
         "action", "edate", "exp_type", "pc_us_id", "pc_us_name",
         "lch_id", "lch_type_id"
     };
     _row = new object[]
     {
         #region
         obj.mem_id,
         obj.cat_id,
         obj.reason,
         obj.start_date,
         obj.end_date,
         obj.action,
         obj.e_date,
         emm.export_type.insert,
         obj.pc_us_id,
         obj.pc_us_name,
         obj.lch_id,
         obj.lch_type_id,
         #endregion
     };
     xd.SingleInsertCommand("discpline_tb", tb_col, _row);
     return(true);
 }