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(); }
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; }
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; }
public static int UpdateStakeHolders(StakeHolders objStakeHolders) { return new StakeholderDAO().UpdateStakeHolders(objStakeHolders); }
public static StakeHolders GetStakeHolders(int StakeHolderID) { StakeHolders objStakeHolders = new StakeHolders(); return (StakeHolders)(new StakeholderDAO().FillDTO(objStakeHolders, "StakeHolderID=" + StakeHolderID)); }
public static int InsertStakeHolders(StakeHolders objStakeHolders) { return new StakeholderDAO().InsertStakeHolders(objStakeHolders); }