protected void rdoSelect_CheckedChanged(object sender, EventArgs e) { foreach (DataGridItem dgItem in dgItemLookUp.Items) { RadioButton rdoSelect = dgItem.Cells[0].FindControl("rdoSelect") as RadioButton; if (rdoSelect.Checked) { TextBox txtPO = dgItem.Cells[1].FindControl("txtPO") as TextBox; TextBox txtLineNo = dgItem.Cells[2].FindControl("txtLineNo") as TextBox; TextBox txtItemNo = dgItem.Cells[3].FindControl("txtItemNo") as TextBox; DataSet ds = ger.MarkPOLine(txtPO.Text, txtLineNo.Text, txtItemNo.Text); if (ds.Tables[0].Rows.Count != 0) { txtItem.Text = ds.Tables[0].Rows[0]["No_"].ToString(); lblLine.Text = ds.Tables[0].Rows[0]["Line No_"].ToString(); lblQty.Text = string.Format("{0:#,###}", Convert.ToDecimal(ds.Tables[0].Rows[0]["Outstanding Quantity"].ToString())); txtInvQty.Text = string.Format("{0:#,###}", Convert.ToDecimal(ds.Tables[0].Rows[0]["Outstanding Quantity"].ToString())); lblPOCost.Text = string.Format("{0:#,##0.00}", Convert.ToDecimal(ds.Tables[0].Rows[0]["Alt_ Price"].ToString())); lblUOM.Text = ds.Tables[0].Rows[0]["Alt_ Price UOM"].ToString(); txtInvCost.Text = string.Format("{0:#,##0.00}", Convert.ToDecimal(ds.Tables[0].Rows[0]["Alt_ Price"].ToString())); hidPFCLocNo.Value = ds.Tables[0].Rows[0]["Location Code"].ToString(); lblPOLineLoc.Text = "Loc: " + ds.Tables[0].Rows[0]["Location Code"].ToString(); break; } } } GridVisible(dgBillLoad.ID); BindBillData(); FamilyPanel.Update(); plBillLoad.Update(); ScriptManager.RegisterClientScriptBlock(btnInvNo, btnInvNo.GetType(), "test", "SetControlFocus()", true); }
protected void btnRefresh_Click(object sender, ImageClickEventArgs e) { lblSuccessMessage.Text = ""; lblErrorMessage.Text = ""; lblSuccessMessage.Text = "Refresh " + HiddenPassedBOL.Value; FamilyPanel.Update(); ViewState["Header"] = "true"; dtBillLoad.Clear(); GridVisible(dgBillLoad.ID); string lclBol = BOLHeader.refNo.ToString(); if (lclBol == "") { lclBol = HiddenPassedBOL.Value; } DataSet ds = ger.GetBOLDetail(lclBol); dtBillLoad = ds.Tables[0]; ViewState["BillData"] = dtBillLoad; BindBillData(); plBillLoad.Update(); DataSet dsGERList = ger.GetBOLDetailList("BOLNo='" + lclBol + "'"); string strHeaderValues = dsGERList.Tables[0].Rows[0]["VendNo"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["VendName"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["PFCLocCd"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["PFCLocName"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["BOLNo"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["PortofLading"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["BOLDate"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["VesselName"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["BrokerInvTot"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["RcptTypeDesc"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["ProcDt"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["BrokerInvBOLCount"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["CustomsEntryNo"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["CustomsPortofEntry"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["CustomsEntryDt"].ToString(); ScriptManager.RegisterClientScriptBlock(dgBillLoad, typeof(DataGrid), "BindHeader", "BindHeader('" + strHeaderValues + "')", true); }
protected void dgFinReview_ItemCommand(object source, DataGridCommandEventArgs e) { lblSuccessMessage.Text = ""; lblErrorMessage.Text = ""; //try //{ string ContainerNo = e.Item.Cells[1].Text as string; string PFCItemNo = e.Item.Cells[2].Text as string; string AdjustID = e.Item.Cells[6].Text as string; string columnValues = ""; string whereCondition = ""; // Close the line if (e.CommandName == "Close") { lblSuccessMessage.Text = "Attempting Update"; lblErrorMessage.Text = ""; try { columnValues = "RcptQty=0"; whereCondition = "ContainerNo='" + ContainerNo + "' and PFCItemNo='" + PFCItemNo + "'"; SqlHelper.ExecuteDataset(ConfigurationManager.AppSettings["ReportsConnectionString"].ToString(), "[pVMI_update]", new SqlParameter("@tableName", "GERDetail"), new SqlParameter("@columnNames", columnValues), new SqlParameter("@whereClause", whereCondition)); lblSuccessMessage.Text = "GERDetail Closed"; } catch (Exception ex) { lblErrorMessage.Text = "Update failed on GerDetail"; } try { columnValues = " StatusCd='N' "; whereCondition = " ContainerAdjustID='" + AdjustID + "'"; SqlHelper.ExecuteDataset(ConfigurationManager.AppSettings["ReportsConnectionString"].ToString(), "[pVMI_update]", new SqlParameter("@tableName", "GERContainerRecAdjust"), new SqlParameter("@columnNames", columnValues), new SqlParameter("@whereClause", whereCondition)); lblSuccessMessage.Text = "Line Closed"; } catch (Exception ex) { lblErrorMessage.Text = "Update failed on GERContainerRecAdjust"; } e.Item.Cells[0].Controls[1].Visible = false; //e.Item.Cells[3].Controls[1].Visible = false; } //} //catch (Exception ex) { } //e.Item.Cells[1].Text = "Closed"; //e.Item.Cells[2].Text = "Closed"; ViewState["Status"] = "true"; FamilyPanel.Update(); }
protected void btnCharges_Click(object sender, ImageClickEventArgs e) { lblSuccessMessage.Text = ""; if (dtBillLoad.Rows.Count > 0) { GridVisible(dgCharges.ID); if (ViewState["Status"].ToString() == "false") { BindCharge(); foreach (DataGridItem dgItem in dgCharges.Items) { Label lblCharge = dgItem.Cells[0].FindControl("lblType") as Label; if (lblCharge.Text == "Duty") { TextBox txtLine = dgItem.Cells[1].Controls[1] as TextBox; txtLine.ReadOnly = true; TextBox txtRemarks = dgItem.Cells[2].Controls[1] as TextBox; txtRemarks.Text = "No Changes Allowed"; txtRemarks.ReadOnly = true; } } if (ViewState["ListStatus"] != null) { if (ViewState["ListStatus"].ToString() == "Processed") { foreach (DataGridItem dgItem in dgCharges.Items) { TextBox txtLine = dgItem.Cells[1].Controls[1] as TextBox; txtLine.ReadOnly = true; TextBox txtRemarks = dgItem.Cells[2].Controls[1] as TextBox; txtRemarks.ReadOnly = true; } } } } else { dgCharges.DataSource = dtCharge; dgCharges.DataBind(); FamilyPanel.Update(); } plBillLoad.Update(); } else { lblErrorMessage.Text = "Enter PO lines"; } }
public void ClearCommandLine() { txtInvNo.Text = ""; txtDate.Text = ""; txtContainer.Text = ""; txtPO.Text = ""; txtItem.Text = ""; lblDesc.Text = ""; lblLine.Text = ""; lblQty.Text = ""; txtInvQty.Text = ""; lblPOCost.Text = ""; lblUOM.Text = ""; txtInvCost.Text = ""; FamilyPanel.Update(); txtInvQty.Focus(); }
protected void btnAccept_Click(object sender, ImageClickEventArgs e) { lblSuccessMessage.Text = ""; lblErrorMessage.Text = ""; if (dtBillLoad.Rows.Count > 0) { GridVisible(dgContainerCost.ID); if (ViewState["Status"].ToString() == "false") { BindContainer(); if (ViewState["ListStatus"] != null) { if (ViewState["ListStatus"].ToString().ToLower().Trim() == "processed") { foreach (DataGridItem dgItem in dgContainerCost.Items) { TextBox txtPCost = dgItem.Cells[1].Controls[1] as TextBox; txtPCost.ReadOnly = true; TextBox txtICost = dgItem.Cells[2].Controls[1] as TextBox; txtICost.ReadOnly = true; TextBox txtWt = dgItem.Cells[3].Controls[1] as TextBox; txtWt.ReadOnly = true; } } } } else { dgContainerCost.DataSource = dtContainer; dgContainerCost.DataBind(); FamilyPanel.Update(); } plBillLoad.Update(); } else { lblErrorMessage.Text = "Enter PO lines"; } }
protected void dgList_ItemCommand(object source, DataGridCommandEventArgs e) { try { #region ListCommand if (e.CommandName == "List") { ViewState["Status"] = "false"; ViewState["Header"] = "true"; LinkButton lnkStatus = e.Item.Cells[2].Controls[1] as LinkButton; Label lblNo = e.Item.Cells[0].Controls[1] as Label; HiddenField hidID = e.Item.Cells[0].Controls[3] as HiddenField; DataSet dsGERList = ger.GetBOLDetailList("BOLNo='" + lblNo.Text.ToString() + "' and pGERHdrID='" + hidID.Value.ToString() + "'"); string strHeaderValues = dsGERList.Tables[0].Rows[0]["VendNo"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["VendName"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["PFCLocCd"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["PFCLocName"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["BOLNo"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["PortofLading"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["BOLDate"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["VesselName"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["BrokerInvTot"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["RcptTypeDesc"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["ProcDt"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["BrokerInvBOLCount"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["CustomsEntryNo"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["CustomsPortofEntry"].ToString() + "~" + dsGERList.Tables[0].Rows[0]["CustomsEntryDt"].ToString(); ScriptManager.RegisterClientScriptBlock(dgList, typeof(DataGrid), "BindHeader", "BindHeader('" + strHeaderValues + "')", true); if (lnkStatus.Text.Trim().ToLower() == "pending") { ViewState["ListStatus"] = "Pending"; hidList.Value = "Pending"; dtBillLoad.Clear(); GridVisible(dgBillLoad.ID); DataSet ds = ger.GetBOLDetail(lblNo.Text.ToString()); dtBillLoad = ds.Tables[0]; ViewState["BillData"] = dtBillLoad; BindBillData(); //BOLHeader.tdUpdateButton.Visible = true; btnRefresh.Visible = true; btnAccept.Visible = true; btnCharges.Visible = true; btnProcess.Visible = true; txtInvNo.ReadOnly = false; txtDate.ReadOnly = false; txtContainer.ReadOnly = false; txtPO.ReadOnly = false; txtItem.ReadOnly = false; txtInvQty.ReadOnly = false; txtInvCost.ReadOnly = false; } else { ViewState["ListStatus"] = "Processed"; hidList.Value = "Processed"; dtBillLoad.Clear(); GridVisible(dgBillLoad.ID); DataSet ds = ger.GetBOLDetail(lblNo.Text.ToString()); dtBillLoad = ds.Tables[0]; ViewState["BillData"] = dtBillLoad; BindBillData(); foreach (DataGridItem dgItem in dgBillLoad.Items) { TextBox txtIQty = dgItem.Cells[6].Controls[1] as TextBox; txtIQty.ReadOnly = true; TextBox txtICost = dgItem.Cells[8].Controls[1] as TextBox; txtICost.ReadOnly = true; } //imgUpdate.Visible = false; btnRefresh.Visible = false; btnAccept.Visible = false; btnCharges.Visible = false; btnProcess.Visible = false; txtInvNo.ReadOnly = true; txtDate.ReadOnly = true; txtContainer.ReadOnly = true; txtPO.ReadOnly = true; txtItem.ReadOnly = true; txtInvQty.ReadOnly = true; txtInvCost.ReadOnly = true; } plBillLoad.Update(); ClearCommandLine(); } #endregion #region DelCommand if (e.CommandName == "Delete") { if (hidDelConf.Value == "true") { string strSQL = "DELETE FROM GERHeader WHERE BOLNo = '" + e.CommandArgument.ToString().Trim() + "'"; SqlHelper.ExecuteReader(ConfigurationManager.AppSettings["ReportsConnectionString"].ToString(), CommandType.Text, strSQL); strSQL = "DELETE FROM GERDetail WHERE BOLNo = '" + e.CommandArgument.ToString().Trim() + "'"; SqlHelper.ExecuteReader(ConfigurationManager.AppSettings["ReportsConnectionString"].ToString(), CommandType.Text, strSQL); BindList(); lblErrorMessage.Text = ""; lblSuccessMessage.Text = "GER Record(s) Deleted"; } } #endregion } catch (Exception e1) { lblErrorMessage.Text = e1.ToString(); FamilyPanel.Update(); } }
protected void ItemControl_OnChange(object sender, EventArgs e) { FamilyPanel.Update(); }