//=========================================================================== public void add_operation_supplier_give(int sid, float getValue, string date) { operations_supplier op = new operations_supplier(); if (date != null && date != "") { op.date = date; op.date = DateTime.Parse(date).ToString("dd/MM/yyyy"); } else { op.date = DateTime.Now.ToString("dd/MM/yyyy"); } op.opType = "سداد"; op.supId = sid; op.debtor = getValue; op.charg = DB.supplier.Where(s => s.id == sid).Single().charge; DB.operations_supplier.Add(op); DB.SaveChanges(); }
//=============================================== public void add_supplier_operation(string date, int supplierId, float creditorValue) { operations_supplier op = new operations_supplier(); if (date != null && date != "") { op.date = date; op.date = DateTime.Parse(date).ToString("dd/MM/yyyy"); } else { op.date = DateTime.Now.ToString("dd/MM/yyyy"); } op.opType = "مشتريات"; op.supId = supplierId; op.creditor = creditorValue; op.charg = DB.supplier.Where(s => s.id == supplierId).Single().charge; DB.operations_supplier.Add(op); DB.SaveChanges(); }