Пример #1
0
        protected void MasterPage_YesClickHandler(object sender, EventArgs e)
        {
            if (ViewState["Delete"] != null)
            {
                try
                {
                    DeviceAreaEntity entity = new DeviceAreaEntity();
                    entity.OperationId  = (int)OperationType.Delete;
                    entity.DeviceAreaId = Utility.GetInt(ViewState["DeviceAreaId"]);

                    OperationStatusEntity c = new DeviceRepository(SessionContext).UpdateDeviceArea(entity);

                    if (c.StatusResult == true)
                    {
                        ShowInfoMessage(c.InfoMessage);
                        ClearPageControl();
                        FillGrid();
                    }
                    else
                    {
                        ShowErrorMessage(c.InfoMessage);
                    }
                }
                catch (BaseException bex)
                {
                    ShowErrorMessage(bex.Message);
                }
            }
        }
Пример #2
0
        public OperationStatusEntity UpdateDeviceArea(DeviceAreaEntity param)
        {
            var parameters = new object[]
            {
                param.OperationId, param.DeviceAreaId, param.DeviceAreaName
            };

            return(EntityBase.FillObject <OperationStatusEntity>("DeviceAreaManage", parameters));
        }
Пример #3
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                ValidateBusinessData("G1");

                DeviceAreaEntity entity = new DeviceAreaEntity();

                if (Convert.ToString(ViewState["Add"]) == "Add")
                {
                    entity.OperationId = 1;
                }
                else if (Convert.ToString(ViewState["Update"]) == "Update")
                {
                    entity.OperationId  = 2;
                    entity.DeviceAreaId = Utility.GetInt(ViewState["DeviceAreaId"]);
                }

                entity.DeviceAreaName = txtDeviceAreaName.Text.Trim();

                OperationStatusEntity c = new DeviceRepository(SessionContext).UpdateDeviceArea(entity);

                if (c.StatusResult == true)
                {
                    ShowInfoMessage(c.InfoMessage);
                    ClearPageControl();
                    FillGrid();
                }
                else
                {
                    ShowErrorMessage(c.InfoMessage);
                }
            }
            catch (ValidationException ex)
            {
                ShowErrorMessage(ex.Message);
            }

            catch (BaseException be)
            {
                ShowErrorMessage(be.DisplayMessage);
            }
        }