示例#1
0
    protected void loadUsers()
    {
        ClsITBA ba = new ClsITBA();
        List <clsEDISpecialist> qShipMeth = SrvEDISpecialist.GetEDISpecialistView();

        rgITBA.DataSource = qShipMeth;
    }
示例#2
0
 protected void rgITBA_UpdateCommand(object source, GridCommandEventArgs e)
 {
     try
     {
         UserControl      userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
         Label            errorMsg    = (Label)userControl.FindControl("lblErrorMessage");
         clsEDISpecialist oRow        = populateObj(userControl);
         oRow.idEDISpecialist = Convert.ToInt16((userControl.FindControl("hdnITBAID") as HiddenField).Value);
         string updateMsg = "";
         if (IsValid)
         {
             if (oRow != null)
             {
                 updateMsg = SrvEDISpecialist.UpdateEDISpecialist(oRow);
                 if (updateMsg == "")
                 {
                     lblSuccess.Text = "Successfully updated information for " + "'" + oRow.Name + "'";
                 }
                 else
                 {
                     errorMsg.Visible = true;
                     errorMsg.Text    = updateMsg;
                     e.Canceled       = true;
                 }
             }
         }
         else
         {
             errorMsg.Visible = true;
             errorMsg.Text    = "Please enter Required fields";
             e.Canceled       = true;
         }
     }
     catch (Exception ex)
     {
         pnlDanger.Visible = true;
         lblDanger.Text    = ex.Message.ToString();
         e.Canceled        = true;
     }
 }
示例#3
0
 protected void rgITBA_InsertCommand(object sender, GridCommandEventArgs e)
 {
     try
     {
         UserControl      userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
         Label            errorMsg    = (Label)userControl.FindControl("lblErrorMessage");
         clsEDISpecialist oRow        = populateObj(userControl);
         string           insertMsg   = "";
         if (IsValid)
         {
             if (oRow != null)
             {
                 insertMsg = SrvEDISpecialist.InsertEDISpecialist(oRow);
                 if (insertMsg == "")
                 {
                     lblSuccess.Text = "Successfully Added New Record " + oRow.Name;
                 }
                 else
                 {
                     errorMsg.Visible = true;
                     errorMsg.Text    = insertMsg;
                     e.Canceled       = true;
                 }
             }
         }
         else
         {
             errorMsg.Visible = true;
             errorMsg.Text    = "Please enter Required fields";
             e.Canceled       = true;
         }
     }
     catch (Exception ex)
     {
         pnlDanger.Visible = true;
         lblDanger.Text    = ex.Message.ToString();
         e.Canceled        = true;
     }
 }