Exemplo n.º 1
0
        /// <summary>
        /// Create a new CurrencyRef object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        /// <param name="code">Initial value of the code property.</param>
        /// <param name="name">Initial value of the name property.</param>
        /// <param name="nominal">Initial value of the nominal property.</param>
        /// <param name="numcode">Initial value of the numcode property.</param>
        /// <param name="charcode">Initial value of the charcode property.</param>
        public static CurrencyRef CreateCurrencyRef(global::System.Int32 id, global::System.String code, global::System.String name, global::System.Decimal nominal, global::System.Int32 numcode, global::System.String charcode)
        {
            CurrencyRef currencyRef = new CurrencyRef();

            currencyRef.Id       = id;
            currencyRef.code     = code;
            currencyRef.name     = name;
            currencyRef.nominal  = nominal;
            currencyRef.numcode  = numcode;
            currencyRef.charcode = charcode;
            return(currencyRef);
        }
Exemplo n.º 2
0
        override public string create()
        {
            var dr = js.Deserialize <JSONCreateRefObj>(postbody);

            foreach (JSONCurrencyReference dc in dr.data)
            {
                CurrencyRef refr = DataManager.getInstance().creatCurrencyRef();
                refr.nominal  = dc.nominal;
                refr.name     = dc.name;
                refr.numcode  = dc.numcode;
                refr.code     = dc.code;
                refr.charcode = dc.charcode;
                dc.id         = DataManager.getInstance().addCurrencyRefNoCommit(refr);
            }
            DataManager.getInstance().commit();
            dr.success = true;
            return(js.Serialize(dr));
        }
Exemplo n.º 3
0
        override public string create()
        {
            DataManager.getInstance().clearDB();
            var refDataSetTable = di.EnumValutes(false).Tables[0];

            for (int i = 0; i < refDataSetTable.Rows.Count; i++)
            {
                CurrencyRef cr = DataManager.getInstance().creatCurrencyRef();
                cr.code     = ((String)refDataSetTable.Rows[i].ItemArray.GetValue(0)).Trim();
                cr.name     = ((String)refDataSetTable.Rows[i].ItemArray.GetValue(1)).Trim();
                cr.nominal  = ((Decimal)refDataSetTable.Rows[i].ItemArray.GetValue(3));
                cr.numcode  = ((Int32)refDataSetTable.Rows[i].ItemArray.GetValue(5));
                cr.charcode = ((String)refDataSetTable.Rows[i].ItemArray.GetValue(6));
                DataManager.getInstance().addCurrencyRefNoCommit(cr);
            }
            DataManager.getInstance().commit();

            return("Success");
        }
Exemplo n.º 4
0
        override public string update()
        {
            JSONCreateRefObj dr = js.Deserialize <JSONCreateRefObj>(postbody);

            foreach (JSONCurrencyReference dc in dr.data)
            {
                CurrencyRef refr = DataManager.getInstance().getCurrencyRefById(dc.id);
                refr.nominal  = dc.nominal;
                refr.name     = dc.name;
                refr.numcode  = dc.numcode;
                refr.code     = dc.code;
                refr.charcode = dc.charcode;
                dr.results++;
            }

            DataManager.getInstance().commit();
            dr.success = true;
            return(js.Serialize(dr));
        }
Exemplo n.º 5
0
        public void removeCurrencyRefById(int id)
        {
            CurrencyRef refr = this.getCurrencyRefById(id);

            dmc.DeleteObject(refr);
        }
Exemplo n.º 6
0
 public int addCurrencyRefNoCommit(CurrencyRef refrence)
 {
     dmc.AddToCurrencyRefSet(refrence);
     return(refrence.Id);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Deprecated Method for adding a new object to the CurrencyRefSet EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCurrencyRefSet(CurrencyRef currencyRef)
 {
     base.AddObject("CurrencyRefSet", currencyRef);
 }