private IEnumerable <FollowUp> SelectFollowUps(int pProjectId) { List <FollowUp> list = new List <FollowUp>(); const string sqlText = "SELECT * FROM FollowUp WHERE project_id = @pId"; using (SqlConnection conn = GetConnection()) using (OpenCbsCommand select = new OpenCbsCommand(sqlText, conn)) { select.AddParam("@pId", pProjectId); using (OpenCbsReader reader = select.ExecuteReader()) { if (reader == null || reader.Empty) { return(new List <FollowUp>()); } while (reader.Read()) { FollowUp followUp = new FollowUp(); followUp.Id = reader.GetInt("id"); followUp.Year = reader.GetInt("year"); followUp.Jobs1 = reader.GetInt("Jobs1"); followUp.Jobs2 = reader.GetInt("Jobs2"); followUp.CA = reader.GetMoney("CA"); followUp.PersonalSituation = reader.GetString("PersonalSituation"); followUp.Activity = reader.GetString("activity"); followUp.Comment = reader.GetString("comment"); list.Add(followUp); } return(list); } } }
public ProjectFollowUp() { InitializeComponent(); _followUp = new FollowUp { Year = 1 }; }
public HttpResponseMessage UpdateFollowUp(int id, FollowUp followup) { if (!ModelState.IsValid) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } if (id != followup.FollowUpId) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } followup.LastModifiedOn = DateTime.Now; followup.RepliedOn = DateTime.Now; FollowUpRepository.Attach(followup); try { unitOfWork.SaveChanges(); } catch (DbUpdateConcurrencyException ex) { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, ex)); } return(Request.CreateResponse(HttpStatusCode.OK)); }
public static string ParentFollowUpSMSAlert(FollowUp followUp) { string sms1 = "Followup visit of "; if (followUp.Child.Gender == "Boy") { sms1 += "son " + textInfo.ToTitleCase(followUp.Child.Name); } if (followUp.Child.Gender == "Girl") { sms1 += "daughter " + textInfo.ToTitleCase(followUp.Child.Name); } sms1 += " is due "; if (followUp.NextVisitDate == DateTime.UtcNow.AddHours(5).Date) { sms1 += "Today"; } else { sms1 += followUp.NextVisitDate; } sms1 += " with Dr. " + textInfo.ToTitleCase(followUp.Doctor.FirstName) + " " + textInfo.ToTitleCase(followUp.Doctor.LastName) + " at " + textInfo.ToTitleCase(followUp.Child.Clinic.Name) + ". "; sms1 += "Kindly confirm your appointment at " + followUp.Doctor.PhoneNo; var response1 = SendSMS(followUp.Child.User.CountryCode, followUp.Child.User.MobileNumber, followUp.Child.Email, sms1); addMessageToDB(followUp.Child.User.MobileNumber, response1, sms1, followUp.Child.Clinic.Doctor.User.ID); minusDoctorSMSCount(followUp.Child.Clinic.Doctor); return(response1); }
protected void btnSave_Click(object sender, EventArgs e) { FollowUp objfollowup = new FollowUp(); objfollowup.FollowUpDesc = txtFollowUpDesc.Text; objfollowup.Status = 1; if (!string.IsNullOrEmpty(hfFollowUpID.Value.ToString())) { objfollowup.UpdatedBy = UserAuthentication.GetUserId(this.Page); objfollowup.UpdatedDate = DateTime.Now; objfollowup.FollowUpID = Convert.ToInt32(hfFollowUpID.Value); objfollowup.FollowUpDesc = txtFollowUpDesc.Text; FollowUpBO.UpdateFollowUp(objfollowup); } else { objfollowup.CreatedBy = UserAuthentication.GetUserId(this.Page); objfollowup.CreatedDate = DateTime.Now; FollowUpBO.InsertFollowUp(objfollowup); } txtFollowUpDesc.Text = string.Empty; hfFollowUpID.Value = string.Empty; loadFollowUp(); }
public async Task <IActionResult> Edit(int id, [Bind("Id,DateReturn,TimeReturn")] FollowUp followUp) { if (id != followUp.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(followUp); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FollowUpExists(followUp.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(followUp)); }
public FollowUpBase AddNewFollowUp(FollowUpAdd newItem) { //Addeditem variable var addedItem = new FollowUp(); //Insert value addedItem = Mapper.Map <FollowUp>(newItem); //Insert suggestion object addedItem.Suggestion = ds.Suggestions.Find(newItem.SuggestionId); addedItem.Suggestion.FollowUps.Add(addedItem); //Handle the uploaded image //Add attachment only if there is image if (newItem.AttachmentUpload != null) { byte[] attachmentBytes = new byte[newItem.AttachmentUpload.ContentLength]; newItem.AttachmentUpload.InputStream.Read(attachmentBytes, 0, newItem.AttachmentUpload.ContentLength); //ojbect property addedItem.Attachment = attachmentBytes; addedItem.ContentType = newItem.AttachmentUpload.ContentType; } ds.FollowUps.Add(addedItem); ds.SaveChanges(); return(Mapper.Map <FollowUpBase>(addedItem)); }
public ActionResult DeleteConfirmed(int id) { FollowUp followUp = db.FollowUps.Find(id); db.FollowUps.Remove(followUp); db.SaveChanges(); return(RedirectToAction("Index")); }
public FollowUp InsertFollowUp(FollowUp followupObj) { try { SqlParameter outputStatus, outputID = null; using (SqlConnection con = _databaseFactory.GetDBConnection()) { using (SqlCommand cmd = new SqlCommand()) { if (con.State == ConnectionState.Closed) { con.Open(); } cmd.Connection = con; cmd.CommandText = "[Accounts].[InsertFollowUp]"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@FollowUpDate", SqlDbType.DateTime).Value = followupObj.FollowUpDate; if (followupObj.HdnFollowUpTime == "" || followupObj.HdnFollowUpTime == null) { followupObj.HdnFollowUpTime = "10:00:00"; } cmd.Parameters.Add("@FollowUpTime", SqlDbType.Time).Value = followupObj.HdnFollowUpTime; cmd.Parameters.Add("@CustomerID", SqlDbType.UniqueIdentifier).Value = followupObj.CustomerID; cmd.Parameters.Add("@Status", SqlDbType.VarChar, 150).Value = followupObj.Status; cmd.Parameters.Add("@ContactName", SqlDbType.VarChar, 10).Value = followupObj.ContactName; cmd.Parameters.Add("@Remarks", SqlDbType.VarChar, 250).Value = followupObj.Remarks; cmd.Parameters.Add("@ContactNO", SqlDbType.VarChar, 100).Value = followupObj.ContactNO; cmd.Parameters.Add("@CreatedBy", SqlDbType.NVarChar, 250).Value = followupObj.CommonObj.CreatedBy; cmd.Parameters.Add("@CreatedDate", SqlDbType.DateTime).Value = followupObj.CommonObj.CreatedDate; outputStatus = cmd.Parameters.Add("@InsertStatus", SqlDbType.SmallInt); outputStatus.Direction = ParameterDirection.Output; outputID = cmd.Parameters.Add("@ID", SqlDbType.UniqueIdentifier); outputID.Direction = ParameterDirection.Output; cmd.ExecuteNonQuery(); } } switch (outputStatus.Value.ToString()) { case "0": AppConst Cobj = new AppConst(); throw new Exception(Cobj.InsertFailure); case "1": followupObj. ID = Guid.Parse(outputID.Value.ToString()); break; default: break; } } catch (Exception ex) { throw ex; } return(followupObj); }
// GET: FollowUps/Create public ActionResult Create(int?id, string scannum, int refid, string visit) { FollowUp followUp = new FollowUp(); followUp.scannum = scannum; followUp.refid = refid; followUp.visit = visit; return(View(followUp)); }
private FollowUpInfoDto ToDto(FollowUp entity, dynamic extInfo = null) { var dto = Lib.Mapper <FollowUp, FollowUpInfoDto> .Map(entity); dto.CreateUserName = extInfo?.CreateUserName ?? string.Empty; dto.UpdateUserName = extInfo?.UpdateUserName ?? string.Empty; dto.StatusName = dto.Status.GetDescription(); return(dto); }
public ActionResult Edit([Bind(Include = "Id,Topic,ResultDesc,User_Id,Customer_Id")] FollowUp followUp) { if (ModelState.IsValid) { db.Entry(followUp).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(followUp)); }
/// <summary> /// Fills in cancer participants data. /// </summary> private void FillInCancerParticipantsData() { PreScreened.SendKeys("5"); ScreenFailures.SendKeys("3"); NewEnrollment.SendKeys("4"); ActiveIntervention.SendKeys("2"); CompletedIntervention.SendKeys("1"); FollowUp.SendKeys("2"); Discontinued.SendKeys("1"); }
// GET api/followup public IEnumerable<FollowUp> Get() { List<FollowUp> listFollowUp = new List<FollowUp>(); DataView dvFollowUp = FollowUpBO.GetFollowUpIDForSync(); foreach (DataRowView drvFollowUp in dvFollowUp) { FollowUp FollowUp = new FollowUp(); listFollowUp.Add(FollowUpBO.GetFollowUp(Convert.ToInt32(drvFollowUp["FollowUpID"]))); } return listFollowUp; }
public async Task <IActionResult> Create([Bind("Id,DateReturn,TimeReturn,AddressId")] FollowUp followUp) { if (ModelState.IsValid) { _context.Add(followUp); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(followUp)); }
public List <FollowUp> GetRecentFollowUpCount(DateTime?Today) { List <FollowUp> followUpList = null; try { using (SqlConnection con = _databaseFactory.GetDBConnection()) { using (SqlCommand cmd = new SqlCommand()) { if (con.State == ConnectionState.Closed) { con.Open(); } cmd.Connection = con; cmd.CommandText = "[Accounts].[GetRecentFollowUpList]"; cmd.Parameters.Add("@Today", SqlDbType.Date).Value = Today; cmd.CommandType = CommandType.StoredProcedure; using (SqlDataReader sdr = cmd.ExecuteReader()) { if ((sdr != null) && (sdr.HasRows)) { followUpList = new List <FollowUp>(); while (sdr.Read()) { FollowUp followUpObj = new FollowUp(); { followUpObj.ID = (sdr["ID"].ToString() != "" ? Guid.Parse(sdr["ID"].ToString()) : followUpObj.ID); followUpObj.CustomerID = (sdr["CustomerID"].ToString() != "" ? Guid.Parse(sdr["CustomerID"].ToString()) : followUpObj.CustomerID); followUpObj.ContactName = (sdr["ContactName"].ToString() != "" ? sdr["ContactName"].ToString() : followUpObj.ContactName); followUpObj.Company = (sdr["CompanyName"].ToString() != "" ? sdr["CompanyName"].ToString() : followUpObj.Company); followUpObj.FollowUpDate = (sdr["FollowUpDate"].ToString() != "" ? DateTime.Parse(sdr["FollowUpDate"].ToString()).ToString(s.dateformat) : followUpObj.FollowUpDate); followUpObj.FollowUpTime = (sdr["FollowUpTime"].ToString() != "" ? DateTime.Parse(sdr["FollowUpTime"].ToString()).ToString("hh:mm tt") : followUpObj.FollowUpTime); followUpObj.ContactNO = (sdr["ContactNO"].ToString() != "" ? sdr["ContactNO"].ToString() : followUpObj.ContactNO); followUpObj.Remarks = (sdr["Remarks"].ToString() != "" ? sdr["Remarks"].ToString() : followUpObj.Remarks); followUpObj.Status = (sdr["Status"].ToString() != "" ? sdr["Status"].ToString() : followUpObj.Status); } followUpList.Add(followUpObj); } } } } } } catch (Exception ex) { throw ex; } return(followUpList); }
private void CancelCommandExecuted() { _crmDataUnit.RevertChanges(); if (_isEditMode) { FollowUp.Refresh(); } else { FollowUp = null; } }
/// <summary> /// Default KPI Constructor /// </summary> public KPI() { plan = new Plan(); purch = new Purch(); followUp = new FollowUp(); planTwo = new PlanTwo(); purchTwo = new PurchTwo(); purchSub = new PurchSub(); purchTotal = new PurchTotal(); purchPlan = new PurchPlan(); purchPlanTotal = new PurchPlanTotal(); other = new Other(); }
// GET: FollowUps/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } FollowUp followUp = db.FollowUps.Find(id); if (followUp == null) { return(HttpNotFound()); } return(View(followUp)); }
public async Task <bool> SubmitReviewedAsync(FollowUp followUp) { //var Submit = await _database.InsertAsync(Labresult); if (followUp.OPDNumber != 0) { await _database.InsertAsync(followUp); return(true); } else { return(false); } }
public FollowUp UpdateFollowUp(FollowUp followupObj) { SqlParameter outputStatus = null; try { using (SqlConnection con = _databaseFactory.GetDBConnection()) { using (SqlCommand cmd = new SqlCommand()) { if (con.State == ConnectionState.Closed) { con.Open(); } cmd.Connection = con; cmd.CommandText = "[Accounts].[UpdateFollowUp]"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@ID", SqlDbType.UniqueIdentifier).Value = followupObj.ID; cmd.Parameters.Add("@FollowUpDate", SqlDbType.DateTime).Value = followupObj.FollowUpDate; cmd.Parameters.Add("@CustomerID", SqlDbType.UniqueIdentifier).Value = followupObj.CustomerID; cmd.Parameters.Add("@FollowUpTime", SqlDbType.DateTime).Value = followupObj.HdnFollowUpTime; cmd.Parameters.Add("@Status", SqlDbType.VarChar, 10).Value = followupObj.Status; cmd.Parameters.Add("@Remarks", SqlDbType.VarChar, 250).Value = followupObj.Remarks; cmd.Parameters.Add("@ContactName", SqlDbType.VarChar, 150).Value = followupObj.ContactName; cmd.Parameters.Add("@ContactNo", SqlDbType.VarChar, 100).Value = followupObj.ContactNO; cmd.Parameters.Add("@UpdatedBy", SqlDbType.NVarChar, 250).Value = followupObj.CommonObj.UpdatedBy; cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = followupObj.CommonObj.UpdatedDate; outputStatus = cmd.Parameters.Add("@UpdateStatus", SqlDbType.SmallInt); outputStatus.Direction = ParameterDirection.Output; cmd.ExecuteNonQuery(); } } switch (outputStatus.Value.ToString()) { case "0": throw new Exception(Cobj.UpdateFailure); default: break; } } catch (Exception ex) { throw ex; } return(followupObj); }
public FollowUp GetFollowupDetailsByFollowUpID(Guid ID) { FollowUp followUpObj = null; try { using (SqlConnection con = _databaseFactory.GetDBConnection()) { using (SqlCommand cmd = new SqlCommand()) { if (con.State == ConnectionState.Closed) { con.Open(); } cmd.Connection = con; cmd.CommandText = "[Accounts].[GetFollowUpDetailsByFollowUpId]"; cmd.Parameters.Add("@ID", SqlDbType.UniqueIdentifier).Value = ID; cmd.CommandType = CommandType.StoredProcedure; using (SqlDataReader sdr = cmd.ExecuteReader()) { if ((sdr != null) && (sdr.HasRows)) { if (sdr.Read()) { followUpObj = new FollowUp(); { followUpObj.ID = (sdr["ID"].ToString() != "" ? Guid.Parse(sdr["ID"].ToString()) : followUpObj.ID); followUpObj.CustomerID = (sdr["CustomerID"].ToString() != "" ? Guid.Parse(sdr["CustomerID"].ToString()) : followUpObj.CustomerID); followUpObj.ContactName = (sdr["ContactName"].ToString() != "" ? sdr["ContactName"].ToString() : followUpObj.ContactName); followUpObj.ContactNO = (sdr["ContactNO"].ToString() != "" ? sdr["ContactNO"].ToString() : followUpObj.ContactNO); followUpObj.FollowUpDate = (sdr["FollowUpDate"].ToString() != "" ? DateTime.Parse(sdr["FollowUpDate"].ToString()).ToString(s.dateformat) : followUpObj.FollowUpDate); followUpObj.FollowUpTime = (sdr["FollowUpTime"].ToString() != "" ? DateTime.Parse(sdr["FollowUpTime"].ToString()).ToString("hh:mm tt") : followUpObj.FollowUpTime); followUpObj.Remarks = (sdr["Remarks"].ToString() != "" ? sdr["Remarks"].ToString() : followUpObj.Remarks); followUpObj.Status = (sdr["Status"].ToString() != "" ? sdr["Status"].ToString() : followUpObj.Status); } } } } } } } catch (Exception ex) { throw ex; } return(followUpObj); }
public void AddFollowUp(string followUpNotes) { FollowUp followUp = new FollowUp() { FollowUp_Date = DateTime.Now, FollowUp_Man = ddlFollowUpPersonAdd.SelectedItem.Text, FollowUp_Notes = followUpNotes, SourceNo = SourceNo, SourceType = SourceType }; FollowUpDAL dal = new FollowUpDAL(); dal.AddFollowUp(followUp); dal.Save(); BindControl(); }
// POST api/followup public FollowUp Post(FollowUp FollowUp) { if (FollowUp.GUID > 0) { FollowUp.FollowUpID = FollowUp.GUID; int rowResult = FollowUpBO.UpdateFollowUp(FollowUp); //Return Back to The Client return FollowUp; } else { int rowResult = FollowUpBO.InsertFollowUp(FollowUp); //Return Back to The Client return FollowUp; } }
public ActionResult Create(FollowUp followUp) { if (ModelState.IsValid) { db.FollowUps.Add(followUp); try { db.SaveChanges(); }catch (Exception e) { } return(RedirectToAction("Index")); } ViewBag.Users = db.Users.ToList(); ViewBag.Customers = db.Customers.ToList(); return(View(followUp)); }
public Response <FollowUpDTO> Post(FollowUpDTO FollowUpDto) { try { using (VDEntities entities = new VDEntities()) { FollowUp dbFollowUp = Mapper.Map <FollowUp>(FollowUpDto); entities.FollowUps.Add(dbFollowUp); entities.SaveChanges(); return(new Response <FollowUpDTO>(true, null, FollowUpDto)); } } catch (Exception e) { return(new Response <FollowUpDTO>(false, GetMessageFromExceptionObject(e), null)); } }
public ActionResult Edit(FollowUp followUp) { if (ModelState.IsValid) { string a = Request.Form["refid"]; string b = Request.Form["visit"]; string c = Request.Form["scannum"]; MySqlConnection mysql = getMySqlConnection(); MySqlCommand mySqlCommand = getSqlCommand(" UPDATE followup set date=" + "'" + followUp.date + "',content=" + "'" + followUp.content + "'" + "where id=" + followUp.Id, mysql); mysql.Open(); MySqlDataAdapter adapter = new MySqlDataAdapter(mySqlCommand); mySqlCommand.ExecuteNonQuery(); mysql.Close(); return(RedirectToAction("Details/" + Convert.ToInt32(a), "Visits")); } return(View(followUp)); }
public IHttpActionResult CreateFollowUp(string id) { var followed = _userRepository.GetUserCurrent(id); if (followed == null) { return(BadRequest()); } var followUp = new FollowUp() { Follower = _userRepository.GetUserCurrent(User.Identity.GetUserId()), Followed = followed }; _followUpRepository.Add(followUp); _unitOfWork.Complete(); return(Ok(followUp.Id)); }
//追蹤他 資料表新增粉絲 public IHttpActionResult Post(string memid, string FoMemID) { FollowUp folw = new FollowUp(); folw.memId = FoMemID; folw.FoMemId = memid; Fans fan = new Fans(); fan.memId = FoMemID; fan.fanMemId = memid; db.FollowUp.Add(folw); db.SaveChanges(); db.Fans.Add(fan); db.SaveChanges(); return(Ok()); }
private void _UpdateFollowUp(FollowUp pUp, SqlTransaction pTransaction) { const string q = @"UPDATE [FollowUp] SET [year] = @year,[CA] = @CA,[Jobs1] = @Jobs1 ,[Jobs2] = @Jobs2 ,[PersonalSituation] = @PersonalSituation ,[activity] = @activity ,[comment] = @comment WHERE id = @id"; using (OpenCbsCommand c = new OpenCbsCommand(q, pTransaction.Connection, pTransaction)) { c.AddParam("@id", pUp.Id); c.AddParam("@year", pUp.Year); c.AddParam("@CA", pUp.CA); c.AddParam("@jobs1", pUp.Jobs1); c.AddParam("@jobs2", pUp.Jobs2); c.AddParam("@personalSituation", pUp.PersonalSituation); c.AddParam("@activity", pUp.Activity); c.AddParam("@comment", pUp.Comment); c.ExecuteNonQuery(); } }
public int InsertFollowUp(FollowUp objfollowup) { objfollowup.FollowUpID = 1; BeginTransaction(); try { objfollowup.FollowUpID = Insert(objfollowup); CommitTransaction(); } catch (Exception ex) { RollBackTransaction(); objfollowup.FollowUpID = -1; } return objfollowup.FollowUpID; }
public int DeleteFollowUp(FollowUp objfollowup) { int rowsaffected = -1; BeginTransaction(); try { String[] UpdateProperties = new String[] { "Status" }; rowsaffected = Update(objfollowup, UpdateProperties); CommitTransaction(); } catch (Exception e) { RollBackTransaction(); rowsaffected = -1; } return rowsaffected; }
private void mydatagrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { int i = mydatagrid.SelectedIndex; if (i >= 0 && i < mydatagrid.Items.Count - 1) { var id = dt.Rows[i]["RSA ID Number"].ToString(); Impilo_App.LocalModels.Client selectClient = new Impilo_App.LocalModels.Client { ClientID = dt.Rows[i]["Unique Identifier"].ToString(), HeadOfHousehold = dt.Rows[i]["Head of Household"].ToString(), FirstName = dt.Rows[i]["First Name"].ToString(), LastName = dt.Rows[i]["Last Name"].ToString(), GPSLatitude = dt.Rows[i]["GPS Latitude"].ToString(), GPSLongitude = dt.Rows[i]["GPS Longitude"].ToString(), IDNo = dt.Rows[i]["RSA ID Number"].ToString(), ClinicUsed = int.Parse(dt.Rows[i]["Clinic ID"].ToString()), DateOfBirth = DateTime.Parse(dt.Rows[i]["Date of Birth"].ToString()), Gender = dt.Rows[i]["Gender"].ToString(), AttendingSchool = dt.Rows[i]["Attending School"].ToString() == "1"?true:false, Grade = dt.Rows[i]["Grade in School"].ToString(), NameofSchool = dt.Rows[i]["Name of School"].ToString() }; switch (lflag) { case 1: FollowUp newPage = new FollowUp(selectClient); var a = Application.Current.MainWindow.FindName("pageTransitionControl") as PageTransition; a.ShowPage(newPage); break; case 2: ClinicVisit clinicV = new ClinicVisit(selectClient); var c = Application.Current.MainWindow.FindName("pageTransitionControl") as PageTransition; c.ShowPage(clinicV); break; default: FollowUp defaultfup = new FollowUp(selectClient); var d = Application.Current.MainWindow.FindName("pageTransitionControl") as PageTransition; d.ShowPage(defaultfup); break; } } }
private void _AddFollowUp(FollowUp pUp, int pId, SqlTransaction pTransac) { const string q = @"INSERT INTO [FollowUp] ([project_id],[year],[CA],[Jobs1],[Jobs2],[PersonalSituation],[activity] ,[comment]) VALUES(@projectId,@year,@CA,@jobs1,@jobs2,@personalSituation,@activity,@comment) SELECT SCOPE_IDENTITY()"; using (OpenCbsCommand c = new OpenCbsCommand(q, pTransac.Connection, pTransac)) { c.AddParam("@projectId", pId); c.AddParam("@year", pUp.Year); c.AddParam("@CA", pUp.CA); c.AddParam("@jobs1", pUp.Jobs1); c.AddParam("@jobs2", pUp.Jobs2); c.AddParam("@personalSituation", pUp.PersonalSituation); c.AddParam("@activity", pUp.Activity); c.AddParam("@comment", pUp.Comment); pUp.Id = Convert.ToInt32(c.ExecuteScalar()); } }
protected void gvFollowUp_RowCommand(object sender, GridViewCommandEventArgs e) { hfFollowUpID.Value = e.CommandArgument.ToString(); FollowUp objfollowup = new FollowUp(); if (e.CommandName.Equals("cmdEdit")) { objfollowup = FollowUpBO.GetFollowUp(Convert.ToInt32(e.CommandArgument)); txtFollowUpDesc.Text = objfollowup.FollowUpDesc; } else if (e.CommandName.Equals("cmdDelete")) { int FollowUpID = Convert.ToInt32(e.CommandArgument); objfollowup.FollowUpID = FollowUpID; objfollowup.Status = 0; FollowUpBO.DeleteFollowUp(objfollowup); loadFollowUp(); } }
public bool CreateFollowUp(FollowUpCreate model) { var entity = new FollowUp() { OwnerId = _userId, LeadID = model.LeadID, ShortDescription = model.ShortDescription, FollowUpStatusID = model.FollowUpStatusID, Notes = model.Notes, CreatedUtc = DateTimeOffset.Now, DueUtc = model.DueUtc }; using (var ctx = new ApplicationDbContext()) { ctx.FollowUps.Add(entity); return(ctx.SaveChanges() == 1); } }
private void btnSave_Click(object sender, RoutedEventArgs e) { FollowUp fol = new FollowUp(); #region Visit Detaisl fol.FollowUpID = folID; fol.DateofScreen = fol.VisitNextVisit = fol.VisitOutCome = fol.VisitHPT = (radVisHptYes.IsChecked == true) ? true : false; fol.VisitDiabetes = (radVisHptYes.IsChecked == true) ? true : false; fol.VisitEpilepsy = (radVisHptYes.IsChecked == true) ? true : false; fol.Visitfol.HIV = (radVisHptYes.IsChecked == true) ? true : false; fol.VisitTB = (radVisHptYes.IsChecked == true) ? true : false; fol.VisitMatHealth = (radVisHptYes.IsChecked == true) ? true : false; fol.VisitChildHealth = (radVisHptYes.IsChecked == true) ? true : false; fol.VisitOther = (radVisHptYes.IsChecked == true) ? true : false; fol.VisitDooortoDoor = (radVisHptYes.IsChecked == true) ? true : false; try { storedProcedure = "";// name of sp conn.Open(); SqlCommand com = new SqlCommand(storedProcedure, conn); com.Parameters.AddWithValue("@", fol.ScreeningID);//param com.ExecuteNonQuery();//execute command } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { conn.Close(); } #endregion #region Hypertension fol.HyperWentToClinic1 = (radHyClinYes.IsChecked == true) ? true : false; fol.HyperReReferToClinic1 = (radHyRefClin1Yes.IsChecked == true) ? true : false; fol.HyperReferralNo1 = txtHyRefNo1.Text; fol.HyperCurrentlyOnMeds = (radHyCurMedsYes.IsChecked == true) ? true : false; fol.HyperStartDate = ; fol.HyperScreenBPReadingSystolic = txtHyScrSys.Text; fol.HyperScreenBPReadingDiastolic = txtHyScrDia.Text; fol.HyperTodayTestReadingSystolic = txtHyTodSys.Text; fol.HyperTodayTestReadingDiastolic = txtHyTodSys.Text; fol.HyperAlreadyOnTreatment = (radHyCurTreYes.IsChecked == true) ? true : false; fol.HyperReReferToClinic2 = (radHyRefClin2Yes.IsChecked == true) ? true : false; ; fol.HyperReferralNo2 = txtHyRefNo2.Text; fol.HyperMedication = ((ComboBoxItem)cboHyMeds.SelectedItem).Content.ToString(); //sp place //connection try { storedProcedure = "";// name of sp conn.Open(); SqlCommand com = new SqlCommand(storedProcedure, conn); com.Parameters.AddWithValue("@", fol.ScreeningID);//param com.ExecuteNonQuery();//execute command } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { conn.Close(); } #endregion #region Diabetes fol.DiaReReferToClinic1 = (radDiaReRefClinYes.IsChecked == true) ? true : false; ; fol.DiaReferralNo1 = txtDiaRefNo1.Text; fol.DiaCurrentlyOnMeds = (radDiaCurMedsYes.IsChecked == true) ? true : false; ; fol.DiaStartDate = dpDiaStartDt.Text.ToString(); fol.DiaScreenTestReading1 = txtDiaScrReading.Text; fol.DiaFollowUpTestReading1 = txtDiaFolReading.Text; fol.DiaReferToClinic2 = (radDiaRefClinYes.IsChecked == true) ? true : false; ; fol.DiaReferralNo2 = txtDiaRefNo2.Text; fol.DiaMedication = ((ComboBoxItem)cboDiaMeds.SelectedItem).Content.ToString(); //sp place //connection try { storedProcedure = "";// name of sp conn.Open(); SqlCommand com = new SqlCommand(storedProcedure, conn); com.Parameters.AddWithValue("@", dia.ScreeningID);//param com.ExecuteNonQuery();//execute command } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { conn.Close(); } #endregion #region Epilepsy EpiWentToClinic = (radEpiClinYes.IsChecked == true) ? true : false; ; EpiReReferToClinic1 = (radEpiReRefClinYes.IsChecked == true) ? true : false; ; EpiReferralNo1 = txtEpiRefNo1.Text; EpiFitInLastMonth = (radEpiFitsLastMonthYes.IsChecked == true) ? true : false; ; EpiCurrentlyOnMeds = (radEpiCurMedsYes.IsChecked == true) ? true : false; EpiStartDate = dpEpiStartDt.Text.ToString(); EpiMoreThan3FitsInLastMonth = (radEpi3FitsLastMonthYes.IsChecked == true) ? true : false; ; EpiReReferToClinic2 = (radEpiRefClin2Yes.IsChecked == true) ? true : false; ; EpiReferralNo2 = txtEpiRefNo2.Text; EpiMedication = ((ComboBoxItem)cboEpiMeds.SelectedItem).Content.ToString(); //sp place //connection try { storedProcedure = "";// name of sp conn.Open(); SqlCommand com = new SqlCommand(storedProcedure, conn); com.Parameters.AddWithValue("@", dia.ScreeningID);//param com.ExecuteNonQuery();//execute command } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { conn.Close(); } #endregion #region Asthma fol.AsDateOfVisit fol.AsWentToClinic fol.AsReReferToClinic1 fol.AsReferralNo1 fol.AsFitInLastMonth fol.AsReferToClinic fol.AsReferralNo2 fol.AsCurrentlyOnMeds fol.AsStartDate fol.AsIncreasedNoOfAsthmaAttacks fol.AsReReferToClinic2 fol.AsReferralNo3 fol.AsMedication //sp place //connection try { storedProcedure = "";// name of sp conn.Open(); SqlCommand com = new SqlCommand(storedProcedure, conn); com.Parameters.AddWithValue("@", dia.ScreeningID);//param com.ExecuteNonQuery();//execute command } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { conn.Close(); } #endregion #region fol.HIV fol.HIVDateOfVisit fol.HIVWentToClinic fol.HIVRereferToClinic fol.HIVReferralNo1 fol.HIVReferToClinic1 fol.HIVReferralNo2 fol.HIVStatus fol.HIVOnARVs fol.HIVStartDate1 fol.HIVAdherenceOK fol.HIVConcerns fol.HIVReferToClinic2 fol.HIVReferralNo3 fol.HIVARVsConsern fol.HIVReferToClinic3 fol.HIVReferralNo4 fol.HIVTestingDone fol.HIVTestDone fol.HIVTestResults fol.HIVReferToClinic4 fol.HIVReferralNo5 fol.HIVMedication //sp place //connection try { storedProcedure = "";// name of sp conn.Open(); SqlCommand com = new SqlCommand(storedProcedure, conn); com.Parameters.AddWithValue("@", dia.ScreeningID);//param com.ExecuteNonQuery();//execute command } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } finally { conn.Close(); } #endregion #region TB TBDateOfVisit TBARVsConcern TBReferToClinic1 TBReferralNo1 TBRecentUnplannedLoseOfWeight TBExcessiveSweatingAtNight TBFeverOver2Weeks TBCoughMoreThan2Week TBLossOfApetite TBReferredToClinic2 TBReferralNo2 TBResult TBNewlyDiagnosed TBStartDate TBReferTBContactsToClinic TBPreviouslyOnMeds TBFinishDate TBConcerns TBReferToClinic3 TBReferralNo3 TBMedication #endregion #region Maternal health MatDateOfVisit MatWentToClinic MatReReferToClinic1 MatReferralNo1 MatIsItPosibleYouArePregnent MatPregnancyTestDone MatResult MatReferredToClinic2 MatReferralNo2 MatDateOf1stANC MatDateOfLastANC MatReferredToClinic3 MatReferralNo3 MatRegisteredForMoMConnect MatDateOfNextANC MatReferToClinic MatReferralNo4 MatExpectedDateOfDelivery MatIntendBreastfeed MatIntendFormulaFeed #endregion #region Child health ChildDateOfVisit ChildARVsConcern ChildReferToClinic1 ChildReferralNo1 ChildWalkAppropriateForAge ChildTalkAppropriateForAge ChildReferToClinic2 ChildReferralNo2 ChildChildAssisted ChildReReferToSD ChildReferralNo3 ChildListConcernsReChild ChildReferToClinic3 ChildreferToSD ChildReferralNo4 ChildChildWithRTHC ChildReferToClinic4 ChildReferralNo5 ChildMotherTHVPositive ChildChildBreastfed ChildHowLong ChildClildEverOnNevirapine ChildReferToClinic5 ChildReferralNo6 ChildHowPCRHasDone ChildReferToClinic6 ChildReferralNo7 ChildImmunisationUpToDate ChildWhichImmunisationsOutStanding ChildVITAandWormMedsGivenEachMonth ChildReferToClinic7 ChildReferralNo8 #endregion Child health #region Other OtherDateOfVisit OtherWentToClinic OtherReReferToClinic OtherReferralNo1 OtherConditionTha OtherReferToClinic1 OtherReferralNo2 #endregion Other }
public static int InsertFollowUp(FollowUp objfollowup) { return new FollowUpDAO().InsertFollowUp(objfollowup); }
private void button9_Click_1(object sender, EventArgs e) { panel1.Visible = false; FollowUp f = new FollowUp(); f.Show(); }
public static FollowUp GetFollowUp(int FollowUpID) { FollowUp objFollowUp = new FollowUp(); return (FollowUp)(new FollowUpDAO().FillDTO(objFollowUp, "FollowUpID=" + FollowUpID)); }
public static int UpdateFollowUp(FollowUp objfollowup) { return new FollowUpDAO().UpdateFollowUp(objfollowup); }
public static int DeleteFollowUp(FollowUp objfollowup) { return new FollowUpDAO().DeleteFollowUp(objfollowup); }