Ejemplo n.º 1
0
        public virtual AgencyDomain CreateAgencyDomain()
        {
            AgencyEntity entity = new AgencyEntity();
            entity.AgencyId = Guid.NewGuid().ToString();

            return new AgencyDomain(entity);
        }
Ejemplo n.º 2
0
 ///<summary>
 /// Set entity data
 ///</summary>
 private void SetEntity(AgencyEntity objEntity)
 {
     txtAgencyName.Text = objEntity.AgencyName;
     if (objEntity.Isenable)
     {
         rblEnable.SelectedIndex = 0;
     }
 }
Ejemplo n.º 3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                AgencyEntity entity = new AgencyEntity();
                if (!string.IsNullOrEmpty(Agency_ID))
                {
                    entity = MainService.AgencyService.GetAgencyEntityById(Agency_ID);

                    entity.AgencyName = txtAgencyName.Text.Trim();
                    entity.Isenable = rblEnable.SelectedIndex == 0 ? true : false;
                    entity.ModifyDate = DateTime.Now;
                    entity.ModifyUser = base.CurrentUser.SecUserEntity.UserId;

                    if (MainService.AgencyService.Update(entity))
                    {
                        AlertAndClose("Operation success!");
                    }
                    else
                    {
                        AlertMessage("Operation fail!");
                    }

                }
                else
                {
                    if (MainService.AgencyService.IsAgencyNameExist(txtAgencyName.Text.Trim()))
                    {
                        AlertMessage("This Agency Name is exist, please try another again!");
                        return ;
                    }

                    entity = new AgencyEntity();
                    entity.AgencyId = Guid.NewGuid().ToString();
                    entity.AgencyName = txtAgencyName.Text.Trim();
                    entity.Isenable = rblEnable.SelectedIndex == 0 ? true : false;
                    entity.CreateDate = DateTime.Now;
                    entity.CreateUser = base.CurrentUser.SecUserEntity.UserId;
                    entity.ModifyDate = DateTime.Now;
                    entity.ModifyUser = base.CurrentUser.SecUserEntity.UserId;

                    if (MainService.AgencyService.Insert(entity))
                    {
                        AlertAndClose("Operation success!");
                    }
                    else
                    {
                        AlertMessage("Operation fail!");
                    }
                }

            }
            catch (Exception ex)
            {
                AlertMessage(ex.ToString());
            }
        }
Ejemplo n.º 4
0
 public virtual void UpdateAgencyEntity(AgencyEntity entity, DataAccessBroker broker)
 {
     DataAccess.Update(entity, broker);
 }
Ejemplo n.º 5
0
 public virtual void InsertAgencyEntity(AgencyEntity entity, DataAccessBroker broker)
 {
     DataAccess.Insert(entity, broker);
 }
Ejemplo n.º 6
0
 public AgencyDomain(AgencyEntity entity)
     : base(entity)
 {
     masterEntity = entity;
 }