Пример #1
0
 protected void ButtonSave_Click(object sender, EventArgs e)
 {
     ProceduresTableAdapters.ProcedureSelectCommandTableAdapter procTA = new ProceduresTableAdapters.ProcedureSelectCommandTableAdapter();
     if (Request["ProcedureId"] != null && Request["ProcedureId"].Length > 0)
     {
         procTA.ProcedureUpdateCommand(TextBoxProcedureName.Text,int.Parse(DropDownListModalities.SelectedValue),TextBoxCPTCode.Text,loggedInUserId,int.Parse(Request["ProcedureId"]));
         Response.Redirect("~/Technologist/ProceduresList.aspx");
     }
     else
     {
         procTA.ProcedureInsertCommand(int.Parse(DropDownListModalities.SelectedValue), TextBoxProcedureName.Text, TextBoxCPTCode.Text, loggedInUserId);
     }
 }
Пример #2
0
 protected override void Page_Load_Extended(object sender, EventArgs e)
 {
     LabelError.Visible = false;
     if (Request["ProcedureId"] != null && Request["ProcedureId"].Length > 0)
     {
         ButtonSave.Text = "Update Procedure";
         ProceduresTableAdapters.ProcedureSelectCommandTableAdapter procTA = new ProceduresTableAdapters.ProcedureSelectCommandTableAdapter();
         Procedures.ProcedureSelectCommandDataTable procDT = procTA.GetProcedure(int.Parse(Request["ProcedureId"]));
         IEnumerator procIEnum = procDT.GetEnumerator();
         if(procIEnum.MoveNext())
         {
             Procedures.ProcedureSelectCommandRow procDR = (Procedures.ProcedureSelectCommandRow)procIEnum.Current;
             try
             {
                 TextBoxProcedureName.Text = procDR.ProcedureName;
                 DropDownListModalities.SelectedValue = procDR.ModalityId.ToString();
                 TextBoxCPTCode.Text = procDR.CPTCode;
             }
             catch (StrongTypingException ex)
             { }
         }
     }
 }