示例#1
0
        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();
        }
示例#2
0
        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;
        }
示例#3
0
        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;

        } 
示例#4
0
 public static int UpdateReferralTo(ReferralTo objReferralTo)
 {
     return new ReferralToDAO().UpdateReferralTo(objReferralTo);
 }
示例#5
0
 public static ReferralTo GetReferralTo(int ReferralToID)
 {
     ReferralTo objCaseType = new ReferralTo();
     return (ReferralTo)(new ReferralToDAO().FillDTO(objCaseType, "ReferralToID=" + ReferralToID));
 }
示例#6
0
 public static int InsertReferralTo(ReferralTo objReferralTo)
 {
     return new ReferralToDAO().InsertReferralTo(objReferralTo);
 }