//Update Order Data public static void UpdateOrder(int clientId, int storeId, int employeeId, DateTime orderTime, string orderType, string orderSpecifications, string description, string location, string status, string clientName, string storeName, string employeeName) { OrderModel data = new OrderModel { ClientId = clientId, StoreId = storeId, EmployeeId = employeeId, OrderTime = orderTime, OrderType = orderType, OrderSpecifications = orderSpecifications, Description = description, Location = location, Status = status, //------------------ ClientName = clientName, StoreName = storeName, EmployeeName = employeeName }; //create SQL Query string sql = @"Update dbo.[OrderLine] SET StoreId = @StoreId, EmployeeId = @EmployeeId, OrderTime = @OrderTime, OrderType = @OrderType, OrderSpecifications = @OrderSpecifications, Description = @Description Location = @Location, Status = @Status, ClientName = @ClientName, StoreName = @StoreName, EmployeeName = @EmployeeName WHERE ClientId = @ClientId;"; SqlDataAccess.UpdateData(sql, data); }
//Update Order Data public static void UpdateOrderLine(int orderLineId, int orderID, int partId, int serviceId, int lineNo, string lineDescription, int serviceQty, int partQty, string status, string orderNotes) { OrderLineModel data = new OrderLineModel { OrderLineId = orderLineId, OrderId = orderID, PartId = partId, ServiceId = serviceId, LineNo = lineNo, LineDescription = lineDescription, ServiceQty = serviceQty, PartQty = partQty, Status = status, OrderNotes = orderNotes }; //create SQL Query string sql = @"Update dbo.[OrderLine] SET OrderId = @OrderId, PartId = @PartId, ServiceId = @ServiceId, LineNo = @LineNo, LineDescription = @LineDescription, ServiceQty = @ServiceQty, PartQty = @PartQty, Status = @Status, OrderNotes = @OrderNotes Location = @Location, Status = @Status WHERE OrderLineId = @OrderLineId;"; SqlDataAccess.UpdateData(sql, data); }
public static int UpdateSozlesmePersonel(SozlesmeDatabaseModel SDM, List <PersonelDatabaseModel> PDM) { string SozlesmeSql = "UPDATE SOZLESME SET FIRMA = :FIRMA, TARIH= :TARIH,ARTI_EKSILIS = :ARTI_EKSILIS, BASLIK=:BASLIK,TALEP_TARIHI=:TALEP_TARIHI,TAMAMLANMA_TARIHI =:TAMAMLANMA_TARIHI WHERE SOZLESME_ID = :SOZLESME_ID"; string PersonelSql = "UPDATE PERSONEL SET ADAMSAAT = :ADAMSAAT,RATE= :RATE, SORUMLUYONETICI= :SORUMLUYONETICI, BOLGE=:BOLGE, KAYNAKTIPI=:KAYNAKTIPI WHERE SOZLESME_ID = :Sozlesme_Id AND PERSONEL_ID = :PERSONEL_ID "; return(SqlDataAccess.UpdateData(SDM, PDM, SozlesmeSql, PersonelSql)); }
public static int ActivateAccount(string emailAddress) { View data = new View { Data = emailAddress }; string sql = @"update dbo.Customer set UniqueCodeAccess='Cont Activat' where EmailAddress = @Data;"; return(SqlDataAccess.UpdateData(sql, data)); }
public static int UpdatePersonelAylikSaat(PersonelAylikSaat gerceklesen, PlanlananPersonelAylikSaat planlanan, FaturalananPersonelAylikSaat faturalanan) { string sqlGerceklesen = @"UPDATE AYLIKSAAT SET OCAK = :OCAK,SUBAT=:SUBAT,MART=:MART,NISAN=:NISAN,MAYIS=:MAYIS,HAZIRAN=:HAZIRAN,TEMMUZ=:TEMMUZ,AGUSTOS=:AGUSTOS,EYLUL=:EYLUL,EKIM=:EKIM,KASIM=:KASIM,ARALIK=:ARALIK WHERE PERSONEL_ID = :PERSONEL_ID"; string sqlPlanlanan = @"UPDATE PLANLANANAYLIKSAAT SET POCAK = :POCAK,PSUBAT=:PSUBAT,PMART=:PMART,PNISAN=:PNISAN,PMAYIS=:PMAYIS,PHAZIRAN=:PHAZIRAN,PTEMMUZ=:PTEMMUZ,PAGUSTOS=:PAGUSTOS,PEYLUL=:PEYLUL,PEKIM=:PEKIM,PKASIM=:PKASIM,PARALIK=:PARALIK WHERE PERSONEL_ID = :PERSONEL_ID"; string sqlFaturalanan = @"UPDATE FATURALANANAYLIKSAAT SET FOCAK = :FOCAK,FSUBAT=:FSUBAT,FMART=:FMART,FNISAN=:FNISAN,FMAYIS=:FMAYIS,FHAZIRAN=:FHAZIRAN,FTEMMUZ=:FTEMMUZ,FAGUSTOS=:FAGUSTOS,FEYLUL=:FEYLUL,FEKIM=:FEKIM,FKASIM=:FKASIM,FARALIK=:FARALIK WHERE PERSONEL_ID = :PERSONEL_ID"; SqlDataAccess.UpdateData <PersonelAylikSaat>(gerceklesen, sqlGerceklesen); SqlDataAccess.UpdateData <PlanlananPersonelAylikSaat>(planlanan, sqlPlanlanan); return(SqlDataAccess.UpdateData <FaturalananPersonelAylikSaat>(faturalanan, sqlFaturalanan)); }
public static int UpdateStatus(int Id, string Status) { View data = new View { Id = Id, Data = Status }; string sql = @"update dbo.Location set Collected= @Data where OrderId = @Id;"; return(SqlDataAccess.UpdateData(sql, data)); }
public static int UpdateQuantityColected(int id, int Q, int x) { View data = new View { Id = id, x = Q + x }; string sql = @"update dbo.Customer set QuantityColected= @x where Id = @Id;"; return(SqlDataAccess.UpdateData(sql, data)); }
public static int UpdatePersonelAylikSaatWithComboBox(AylikSaatComboBox model) { string month = Convert.ToString(model.ListMonths); string sql = $"UPDATE AYLIKSAAT SET {month} = :Value WHERE PERSONEL_ID = :id"; dynamic output = new { id = model.combobox_id, Value = model.Value, }; return(SqlDataAccess.UpdateData <dynamic>(output, sql)); }
public static void UpdateOneOrderLine(int orderLineId, int orderId, int?partId, int?serviceId, int lineNo, string lineDescription, int?serviceQty, int?partQty, string status, string orderNote, string partName, string serviceName) { //In case of the values being null sets the values var partId2 = (int?)partId; if (partId2 == null) { partId = 0; } var serviceId2 = (int?)serviceId; if (serviceId2 == null) { serviceId = 0; } OrderLineModel data = new OrderLineModel { OrderLineId = orderLineId, OrderId = orderId, PartId = partId, ServiceId = serviceId, LineNo = lineNo, LineDescription = lineDescription, ServiceQty = serviceQty, PartQty = partQty, Status = status, OrderNotes = orderNote, PartName = partName, ServiceName = serviceName }; //create SQL Query string sql = @"Update dbo.[OrderLine] SET OrderId = @OrderId, PartId = @PartId, ServiceId = @ServiceId, [LineNo] = @LineNo, LineDescription = @LineDescription, ServiceQty = @ServiceQty, PartQty = @PartQty, [Status] = @Status, OrderNotes = @OrderNotes WHERE OrderLineId = @OrderLineId;"; SqlDataAccess.UpdateData(sql, data); }
//Method to update Project public static void UpdateProject(int id, string name, string description)//will have to add deadline after getting it to work { //organize the data that will be added ProjectModel data = new ProjectModel { Id = id, Name = name, Description = description }; //create the sql command string sql = @" UPDATE dbo.project SET Name = @Name, Description = @Description WHERE Id = @Id"; //call the sql data access to delete the project entry SqlDataAccess.UpdateData(sql, data); }
//Method to update User public static void UpdateUsers(int id, string userName, string firstName, string lastName) { //organize the data that will be added UserModel data = new UserModel { Id = id, UserName = userName, FirstName = firstName, LastName = lastName }; //create the sql command string sql = @" UPDATE dbo.[User] SET UserName = @UserName, FirstName = @FirstName, LastName = @LastName WHERE Id = @Id"; //call the sql data access to delete the User entry SqlDataAccess.UpdateData(sql, data); }
//Method to update Tags public static void UpdateTags(int id, string tagDescription, string tagType, DateTime timeStamp) { //organize the data that will be added TagsModel data = new TagsModel { Id = id, TagDescription = tagDescription, TagType = tagType, TimeStamp = timeStamp }; //create the sql command string sql = @" UPDATE dbo.Tags SET TagDescription = @TagDescription, TagType = @TagType, TimeStamp = @TimeStamp WHERE Id = @Id"; //call the sql data access to delete the Tags entry SqlDataAccess.UpdateData(sql, data); }
//Update Store Data public static void UpdateStore(int storeId, string storeName, string storeAddress, string phoneNumber, string hoursOfOperation) { StoreModel data = new StoreModel { StoreId = storeId, StoreName = storeName, StoreAddress = storeAddress, PhoneNumber = phoneNumber, HoursOfOperation = hoursOfOperation }; //create SQL Query string sql = @"Update dbo.[Store] SET StoreName = @StoreName, StoreAddress = @StoreAddress, PhoneNumber = @PhoneNumber, HoursOfOperation = @HoursOfOperation WHERE StoreId = @StoreId;"; SqlDataAccess.UpdateData(sql, data); }
//Update Store Data public static void UpdateService(int serviceId, string serviceName, string serviceDescription, DateTime serviceDate, string status, string serviceType) { ServiceModel data = new ServiceModel { ServiceId = serviceId, ServiceName = serviceName, ServiceDescription = serviceDescription, ServiceDate = serviceDate, Status = status, ServiceType = serviceType }; //create SQL Query string sql = @"UPDATE dbo.[Service] SET ServiceName = @ServiceName, ServiceDescription = @ServiceDescription, ServiceDate = @ServiceDate, [Status] = @Status, ServiceType = @ServiceType WHERE ServiceId = @ServiceId;"; SqlDataAccess.UpdateData(sql, data); }
//Update Employee Data public static void UpdateEmployee(int employeeId, string userName, string firstName, string lastName, string location, string phoneNumber, string status) { EmployeeModel data = new EmployeeModel { EmployeeId = employeeId, UserName = userName, FirstName = firstName, LastName = lastName, Location = location, PhoneNumber = phoneNumber, Status = status }; //create SQL Query string sql = @"Update dbo.[Employee] SET UserName = @UserName, FirstName = @FirstName, LastName = @LastName, Location = @Location, PhoneNumber = @PhoneNumber, Status = @Status WHERE EmployeeId = @EmployeeId;"; SqlDataAccess.UpdateData(sql, data); }
//Update Client Data public static void UpdateClient(int clientId, string userName, string firstName, string lastName, string location, string phoneNumber, string status) { ClientModel data = new ClientModel { ClientId = clientId, UserName = userName, FirstName = firstName, LastName = lastName, Location = location, PhoneNumber = phoneNumber, Status = status }; //create SQL Query string sql = @"Update dbo.[Client] SET UserName = @UserName, FirstName = @FirstName, LastName = @LastName, Location = @Location, PhoneNumber = @PhoneNumber, Status = @Status WHERE ClientId = @ClientId;"; SqlDataAccess.UpdateData(sql, data); }
//Method to update Project public static void UpdateBug(int id, string description, string status, string details, string priorityLevel, int bugProjectId)//will have to add deadline after getting it to work { //organize the data that will be added BugModel data = new BugModel { Id = id, Description = description, Status = status, Details = details, PriorityLevel = priorityLevel, BugProjectId = bugProjectId }; //create the sql command string sql = @" UPDATE dbo.Bug SET Description = @Description, Status = @Status, Details = @Details, PriorityLevel = @PriorityLevel, BugProjectId = @BugProjectId WHERE Id =@Id"; //call the sql data access to delete the project entry SqlDataAccess.UpdateData(sql, data); }
//Update Part Data public static void UpdatePart(int partId, string partName, string partDescription, string partNumber, string partSupplier, decimal partCost, decimal partPrice, string partManufacturer) { PartModel data = new PartModel { PartId = partId, PartName = partName, PartDescription = partDescription, PartNumber = partNumber, //Make sure that the field are matched and ordered properly PartSupplier = partSupplier, PartCost = partCost, PartPrice = partPrice, PartManufacturer = partManufacturer }; //create SQL Query string sql = @"Update dbo.[Part] SET PartName = @PartName, PartDescription = @PartDescription, PartNumber = @PartNumber, PartSupplier = @PartSupplier, PartCost = @PartCost, PartPrice = @PartPrice, PartManufacturer = @PartManufacturer WHERE PartId = @PartId;"; SqlDataAccess.UpdateData(sql, data); }