예제 #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            StakeHolders objStakeHolders = new StakeHolders();
            objStakeHolders.StakeHolderName = txtStakeHolderName.Text;

            if (!string.IsNullOrEmpty(hfStakeHolderID.Value.ToString()))
            {
                objStakeHolders.UpdatedBy = UserAuthentication.GetUserId(this.Page);
                objStakeHolders.UpdatedDate = DateTime.Now;
                objStakeHolders.StakeHolderID = Convert.ToInt32(hfStakeHolderID.Value);
                objStakeHolders.StakeHolderName = txtStakeHolderName.Text;
                StakeholderBO.UpdateStakeHolders(objStakeHolders);

            }
            else
            {
                objStakeHolders.CreatedBy = UserAuthentication.GetUserId(this.Page);
                objStakeHolders.CreatedDate = DateTime.Now;
                StakeholderBO.InsertStakeHolders(objStakeHolders);
            }
            
            txtStakeHolderName.Text = string.Empty;
            hfStakeHolderID.Value = string.Empty;
            loadStakeHolder();
        }
예제 #2
0
        public int InsertStakeHolders(StakeHolders objStakeHolders)
        {
            objStakeHolders.StakeHolderID = 1;
            BeginTransaction();

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

            return objStakeHolders.StakeHolderID;
        }
예제 #3
0
        public int UpdateStakeHolders(StakeHolders objStakeHolders)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "StakeHolderName", "UpdatedBy", "UpdatedDate" };
                rowsaffected = Update(objStakeHolders, UpdateProperties);

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

        }
예제 #4
0
 public static int UpdateStakeHolders(StakeHolders objStakeHolders)
 {
     return new StakeholderDAO().UpdateStakeHolders(objStakeHolders);
 }
예제 #5
0
 public static StakeHolders GetStakeHolders(int StakeHolderID)
 {
     StakeHolders objStakeHolders = new StakeHolders();
     return (StakeHolders)(new StakeholderDAO().FillDTO(objStakeHolders, "StakeHolderID=" + StakeHolderID));
 }
예제 #6
0
 public static int InsertStakeHolders(StakeHolders objStakeHolders)
 {
     return new  StakeholderDAO().InsertStakeHolders(objStakeHolders);
 }