Beispiel #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            VisitFrequencies objVisitFrequencies = new VisitFrequencies();
            objVisitFrequencies.VisitFrequencyDesc = txtVisitFrequencyDesc.Text;
            objVisitFrequencies.Status = 1;

            if (!string.IsNullOrEmpty(hfVisitFrequencyID.Value.ToString()))
            {
                objVisitFrequencies.UpdatedBy = UserAuthentication.GetUserId(this.Page);
                objVisitFrequencies.UpdatedDate = DateTime.Now;
                objVisitFrequencies.VisitFrequencyID = Convert.ToInt32(hfVisitFrequencyID.Value);
                objVisitFrequencies.VisitFrequencyDesc = txtVisitFrequencyDesc.Text;
                VisitFrequenciesBO.UpdateVisitFrequencies(objVisitFrequencies);
            }
            else
            {
                objVisitFrequencies.CreatedBy = UserAuthentication.GetUserId(this.Page);
                objVisitFrequencies.CreatedDate = DateTime.Now;
                VisitFrequenciesBO.InsertVisitFrequencies(objVisitFrequencies);
            }

            txtVisitFrequencyDesc.Text = string.Empty;
            hfVisitFrequencyID.Value = string.Empty;
            hfVisitFrequencyID.Value = string.Empty;
            loadVisitFrequency();
        }
        public int InsertVisitFrequencies(VisitFrequencies objVisitFrequencies)
        {
            objVisitFrequencies.VisitFrequencyID = 1;
            BeginTransaction();

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

            return objVisitFrequencies.VisitFrequencyID;
        }
Beispiel #3
0
        protected void gvVisitFrequency_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            hfVisitFrequencyID.Value = e.CommandArgument.ToString();
            VisitFrequencies objVisitFrequencies = new VisitFrequencies();

            if (e.CommandName.Equals("cmdEdit"))
            {
                objVisitFrequencies = VisitFrequenciesBO.GetVisitFrequencies(Convert.ToInt32(e.CommandArgument));
                txtVisitFrequencyDesc.Text = objVisitFrequencies.VisitFrequencyDesc;
            }
            else if (e.CommandName.Equals("cmdDelete"))
            {
                int VisitFrequencyID = Convert.ToInt32(e.CommandArgument);
                objVisitFrequencies.VisitFrequencyID = VisitFrequencyID;
                objVisitFrequencies.Status = 0;
                VisitFrequenciesBO.DeleteVisitFrequencies(objVisitFrequencies);
                loadVisitFrequency();
            }
        }
        public int DeleteVisitFrequencies(VisitFrequencies objVisitFrequencies)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "Status" };
                rowsaffected = Update(objVisitFrequencies, UpdateProperties);

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

        }
 public static int DeleteVisitFrequencies(VisitFrequencies objVisitFrequencies)
 {
     return new VisitFrequenciesDAO().DeleteVisitFrequencies(objVisitFrequencies);
 }
 public static int UpdateVisitFrequencies(VisitFrequencies objVisitFrequencies)
 {
     return new VisitFrequenciesDAO().UpdateVisitFrequencies(objVisitFrequencies);
 }
 public static VisitFrequencies GetVisitFrequencies(int VisitFrequencyID)
 {
     VisitFrequencies objVisitFrequencies = new VisitFrequencies();
     return (VisitFrequencies)(new VisitFrequenciesDAO().FillDTO(objVisitFrequencies, "VisitFrequencyID=" + VisitFrequencyID));
 }
 public static int InsertVisitFrequencies(VisitFrequencies objVisitFrequencies)
 {
     return new VisitFrequenciesDAO().InsertVisitFrequencies(objVisitFrequencies);
 }