public int UpdateOperationSchedule(OperationSchedule aOperationSchedule) { Query = "UPDATE OperationSchedule SET OtDate=@OtDate,OPID=@OPID,CabinBed=@CabinBed,PatientName=@PatientName,FirstAssist=@FirstAssist,SurgeonName=@SurgeonName,SecondAssist=@SecondAssist,Anaesthesiologist=@Anaesthesiologist,OperationName=@OperationName,OperationTime=@OperationTime,ToTime=@ToTime,UserId=@UserId WHERE OtRefNo='" + aOperationSchedule.OtRefNo + "'"; Command = new SqlCommand(Query, Connection); Command.CommandType = CommandType.Text; // Command.Parameters.AddWithValue("@OtRefNo", aOperationSchedule.OtRefNo??""); Command.Parameters.AddWithValue("@OtDate", aOperationSchedule.OtDate); Command.Parameters.AddWithValue("@OPID", aOperationSchedule.Opid ?? ""); Command.Parameters.AddWithValue("@CabinBed", aOperationSchedule.CabinBed ?? ""); Command.Parameters.AddWithValue("@PatientName", aOperationSchedule.PatientName ?? ""); Command.Parameters.AddWithValue("@FirstAssist", aOperationSchedule.FirstAssist ?? ""); Command.Parameters.AddWithValue("@SurgeonName", aOperationSchedule.SurgeonName ?? ""); Command.Parameters.AddWithValue("@SecondAssist", aOperationSchedule.SecondAssist ?? ""); Command.Parameters.AddWithValue("@Anaesthesiologist", aOperationSchedule.Anaesthesiologist ?? ""); Command.Parameters.AddWithValue("@OperationName", aOperationSchedule.OperationName ?? ""); Command.Parameters.AddWithValue("@OperationTime", aOperationSchedule.OperationTime); Command.Parameters.AddWithValue("@ToTime", aOperationSchedule.ToTime); Command.Parameters.AddWithValue("@UserId", MainWindow.userName); int rowAffect = Command.ExecuteNonQuery(); return(rowAffect); }
public int DeleteOperationSchedule(OperationSchedule aOperationSchedule) { Query = "DELETE OperationSchedule WHERE OtRefNo=@Id"; Command = new SqlCommand(Query, Connection); Command.CommandType = CommandType.Text; Command.Parameters.AddWithValue("@Id", aOperationSchedule.OtRefNo); int rowAffect = Command.ExecuteNonQuery(); return(rowAffect); }
public MessageModel DeleteOperationSchedule(OperationSchedule aOperationSchedule) { MessageModel aMessageModel = new MessageModel(); if (aOperationScheduleGateway.DeleteOperationSchedule(aOperationSchedule) > 0) { aMessageModel.MessageTitle = "Successfull"; aMessageModel.MessageBody = "Operaiton Schedule Deleted successfully!"; } return(aMessageModel); }
public MessageModel UpdateOperationSchedule(OperationSchedule operationSchedule) { MessageModel aMessageModel = new MessageModel(); if (aOperationScheduleGateway.UpdateOperationSchedule(operationSchedule) > 0) { aMessageModel.MessageTitle = "Successfull"; aMessageModel.MessageBody = "OT Setup information saved successfully."; } return(aMessageModel); }
public MessageModel SaveOperationSchedule(OperationSchedule operationSchedule) { int saveCount = new OperationScheduleGateway().SaveOperationSchedule(operationSchedule); MessageModel messageModel = new MessageModel(); if (saveCount > 0) { messageModel.MessageTitle = "Successfull"; messageModel.MessageBody = "OT Setup information saved successfully!"; } return(messageModel); }
private void btnDelete_Click(object sender, EventArgs e) { OperationSchedule aOperationSchedule = new OperationSchedule(); aOperationSchedule.OtRefNo = txtOtReffNo.Text; if (aOperationSchedule.Id != null) { DialogResult dr = MessageBox.Show("Are you sure to delete row?", "Confirmation Message", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { //OperationSchedule aOperationSchedule = new OperationSchedule(); //aOperationSchedule.Id = Convert.ToInt32(txtId.Text); MessageModel aMessageModel = new MessageModel(); aMessageModel = aOperationScheduleManager.DeleteOperationSchedule(aOperationSchedule); if (aMessageModel.MessageTitle == "Successfull") { MessageBox.Show(aMessageModel.MessageBody, aMessageModel.MessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); New(); } } } }
public int SaveOperationSchedule(OperationSchedule aOperationSchedule) { Query = "INSERT INTO OperationSchedule (OtRefNo,OtDate,OPID,CabinBed,PatientName,FirstAssist,SurgeonName,SecondAssist," + "Anaesthesiologist,OperationName,OperationTime,ToTime,UserId) VALUES (@OtRefNo,@OtDate,@OPID,@CabinBed,@PatientName,@FirstAssist,@SurgeonName,@SecondAssist,@Anaesthesiologist,@OperationName,@OperationTime,@ToTime,@UserId)"; Command = new SqlCommand(Query, Connection); Command.CommandType = CommandType.Text; Command.Parameters.AddWithValue("@OtRefNo", aOperationSchedule.OtRefNo ?? ""); Command.Parameters.AddWithValue("@OtDate", aOperationSchedule.OtDate); Command.Parameters.AddWithValue("@OPID", aOperationSchedule.Opid ?? ""); Command.Parameters.AddWithValue("@CabinBed", aOperationSchedule.CabinBed ?? ""); Command.Parameters.AddWithValue("@PatientName", aOperationSchedule.PatientName ?? ""); Command.Parameters.AddWithValue("@FirstAssist", aOperationSchedule.FirstAssist ?? ""); Command.Parameters.AddWithValue("@SurgeonName", aOperationSchedule.SurgeonName ?? ""); Command.Parameters.AddWithValue("@SecondAssist", aOperationSchedule.SecondAssist ?? ""); Command.Parameters.AddWithValue("@Anaesthesiologist", aOperationSchedule.Anaesthesiologist ?? ""); Command.Parameters.AddWithValue("@OperationName", aOperationSchedule.OperationName ?? ""); Command.Parameters.AddWithValue("@OperationTime", aOperationSchedule.OperationTime); Command.Parameters.AddWithValue("@ToTime", aOperationSchedule.ToTime); Command.Parameters.AddWithValue("@UserId", MainWindow.userName); int rowAffect = Command.ExecuteNonQuery(); return(rowAffect); }
public async Task <bool> ModifyOperationScheduleAsync([FromBody] OperationSchedule schedule, string hospital = null) { var department = DepartmentId; if (hospital == Hospital.BJTT) { schedule.RoomId = department; } if (mongo.OperationScheduleCollection.AsQueryable().Any(o => o.UniqueId == schedule.UniqueId)) { mongo.OperationScheduleCollection.UpdateOne(o => o.UniqueId == schedule.UniqueId, Builders <OperationSchedule> .Update .Set(o => o.IsCancelled, schedule.IsCancelled) .Set(o => o.RoomId, schedule.RoomId) .Set(o => o.ExecutionEndTime, schedule.ExecutionEndTime) .Set(o => o.Remark, schedule.Remark) .Set(o => o.AnesthetistId, schedule.AnesthetistId)); } else { await mongo.OperationScheduleCollection.InsertOneAsync(schedule); } return(true); }