protected void btnSave_Click(object sender, EventArgs e) { ReferralTo objReferralTo = new ReferralTo(); objReferralTo.ReferralToDesc = txtReferralToDesc.Text; if (!string.IsNullOrEmpty(hfReferralToID.Value.ToString())) { objReferralTo.UpdatedBy = UserAuthentication.GetUserId(this.Page); objReferralTo.UpdatedDate = DateTime.Now; objReferralTo.ReferralToID = Convert.ToInt32(hfReferralToID.Value); objReferralTo.ReferralToDesc = txtReferralToDesc.Text; ReferralToBO.UpdateReferralTo(objReferralTo); } else { objReferralTo.CreatedBy = UserAuthentication.GetUserId(this.Page); objReferralTo.CreatedDate = DateTime.Now; ReferralToBO.InsertReferralTo(objReferralTo); } txtReferralToDesc.Text = string.Empty; hfReferralToID.Value = string.Empty; loadReferralTo(); }
public int InsertReferralTo(ReferralTo objReferralTo) { objReferralTo.ReferralToID = 1; BeginTransaction(); try { objReferralTo.ReferralToID = Insert(objReferralTo); CommitTransaction(); } catch (Exception ex) { RollBackTransaction(); objReferralTo.ReferralToID = -1; } return objReferralTo.ReferralToID; }
public int UpdateReferralTo(ReferralTo objReferralTo) { int rowsaffected = -1; BeginTransaction(); try { String[] UpdateProperties = new String[] { "ReferralToDesc", "UpdatedBy", "UpdatedDate" }; rowsaffected = Update(objReferralTo, UpdateProperties); CommitTransaction(); } catch (Exception e) { RollBackTransaction(); rowsaffected = -1; } return rowsaffected; }
public static int UpdateReferralTo(ReferralTo objReferralTo) { return new ReferralToDAO().UpdateReferralTo(objReferralTo); }
public static ReferralTo GetReferralTo(int ReferralToID) { ReferralTo objCaseType = new ReferralTo(); return (ReferralTo)(new ReferralToDAO().FillDTO(objCaseType, "ReferralToID=" + ReferralToID)); }
public static int InsertReferralTo(ReferralTo objReferralTo) { return new ReferralToDAO().InsertReferralTo(objReferralTo); }