protected void RepDetailsConfirm_ItemDataBound(object sender, RepeaterItemEventArgs e) { TextBox txtPODId = null; Label lblSCMasterAutoId = null; Label lblDocumentNo = null; Label lblInvoiceNo = null; txtPODId = (TextBox)e.Item.FindControl("txtPODId"); lblSCMasterAutoId = (Label)e.Item.FindControl("lblSCMasterAutoId"); lblDocumentNo = (Label)e.Item.FindControl("lblDocumentNo"); lblInvoiceNo = (Label)e.Item.FindControl("lblInvoiceNo"); Label lblCustName = (Label)e.Item.FindControl("lblCustName"); GridView grdView = (GridView)e.Item.FindControl("grdCD"); ViewState["DocNo"] = ViewState["DocNo"] + "," + txtDocNoGet.Text + ","; DataSet Ds = new DataSet(); if (txtCourierId.Text.ToString() != "") { Ds = CourierDetails.UpdatePOD(float.Parse(txtCourierId.Text), "CourierId", Convert.ToInt32(strFY)); } else if (txtInvoiceNoGet.Text.ToString() != "") { Ds = CourierDetails.UpdatePOD(float.Parse(txtInvoiceNoGet.Text), "Invoice", Convert.ToInt32(strFY)); } else if (txtDocNoGet.Text.ToString() != "") { Ds = CourierDetails.UpdatePOD(float.Parse(txtDocNoGet.Text), "DocNo", Convert.ToInt32(strFY)); } DataView dv = new DataView(Ds.Tables[0]); grdView.DataSource = dv; grdView.DataBind(); }
protected void RepDetailsConfirm_ItemCommand(object source, RepeaterCommandEventArgs e) { CourierDetails _objCD = new CourierDetails(); try { DataSet DS = new DataSet(); Repeater objrep = (Repeater)this.FindControl("RepDetailsConfirm"); GridView objgrid = (GridView)objrep.Items[e.Item.ItemIndex].FindControl("grdCD"); foreach (GridViewRow row in objgrid.Rows) { _objCD.SCMasterAutoId = float.Parse(((Label)row.FindControl("lblSCMasterAutoId")).Text); _objCD.DocumentNo = float.Parse(((Label)row.FindControl("lblDocumentNo")).Text); _objCD.InvoiceNo = float.Parse(((Label)row.FindControl("lblInvoiceNo")).Text); _objCD.POD = Convert.ToInt32(((TextBox)row.FindControl("txtPODId")).Text); _objCD.CreatedBy = Convert.ToString(Session["UserName"]); if (txtCourierId.Text.ToString() != "") { _objCD.UpdatePODNo(_objCD.SCMasterAutoId, _objCD.DocumentNo, _objCD.InvoiceNo, "CourierId", _objCD.POD, Convert.ToInt32(strFY)); DS = CourierDetails.UpdatePOD(float.Parse(txtCourierId.Text), "CourierId", Convert.ToInt32(strFY)); } else if (txtInvoiceNoGet.Text.ToString() != "") { _objCD.UpdatePODNo(_objCD.SCMasterAutoId, _objCD.DocumentNo, _objCD.InvoiceNo, "Invoice", _objCD.POD, Convert.ToInt32(strFY)); DS = CourierDetails.UpdatePOD(float.Parse(txtInvoiceNoGet.Text), "Invoice", Convert.ToInt32(strFY)); } else if (txtDocNoGet.Text.ToString() != "") { _objCD.UpdatePODNo(_objCD.SCMasterAutoId, _objCD.DocumentNo, _objCD.InvoiceNo, "DocNo", _objCD.POD, Convert.ToInt32(strFY)); DS = CourierDetails.UpdatePOD(float.Parse(txtDocNoGet.Text), "DocNo", Convert.ToInt32(strFY)); } } RepDetailsConfirm.DataSource = DS.Tables[1]; RepDetailsConfirm.DataBind(); } catch (Exception ex) { MessageBox(ex.Message.ToString()); } }
protected void btnget_Click(object sender, EventArgs e) { ViewState["DocNo"] = ViewState["DocNo"] + "," + txtDocNoGet.Text + ","; DataSet Ds = new DataSet(); if (txtCourierId.Text.ToString() != "") { Ds = CourierDetails.UpdatePOD(float.Parse(txtCourierId.Text), "CourierId", Convert.ToInt32(strFY)); } else if (txtInvoiceNoGet.Text.ToString() != "") { Ds = CourierDetails.UpdatePOD(float.Parse(txtInvoiceNoGet.Text), "Invoice", Convert.ToInt32(strFY)); } else if (txtDocNoGet.Text.ToString() != "") { Ds = CourierDetails.UpdatePOD(float.Parse(txtDocNoGet.Text), "DocNo", Convert.ToInt32(strFY)); } RepDetailsConfirm.DataSource = Ds.Tables[1]; RepDetailsConfirm.DataBind(); }