Ejemplo n.º 1
0
        private void FillDropDown()
        {
            ddlJobPosition.DataSource     = JobPositionService.GetActiveJobPositions();
            ddlJobPosition.DataTextField  = "Name";
            ddlJobPosition.DataValueField = "ID";
            ddlJobPosition.DataBind();

            ddlInformationSource.DataSource = InformationSourceService.GetInformationSources();
            ddlInformationSource.DataBind();
            ddlInformationSource.Items.Insert(0, new DropDownListItem(String.Empty));
        }
 protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
 {
     if (e.CommandName == "EditRow")
     {
         mvwForm.SetActiveView(viwAddEdit);
         RowID = Convert.ToInt32(e.CommandArgument);
         var infSrc = InformationSourceService.GetInformationSource(RowID);
         txtName.Text = infSrc.Description;
         txtName.Focus();
     }
 }
 protected void lnbDelete_Click(object sender, EventArgs e)
 {
     try
     {
         int[] arrayOfID = RadHelper.GetRowIdForDeletion(RadGrid1);
         if (InformationSourceService.CanDeleteInformationSource(arrayOfID))
         {
             InformationSourceService.DeleteInformationSource(arrayOfID);
             btnCancel_Click(sender, e);
         }
     }
     catch (Exception ex)
     {
         WebFormHelper.SetLabelTextForException(lblStatus, ex, LabelStyleNames.ErrorMessage);
     }
 }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Page.Validate("AddEdit");
            if (!Page.IsValid)
            {
                return;
            }

            try
            {
                InformationSourceService.AddOrUpdateBank(RowID, txtName.Text);
                ReloadCurrentPage();
            }
            catch (Exception ex)
            {
                WebFormHelper.SetLabelTextForException(lblStatusAddEdit, ex, LabelStyleNames.ErrorMessage);
            }
        }