Example #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            AdditionalFollowupInfo objAdditionalFollowupInfo = new AdditionalFollowupInfo();
            objAdditionalFollowupInfo.AdditionalFollowUpInfoDesc = txtAdditionalFollowUpInfoDesc.Text;
            objAdditionalFollowupInfo.Status = 1;

            if (!string.IsNullOrEmpty(hfAdditionalFollowUpInfoID.Value.ToString()))
            {
                objAdditionalFollowupInfo.AdditionalFollowUpInfoID = Convert.ToInt32(hfAdditionalFollowUpInfoID.Value);
                objAdditionalFollowupInfo.AdditionalFollowUpInfoDesc = txtAdditionalFollowUpInfoDesc.Text;
                objAdditionalFollowupInfo.UpdatedBy = UserAuthentication.GetUserId(this.Page);
                objAdditionalFollowupInfo.UpdatedDate = DateTime.Now;
                AdditionalFollowUpInfoBO.UpdateAdditionalFollowUpInfo(objAdditionalFollowupInfo);
            }
            else
            {
                objAdditionalFollowupInfo.CreatedBy = UserAuthentication.GetUserId(this.Page);
                objAdditionalFollowupInfo.CreatedDate = DateTime.Now;
                AdditionalFollowUpInfoBO.InsertAddtionalFollowUpInfo(objAdditionalFollowupInfo);
            }

            txtAdditionalFollowUpInfoDesc.Text = string.Empty;
            hfAdditionalFollowUpInfoID.Value = string.Empty;
            loadAdditionalFollowupInfo();
        }
 // GET api/additionalfollowupinfo
 public IEnumerable<AdditionalFollowupInfo> Get()
 {
     List<AdditionalFollowupInfo> listAdditionalFollowupInfo = new List<AdditionalFollowupInfo>();
     DataView dvAdditionalFollowupInfo = AdditionalFollowUpInfoBO.GetAdditionalFollowupInfoIDForSync();
     foreach (DataRowView drvAdditionalFollowupInfo in dvAdditionalFollowupInfo)
     {
         AdditionalFollowupInfo AdditionalFollowupInfo = new AdditionalFollowupInfo();
         listAdditionalFollowupInfo.Add(AdditionalFollowUpInfoBO.GetAdditionalFollowupInfo(Convert.ToInt32(drvAdditionalFollowupInfo["AdditionalFollowUpInfoID"])));
     }
     return listAdditionalFollowupInfo;
 }
 // POST api/additionalfollowupinfo
 public AdditionalFollowupInfo Post(AdditionalFollowupInfo AdditionalFollowupInfo)
 {
     if (AdditionalFollowupInfo.GUID > 0)
     {
         AdditionalFollowupInfo.AdditionalFollowUpInfoID = AdditionalFollowupInfo.GUID;
         int rowResult = AdditionalFollowUpInfoBO.UpdateAdditionalFollowUpInfo(AdditionalFollowupInfo);
         //Return Back to The Client               
         return AdditionalFollowupInfo;
     }
     else
     {               
         AdditionalFollowupInfo.SyncStatus = 1;
         int rowResult = AdditionalFollowUpInfoBO.InsertAddtionalFollowUpInfo(AdditionalFollowupInfo);
         //Return Back to The Client               
         return AdditionalFollowupInfo;
     }
 }
        public int InsertAddtionalFollowUpInfo(AdditionalFollowupInfo objAdditionalFollowupInfo)
        {
            objAdditionalFollowupInfo.AdditionalFollowUpInfoID = 1;
            BeginTransaction();

            try
            {
                objAdditionalFollowupInfo.AdditionalFollowUpInfoID = Insert(objAdditionalFollowupInfo);
                CommitTransaction();
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                objAdditionalFollowupInfo.AdditionalFollowUpInfoID = -1;
            }

            return objAdditionalFollowupInfo.AdditionalFollowUpInfoID;
        }
        public int DeleteAdditionalFollowUpInfo(AdditionalFollowupInfo objAdditionalFollowUpInfo)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "Status" };
                rowsaffected = Update(objAdditionalFollowUpInfo, UpdateProperties);

                CommitTransaction();
            }
            catch (Exception e)
            {
                RollBackTransaction();
                rowsaffected = -1;
            }
            return rowsaffected;

        }
Example #6
0
        protected void gvAdditionalFollowUpInfo_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            hfAdditionalFollowUpInfoID.Value = e.CommandArgument.ToString();
            AdditionalFollowupInfo objAdditionalFollowupInfo = new AdditionalFollowupInfo();

            if (e.CommandName.Equals("cmdEdit"))
            {
                objAdditionalFollowupInfo = AdditionalFollowUpInfoBO.GetAdditionalFollowupInfo(Convert.ToInt32(e.CommandArgument));
                txtAdditionalFollowUpInfoDesc.Text = objAdditionalFollowupInfo.AdditionalFollowUpInfoDesc;
            }
            else if (e.CommandName.Equals("cmdDelete"))
            {
                int AdditionalFollowUpInfoID = Convert.ToInt32(e.CommandArgument);
                objAdditionalFollowupInfo.AdditionalFollowUpInfoID = AdditionalFollowUpInfoID;
                objAdditionalFollowupInfo.Status = 0;
                AdditionalFollowUpInfoBO.DeleteAdditionalFollowUpInfo(objAdditionalFollowupInfo);
                loadAdditionalFollowupInfo();
               
            }
        }
 public static int DeleteAdditionalFollowUpInfo(AdditionalFollowupInfo objAdditionalFollowUpInfo)
 {
     return new AddtionalFollowUpInfoDAO().DeleteAdditionalFollowUpInfo(objAdditionalFollowUpInfo);
 }
 public static AdditionalFollowupInfo GetAdditionalFollowupInfo(int AdditionalFollowUpInfoID)
 {
     AdditionalFollowupInfo objAdditionalFollowupInfo = new AdditionalFollowupInfo();
     return (AdditionalFollowupInfo)(new AddtionalFollowUpInfoDAO().FillDTO(objAdditionalFollowupInfo, "AdditionalFollowUpInfoID=" + AdditionalFollowUpInfoID));
 }
 public static int InsertAddtionalFollowUpInfo(AdditionalFollowupInfo objAdditionalFollowupInfo)
 {
     return new AddtionalFollowUpInfoDAO().InsertAddtionalFollowUpInfo(objAdditionalFollowupInfo);
 }