public ReportViewOverpricing(int id)
 {
     InitializeComponent();
     DataAccess da = new DataAccess();
     ItemID = id;
     Outgo = da.OverpricingGet(id);
 }
Ejemplo n.º 2
0
        public OverpricingEditView()
        {
            InitializeComponent();
            Item = new overpricing();
            Item.createdOn = DateTime.Now;
            Item.commited = false;
            Item.num = da.OverpricingGetMaxID();
            Item = da.OverpricingCreate(Item);

            ToDeleteOnClose = true;
        }
Ejemplo n.º 3
0
 public OverpricingEditView(int id)
 {
     InitializeComponent();
     Item = da.OverpricingGet(id);
 }
Ejemplo n.º 4
0
 private void Load()
 {
     if (Item == null)
     {
         // IS NEW
         //IsNew = true;
         Item = new overpricing();
         edtNumber.Text = da.OverpricingGetMaxID().ToString();
         edtDate.SelectedDate = DateTime.Now;
         edtPercentIncrease.Text = "0";
     }
     else
     {
         edtNumber.Text = Item.num.ToString();
         edtDate.SelectedDate = Item.createdOn.Value;
         edtPercentIncrease.Text = Item.increasePerc.ToString();
         CheckIfPosted();
     }
     LoadOfferings();
 }
Ejemplo n.º 5
0
        private overpricing getItemFromFields()
        {
            overpricing i = new overpricing();
            i.createdOn = edtDate.SelectedDate.Value;

            //i.description = edt
            int pers = 0;
            Int32.TryParse(edtPercentIncrease.Text, out pers);
            i.increasePerc = pers;
            return i;
        }
Ejemplo n.º 6
0
 /*
 int Save_OLD()
 {
     if (Item == null)
     {
         Item = new overpricing();
         Item.commited = 0;
         Item.description = "";
         Item.createdOn = edtDate.SelectedDate;
         int ip = 0;
         int.TryParse(edtPercentIncrease.Text, out ip);
         Item.increasePerc = ip;
         Item = da.OverpricingCreate(Item);
     }
     else
     {
         Item.createdOn = edtDate.SelectedDate;
         int ip = 0;
         int.TryParse(edtPercentIncrease.Text, out ip);
         Item.increasePerc = ip;
         Item = da.OverpricingEdit(Item);
     }
     return Item.id;
 }*/
 //void Fill()
 //{
 //    edtDate.SelectedDate = Item.createdOn.Value;
 //    edtNumber.Text = Item.id.ToString();
 //    edtPercentIncrease.Text = Item.increasePerc.ToString();
 //    CheckIfPosted();
 //}
 private void Fill(int ID)
 {
     Item = da.OverpricingGet(ID);
     edtDate.SelectedDate = Item.createdOn.Value;
     edtNumber.Text = Item.num.ToString();
     edtPercentIncrease.Text = Item.increasePerc.ToString();
     CheckIfPosted();
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Deprecated Method for adding a new object to the overpricings EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTooverpricings(overpricing overpricing)
 {
     base.AddObject("overpricings", overpricing);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Create a new overpricing object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 public static overpricing Createoverpricing(global::System.Int32 id)
 {
     overpricing overpricing = new overpricing();
     overpricing.id = id;
     return overpricing;
 }
Ejemplo n.º 9
0
        public overpricing OverpricingEdit(overpricing item)
        {
            overpricing original = objDataContext.overpricings.FirstOrDefault(b => b.id == item.id);
            if (original != null)
            {
                original.commited = item.commited;
                original.createdOn = item.createdOn;
                original.increasePerc = item.increasePerc;

                objDataContext.SaveChanges();
            }
            return original;
        }
Ejemplo n.º 10
0
 public overpricing OverpricingCreate(overpricing _obj)
 {
     objDataContext = new DriveEntities();
     objDataContext.AddTooverpricings(_obj);
     objDataContext.SaveChanges();
     return _obj;
 }