public void UpdateData(string user, PhysicianFacilityModel oClass) { strSql = "UPDATE " + TABLE_PHYSICIAN_FACILITY + " SET " + COLUMN_PHYSICIAN_ID + " = '" + oClass.PhysicianID + "', " + COLUMN_HOSPITAL_ID + " = '" + oClass.HospitalID + "', " + " updated_by = '" + user + "', " + " updated_date = '" + DateTime.Now.ToString("yyyy-MM-d HH:MM:ss") + "' " + " WHERE " + COLUMN_ID + " = '" + oClass.ID + "' "; SaveData(strSql); }
public void DeleteData(string user, PhysicianFacilityModel oClass) { strSql = "UPDATE " + TABLE_PHYSICIAN_FACILITY + " SET " + " isDeleted = 1, " + " ReasonDelete = '" + oClass.ReasonDelete.Replace("'", "''") + "', " + " updated_by = '" + user + "', " + " updated_date = '" + DateTime.Now.ToString("yyyy-MM-d HH:MM:ss") + "' " + " WHERE " + COLUMN_ID + " = '" + oClass.ID + "' "; SaveData(strSql); }
protected void AddPhysicianFacility_ServerClick(object sender, EventArgs e) { string sUserName = Session["User"].ToString(); PhysicianFacilityDAL oPhysicianFacilityDAL = new PhysicianFacilityDAL(); PhysicianFacilityModel oPhysicianFacilityClass = new PhysicianFacilityModel(); oPhysicianFacilityClass.PhysicianID = Convert.ToInt32(PhysicianID.Value); oPhysicianFacilityClass.HospitalID = Convert.ToInt32(ddlHospitalName.SelectedValue); oPhysicianFacilityDAL.InsertData(sUserName, oPhysicianFacilityClass); PopulatePhysicianFacility(Convert.ToInt16(PhysicianID.Value)); }
protected void DeletePhysicianFacility_ServerClick(object sender, EventArgs e) { string UserName = Session["User"].ToString(); int ID = Convert.ToInt32(HiddenFieldPhysicianFacility.Value); PhysicianFacilityDAL oPhysicianFacilityDAL = new PhysicianFacilityDAL(); PhysicianFacilityModel oPhysicianFacilityClass = new PhysicianFacilityModel(); oPhysicianFacilityClass.IsDeleted = true; oPhysicianFacilityClass.ReasonDelete = deletePhysicianFacilityReason.InnerText; string lbl = lblPhysicianFacility.Text; oPhysicianFacilityClass.ID = ID; oPhysicianFacilityDAL.DeleteData(UserName, oPhysicianFacilityClass); PopulatePhysicianFacility(Convert.ToInt16(PhysicianID.Value)); }
public void InsertData(string currUser, PhysicianFacilityModel oClass) { strSql = strSql + "INSERT INTO " + TABLE_PHYSICIAN_FACILITY + " (" + COLUMN_PHYSICIAN_ID + ", " + COLUMN_HOSPITAL_ID + ", " + "created_by, created_date, updated_by, updated_date) "; strSql = strSql + "values ('" + oClass.PhysicianID + "', '" + oClass.HospitalID + "', '" + currUser + "', " + "CurDate(), '" + currUser + "', " + "CurDate() " + ") "; SaveData(strSql); }