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[7].Controls[1]); if (lista != null) { if (Convert.ToInt32(lista.SelectedValue) == 1) { obj = new Ent_tticol125(); obj.pdno = txtWorkOrder.Text.Trim(); 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[5].Text); obj.refcntd = "0"; obj.refcntu = "0"; obj.mess = " "; 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); printResult.Visible = true; lblResult.Text = "Records was saved succesfully."; this.HeaderGrid.Visible = false; grdRecords.DataSource = ""; grdRecords.DataBind(); if (strError != string.Empty) { lblResult.Text = strError; Label control = ((Label)Page.Controls[0].FindControl("lblPageTitle")); control.Text = strError; return; //throw new System.InvalidOperationException(strError); } }
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); } }
protected void Page_Load(object sender, EventArgs e) { string rutaServ = string.Empty; DataRow fila = (DataRow)Session["FilaImprimir"]; if (fila == null) { return; } // string id = LblWorkOrder.Text = fila.ItemArray[0].ToString().Trim(); lblLotCode.Text = fila.ItemArray[4].ToString().Trim(); lblItem.Text = fila.ItemArray[2].ToString().Trim(); lblArticulo.Text = fila.ItemArray[15].ToString().Trim(); lblQuantity.Text = fila.ItemArray[5].ToString().Trim(); lblUnit.Text = fila.ItemArray[14].ToString().Trim(); lblUser.Text = fila.ItemArray[6].ToString().Trim(); lblStatPrint.Text = fila.ItemArray[8].ToString().Trim() == "1"?"Reprinted":"Printed"; string PalletId = fila.ItemArray[13].ToString().Trim(); //lblDate.Text = fila.ItemArray[7].ToString().Trim(); string siteName = ConfigurationManager.AppSettings["enlaceRet"].ToString(); rutaServ = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + PalletId + "&code=Code128&dpi=96"; imgPalletId.Src = !string.IsNullOrEmpty(PalletId) ? rutaServ : ""; rutaServ = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + LblWorkOrder.Text + "&code=Code128&dpi=96"; imgWorkOrder.Src = !string.IsNullOrEmpty(LblWorkOrder.Text) ? rutaServ : ""; rutaServ = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + lblLotCode.Text + "&code=Code128&dpi=96"; imgLotCode.Src = !string.IsNullOrEmpty(lblLotCode.Text) ? rutaServ : ""; rutaServ = UrlBaseBarcode + "/Barcode/BarcodeHandler.ashx?data=" + lblItem.Text + "&code=Code128&dpi=96"; imgItem.Src = !string.IsNullOrEmpty(lblItem.Text) ? rutaServ : ""; Type csType = this.GetType(); ClientScriptManager scriptBlock = Page.ClientScript; string cstext1 = "printDiv('Label');"; scriptBlock.RegisterStartupScript(csType, "printerLabel", cstext1, true); if (Session["update"] != null) { return; } List <Ent_tticol125> parameterCollection = new List <Ent_tticol125>(); Ent_tticol125 obj = new Ent_tticol125(); //Actualizar estado de impresion obj = new Ent_tticol125(); obj.paid = fila.ItemArray[13].ToString().Trim(); obj.pdno = fila.ItemArray[0].ToString().Trim(); obj.pono = Convert.ToInt32(fila.ItemArray[1].ToString().Trim()); obj.item = fila.ItemArray[2].ToString(); obj.cwar = fila.ItemArray[3].ToString().Trim(); obj.clot = string.IsNullOrEmpty(fila.ItemArray[4].ToString().Trim()) ? " " : fila.ItemArray[4].ToString().Trim(); obj.reqt = Convert.ToDecimal(fila.ItemArray[5].ToString().Trim()); obj.refcntd = "0"; obj.refcntu = "0"; obj.mess = " "; obj.conf = Convert.ToInt32(fila.ItemArray[9].ToString().Trim()); obj.prin = 1; obj.idrecord = fila.ItemArray[16].ToString().Trim(); parameterCollection.Add(obj); InterfazDAL_tticol125 idal = new InterfazDAL_tticol125(); if (fila.ItemArray.Count() > 16) { if (fila.ItemArray[16].ToString().Trim() == "126") { idal.actualizarRegistro_Param(ref parameterCollection, ref strError, Aplicacion, true); return; } } idal.actualizarRegistro_Param(ref parameterCollection, ref strError, Aplicacion); Session.Remove("IsPreviousPage"); //ScriptManager.RegisterStartupScript(this, this.GetType(), "printDiv", "javascript:printDiv('Label');", true); }