Exemplo n.º 1
0
        public void Save(BillBody body)
        {
            try
            {
                Helpers.NonQueryHelper.Insert(body, "spBillInsert", 5);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            //sqlText = "Insert into BillBody (billhead, articlname, quantity, unitofmeasureid, sum, pdv, description) values ( " + body.HeadId + ", '" + body.Articl + "', " + body.Quantity + ", " + body.UomID.ToString() + ", '" + Classes.MainHelper.DecimalForSql(body.Sum) + "', '" + Classes.MainHelper.DecimalForSql(body.Pdv) + "', '" + body.Description + "' )";
            //comm = new SqlCommand(sqlText, conn);

            //try
            //{
            //    if (conn.State == ConnectionState.Open)
            //        conn.Close();

            //    conn.Open();
            //    comm.ExecuteNonQuery();
            //    conn.Close();
            //}
            //catch (Exception ex)
            //{
            //    conn.Close();
            //    MessageBox.Show(ex.ToString());
            //}
        }
Exemplo n.º 2
0
 public void SetUomId(BillBody body, string uomName)
 {
     body.UomID = Helpers.ReaderHelper.SelectId("select id from Unitofmeasure where name = '" + uomName + "'");
 }