protected void btnSave_Click(object sender, EventArgs e) { List <Ent_tticol125> parameterCollection = new List <Ent_tticol125>(); Ent_tticol125 obj = new Ent_tticol125(); foreach (GridViewRow fila in grdRecords.Rows) { DropDownList lista = ((DropDownList)fila.Cells[8].Controls[1]); if (lista != null) { if (Convert.ToInt32(lista.SelectedValue) == 1) { obj = new Ent_tticol125(); //obj.pdno = txtWorkOrder.Text.Trim().ToUpper(); obj.pdno = Order; obj.pono = Convert.ToInt32(fila.Cells[0].Text); obj.item = fila.Cells[1].Text; obj.cwar = fila.Cells[3].Text.Trim(); obj.clot = string.IsNullOrEmpty(fila.Cells[4].Text) ? " " : fila.Cells[4].Text; obj.reqt = Convert.ToDecimal(fila.Cells[6].Text); obj.refcntd = "0"; obj.refcntu = "0"; obj.mess = " "; obj.paid = txtPalletId.Text.Trim().ToUpper(); obj.prin = Convert.ToInt32(((Label)fila.Cells[8].FindControl("prin")).Text); obj.conf = Convert.ToInt32(lista.SelectedValue);; obj.idrecord = grdRecords.DataKeys[fila.RowIndex].Value.ToString(); //Requerimiento No. 46122. //Insertar en la tabla ticol080 //CChaverra 28/07/2017 obj.user = Session["user"].ToString(); parameterCollection.Add(obj); } } } InterfazDAL_tticol125 idal = new InterfazDAL_tticol125(); idal.actualizarRegistro_Param(ref parameterCollection, ref strError, Aplicacion); //Update status updataPalletStatus on table (whcol131, ticol022, ticol042) to delivered. paramList.Add("p2", 9);// , whcol131 -Delieverd status=9 // paramList.Add("p3", 11); // , ticol022, ticol042 -Delieverd status=11 bool resultado = idal.updataPalletStatus(ref obj, ref strError); printResult.Visible = true; lblResult.Text = mensajes("msjsave"); lblResult.ForeColor = System.Drawing.Color.Green; this.HeaderGrid.Visible = false; grdRecords.DataSource = ""; grdRecords.DataBind(); if (strError != string.Empty) { lblResult.Text = strError; lblResult.ForeColor = System.Drawing.Color.Red; Label control = ((Label)Page.Controls[0].FindControl("lblPageTitle")); control.Text = strError; return; //throw new System.InvalidOperationException(strError); } }