public int InsertOtherFollowUp(OtherFollowupPerService objOtherFollowupPerService) { objOtherFollowupPerService.OtherFollowUpPerServiceID = 1; BeginTransaction(); try { objOtherFollowupPerService.OtherFollowUpPerServiceID = Insert(objOtherFollowupPerService); CommitTransaction(); } catch (Exception ex) { RollBackTransaction(); objOtherFollowupPerService.OtherFollowUpPerServiceID = -1; } return objOtherFollowupPerService.OtherFollowUpPerServiceID; }
// POST api/otherfollowupperservice public OtherFollowupPerService Post(OtherFollowupPerService OtherFollowupPerService) { if (OtherFollowupPerService.GUID > 0) { OtherFollowupPerService.SyncStatus = 1; OtherFollowupPerService.ServiceProvidedPerSaMIID = OtherFollowupPerService.GUID; int rowResult = OtherFollowupPerServiceBO.UpdateOtherFollowUp(OtherFollowupPerService); //Return Back to The Client return OtherFollowupPerService; } else { OtherFollowupPerService.SyncStatus = 1; int rowResult = OtherFollowupPerServiceBO.InsertOtherFollowUp(OtherFollowupPerService); OtherFollowupPerService.ServiceProvidedPerSaMIID = rowResult; //Return Back to The Client return OtherFollowupPerService; } }
// GET api/otherfollowupperservice public IEnumerable<OtherFollowupPerService> Get(int Organization) { List<OtherFollowupPerService> listOtherFollowupPerService = new List<OtherFollowupPerService>(); DataView dvUsers = UserBO.GetUsersIDByOrganization(Organization); string TempCreatedBy = ""; if (dvUsers.Count > 0) { foreach (DataRowView drvUsers in dvUsers) { TempCreatedBy += "CreatedBy=" + drvUsers["UserID"] + " OR "; } string CreatedBy = TempCreatedBy.Remove(TempCreatedBy.Length - 3); DataView dvOtherFollowupPerService = OtherFollowupPerServiceBO.GetOtherFollowupPerServiceIDForSync(CreatedBy); foreach (DataRowView drvOtherFollowupPerService in dvOtherFollowupPerService) { OtherFollowupPerService OtherFollowupPerService = new OtherFollowupPerService(); listOtherFollowupPerService.Add(OtherFollowupPerServiceBO.GetOtherFollowUpInfoPerService(Convert.ToInt32(drvOtherFollowupPerService["OtherFollowUpPerServiceID"]))); } } return listOtherFollowupPerService; }
public int UpdateOtherFollowUp(OtherFollowupPerService objOtherFollowupPerService) { int rowsaffected = -1; BeginTransaction(); try { String[] UpdateProperties = new String[] { "FollowUpDate", "NonFollowUpReasonID", "IsFollowUpComplied", "IsFollowUpDidNotComply", "IsReasonRecommendation", "IsReasonReceipt", "IsReasonFamilyMember", "IsReasonOther", "Remarks", "UpdatedBy", "UpdatedDate", "SyncStatus" }; rowsaffected = Update(objOtherFollowupPerService, UpdateProperties); CommitTransaction(); } catch (Exception e) { RollBackTransaction(); rowsaffected = -1; } return rowsaffected; }
public static OtherFollowupPerService GetOtherFollowUpInfoPerService(int OtherFollowUpPerServiceID) { OtherFollowupPerService objOtherFollowupPerService = new OtherFollowupPerService(); return (OtherFollowupPerService)(new OtherFollowupPerServiceDAO().FillDTO(objOtherFollowupPerService, "OtherFollowUpPerServiceID=" + OtherFollowUpPerServiceID)); }
public static int UpdateOtherFollowUp(OtherFollowupPerService objOtherFollowupPerService) { return new OtherFollowupPerServiceDAO().UpdateOtherFollowUp(objOtherFollowupPerService); }
public static int InsertOtherFollowUp(OtherFollowupPerService objOtherFollowupPerService) { return new OtherFollowupPerServiceDAO().InsertOtherFollowUp(objOtherFollowupPerService); }
// Save Other Followup protected void btnAddOtherFollowUp_Click(object sender, EventArgs e) { int SaMIProfileID = Convert.ToInt32(hfSaMIProfileID.Value); int ServiceProvidedPerSAMIID = Convert.ToInt32(hfServiceProvidedPerSaMIID.Value); if (!String.IsNullOrEmpty(hfServiceProvidedPerSaMIID.Value)) { OtherFollowupPerService objOtherFollowupPerService = new OtherFollowupPerService(); objOtherFollowupPerService.ServiceProvidedPerSaMIID = Convert.ToInt32(ServiceProvidedPerSAMIID); objOtherFollowupPerService.NonFollowUpReasonID = Convert.ToInt32(ddlNonFollowup.SelectedValue); //reset objOtherFollowupPerService.IsFollowUpComplied = 0; objOtherFollowupPerService.IsFollowUpDidNotComply = 0; objOtherFollowupPerService.IsReasonFamilyMember = 0; objOtherFollowupPerService.IsReasonOther = 0; objOtherFollowupPerService.IsReasonReceipt = 0; objOtherFollowupPerService.IsReasonRecommendation = 0; if (objOtherFollowupPerService.NonFollowUpReasonID == 0) { if (rbComplied.Checked) objOtherFollowupPerService.IsFollowUpComplied = 1; else { if (rbDidNotComply.Checked) { objOtherFollowupPerService.IsFollowUpDidNotComply = 1; } else { if (rbReasonRecommendation.Checked) { objOtherFollowupPerService.IsReasonRecommendation = 1; } else if (rbReasonFamilyMember.Checked) { objOtherFollowupPerService.IsReasonFamilyMember = 1; } else { if (rbReasonReceipt.Checked) objOtherFollowupPerService.IsReasonReceipt = 1; else objOtherFollowupPerService.IsReasonOther = 1; } } } } objOtherFollowupPerService.FollowUpDate = Convert.ToDateTime(txtFollowUpDate.Text); objOtherFollowupPerService.Remarks = txtDidNoComplyReason.Text; objOtherFollowupPerService.SyncStatus = 0; if (!string.IsNullOrEmpty(hfOtherFollowUpPerServiceID.Value)) { objOtherFollowupPerService.UpdatedBy = UserAuthentication.GetUserId(this.Page); objOtherFollowupPerService.UpdatedDate = DateTime.Now; objOtherFollowupPerService.OtherFollowUpPerServiceID = Convert.ToInt32(hfOtherFollowUpPerServiceID.Value); OtherFollowupPerServiceBO.UpdateOtherFollowUp(objOtherFollowupPerService); } else { objOtherFollowupPerService.CreatedBy = UserAuthentication.GetUserId(this.Page); objOtherFollowupPerService.CreatedDate = DateTime.Now; OtherFollowupPerServiceBO.InsertOtherFollowUp(objOtherFollowupPerService); } //ClearOtherFollowUp(); gvOtherFollowUp.DataSource = OtherFollowupPerServiceBO.GetCustom(ServiceProvidedPerSAMIID); gvOtherFollowUp.DataBind(); } }