protected void AddNewAES() { FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData(); ArrayList tranStrAL = new ArrayList(); string tranStr = ""; tranStr = "SET ANSI_WARNINGS OFF"; tranStrAL.Add(tranStr); tranStr = @"INSERT INTO aes_master(elt_account_number,party_to_transaction,export_date,tran_ref_no,consignee_acct,inter_consignee_acct,origin_state,dest_country,tran_method,export_port,unloading_port,carrier_id_code,export_carrier,shipment_ref_no,entry_no,hazardous_materials,route_export_tran,in_bond_type,in_bond_no,ftz,last_modified,shipper_acct,file_type,house_num,master_num) VALUES(" + elt_account_number + ",N'" + RCC.SelectedValue + "',N'" + EDA.Text + "',N'" + BN.Text + "'," + MakeNullCase(hConsigneeAcct.Value) + "," + MakeNullCase(hInterConsigneeAcct.Value) + ",N'" + ST.SelectedValue + "',N'" + COD.SelectedValue + "',N'" + MOT.SelectedValue + "',N'" + POE.SelectedValue + "',N'" + POU.SelectedValue + "',N'" + lstCarrier.SelectedValue + "',N'" + lstCarrier.Items[lstCarrier.SelectedIndex].Text + "',N'" + SRN.Text + "','',N'" + HAZ.SelectedValue + "',N'" + RT.SelectedValue + "',N'" + IBT.SelectedValue + "',N'" + IBN.Text + "',N'" + FTZ.Text + "',GETDATE()," + MakeNullCase(hShipperAcct.Value) + ",N'" + hFileType.Value + "',N'" + txtHouse.Text + "',N'" + txtMaster.Text + "')"; tranStrAL.Add(tranStr); if (!feData.DataTransactions((string[])tranStrAL.ToArray(typeof(string)))) { txtResultBox.Text = feData.GetLastTransactionError(); txtResultBox.Visible = true; } else { feData.AddToDataSet("AESInfo", "SELECT * FROM aes_master WHERE elt_account_number=" + elt_account_number + " AND shipment_ref_no=N'" + SRN.Text + "' AND file_type='OE'"); if (feData.Tables["AESInfo"].Rows.Count > 0) { SaveLineItems(Convert.ToInt32(feData.Tables["AESInfo"].Rows[0]["auto_uid"])); Response.Redirect("EditOceanAES.aspx?AESID=" + feData.Tables["AESInfo"].Rows[0]["auto_uid"].ToString()); } } }
protected void UpdateScheduleB() { FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData(); string[] tranStr = new string[1]; tranStr[0] = "UPDATE scheduleB SET " + " sb=N'" + txtSBCode.Text + "',sb_unit1=N'" + lstSBUnit1.SelectedValue + "',sb_unit2=N'" + lstSBUnit2.SelectedValue + "',description=N'" + txtItemDesc.Text + "',export_code=N'" + lstExportCode.SelectedValue + "',license_type=N'" + lstLicenseType.SelectedValue + "',eccn=N'" + txtECCN.Text + "' WHERE elt_account_number=" + elt_account_number + " AND auto_uid=" + hSBID.Value; if (!feData.DataTransactions(tranStr)) { string errorStr = feData.GetLastTransactionError(); string errorMsg = "Unexpected error occurred. " + errorStr; tableContent.Visible = false; txtResultBox.Text = errorMsg; txtResultBox.Visible = true; } else { this.ClientScript.RegisterClientScriptBlock(this.GetType(), "close_window_return", "<script>close_window_return(" + 0 + ",'');</script>"); } }
protected void AddNewConsignee() { FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData(); string[] tranStr = new string[1]; tranStr[0] = "DECLARE @new_org_id DECIMAL\n"; tranStr[0] += "SET @new_org_id=(SELECT ISNULL(MAX(org_account_number),0)+1 FROM organization WHERE elt_account_number=" + elt_account_number + ")\n"; tranStr[0] += "INSERT INTO organization(elt_account_number,org_account_number,dba_name,business_legal_name,business_address,business_address2,business_city,business_state,business_zip,business_country,b_country_code,business_phone,business_fax,owner_lname,owner_fname,owner_mname,owner_phone,owner_email,account_status,date_opened,last_update)\n"; tranStr[0] += "VALUES(" + elt_account_number + ",@new_org_id,N'" + txtDBA.Text + "',N'" + txtLegalName.Text + "',N'" + txtAddress1.Text + "',N'" + txtAddress2.Text + "',N'" + txtCity.Text + "',N'" + txtState.Text + "',N'" + txtZip.Text + "',N'" + lstCountry.Items[lstCountry.SelectedIndex].Text + "',N'" + lstCountry.SelectedValue + "',N'" + txtPhone.Text + "',N'" + txtFax.Text + "',N'" + txtLastName.Text + "',N'" + txtFirstName.Text + "',N'" + txtMidName.Text + "',N'" + txtCell.Text + "',N'" + txtEmail.Text + "','A',GETDATE(),GETDATE())"; if (!feData.DataTransactions(tranStr)) { string errorStr = feData.GetLastTransactionError(); string errorMsg = "Unexpected error occurred. " + errorStr; tableContent.Visible = false; txtResultBox.Text = errorMsg; txtResultBox.Visible = true; btnSave.Visible = false; } else { this.ClientScript.RegisterClientScriptBlock(this.GetType(), "close_window_return", "<script>close_window_return(" + 0 + ",'');</script>"); } }
protected void Save_Setup_page() { string[] sqlTxt = new string[1]; if (hPageId.Value == "") { sqlTxt[0] = "INSERT INTO setup_master(seq_id,title,setup_url,setup_type,valid_url,remark) " + "VALUES (" + hSeqId.Value + ",'" + txtPageTitle.Text + "','" + txtPageURL.Text + "','" + lstSetupType.SelectedValue + "','" + txtValidURL.Text + "','" + txtRemark.Text + "')"; } else { sqlTxt[0] = "UPDATE setup_master SET " + "seq_id=" + hSeqId.Value + "," + "title='" + txtPageTitle.Text + "'," + "setup_url='" + txtPageURL.Text + "'," + "setup_type='" + lstSetupType.SelectedValue + "'," + "valid_url='" + txtValidURL.Text + "'," + "remark='" + txtRemark.Text + "' WHERE page_id=" + hPageId.Value; // update change } FreightEasy.DataManager.FreightEasyData FEData = new FreightEasy.DataManager.FreightEasyData(); if (!FEData.DataTransactions(sqlTxt)) { Response.Redirect("/IFF_MAIN/SystemAdmin/SetupManager.aspx"); } else { Response.Write(sqlTxt[0]); } }
protected void AddNewScheduleB() { FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData(); ArrayList tranStrAL = new ArrayList(); string tranStr = ""; tranStr = "INSERT INTO scheduleB(elt_account_number,sb,description,sb_unit1,sb_unit2,export_code,license_type,eccn)\n" + "VALUES(" + elt_account_number + ",N'" + txtSBCode.Text + "',N'" + txtItemDesc.Text + "',N'" + lstSBUnit1.SelectedValue + "',N'" + lstSBUnit2.SelectedValue + "',N'" + lstExportCode.SelectedValue + "',N'" + lstLicenseType.SelectedValue + "',N'" + txtECCN.Text + "')"; tranStrAL.Add(tranStr); if (hOrgID.Value != null && hOrgID.Value != "") { tranStr = "INSERT INTO ig_schedule_b(elt_account_number,org_account_number,sb_id,sb,description,sb_unit1,sb_unit2,export_code,license_type,eccn)\n" + "VALUES(" + elt_account_number + "," + hOrgID.Value + ",IDENT_CURRENT('scheduleB')-1,N'" + txtSBCode.Text + "',N'" + txtItemDesc.Text + "',N'" + lstSBUnit1.SelectedValue + "',N'" + lstSBUnit2.SelectedValue + "',N'" + lstExportCode.SelectedValue + "',N'" + lstLicenseType.SelectedValue + "',N'" + txtECCN.Text + "')"; tranStrAL.Add(tranStr); } if (!feData.DataTransactions((string[])tranStrAL.ToArray(typeof(string)))) { string errorStr = feData.GetLastTransactionError(); string errorMsg = "Unexpected error occurred. " + errorStr; tableContent.Visible = false; txtResultBox.Text = errorMsg; txtResultBox.Visible = true; } else { this.ClientScript.RegisterClientScriptBlock(this.GetType(), "close_window_return", "<script>close_window_return(" + 0 + ",'');</script>"); } }
protected void AddNewAES() { FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData(); ArrayList tranStrAL = new ArrayList(); string tranStr = ""; tranStr = "SET ANSI_WARNINGS OFF"; tranStrAL.Add(tranStr); tranStr = @"INSERT INTO aes_master(elt_account_number,party_to_transaction,export_date,tran_ref_no,consignee_acct,inter_consignee_acct,origin_state,dest_country,tran_method,export_port,unloading_port,carrier_id_code,export_carrier,shipment_ref_no,entry_no,hazardous_materials,route_export_tran,in_bond_type,in_bond_no,ftz,last_modified,shipper_acct,file_type,house_num,master_num) VALUES(" + elt_account_number + ",N'" + RCC.SelectedValue + "',N'" + EDA.Text + "',N'" + BN.Text + "'," + MakeNullCase(hConsigneeAcct.Value) + "," + MakeNullCase(hInterConsigneeAcct.Value) + ",N'" + ST.SelectedValue + "',N'" + COD.SelectedValue + "',N'" + MOT.SelectedValue + "',N'" + POE.SelectedValue + "',N'" + POU.SelectedValue + "',N'" + lstCarrier.SelectedValue + "',N'" + lstCarrier.Items[lstCarrier.SelectedIndex].Text + "',N'" + SRN.Text + "','',N'" + HAZ.SelectedValue + "',N'" + RT.SelectedValue + "',N'" + IBT.SelectedValue + "',N'" + IBN.Text + "',N'" + FTZ.Text + "',GETDATE()," + MakeNullCase(hShipperAcct.Value) + ",N'" + hFileType.Value + "',N'" + txtHouse.Text + "',N'" + txtMaster.Text + "')"; tranStrAL.Add(tranStr); // AES item insert loop using grid entries for (int i = 0; i < UltraWebGrid1.Rows.Count; i++) { if (UltraWebGrid1.Rows[i].Cells[3].Value == null) { UltraWebGrid1.Rows[i].Cells[3].Value = "0"; } if (UltraWebGrid1.Rows[i].Cells[5].Value == null) { UltraWebGrid1.Rows[i].Cells[5].Value = "0"; } if (UltraWebGrid1.Rows[i].Cells[7].Value == null) { UltraWebGrid1.Rows[i].Cells[7].Value = "0"; } if (UltraWebGrid1.Rows[i].Cells[8].Value == null) { UltraWebGrid1.Rows[i].Cells[8].Value = "0"; } tranStr = @"INSERT INTO aes_detail(elt_account_number,item_no,dfm,b_number,item_desc,b_qty1,unit1,b_qty2,unit2,gross_weight,item_value,export_code,license_type,license_number,eccn,vin_type,vin,vc_title,vc_state,aes_id) VALUES(" + elt_account_number + "," + i + ",N'" + UltraWebGrid1.Rows[i].Cells[0].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[1].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[1].Text + "'," + UltraWebGrid1.Rows[i].Cells[3].Value + ",N'" + UltraWebGrid1.Rows[i].Cells[4].Value + "'," + UltraWebGrid1.Rows[i].Cells[5].Value + ",N'" + UltraWebGrid1.Rows[i].Cells[6].Value + "'," + UltraWebGrid1.Rows[i].Cells[7].Value + "," + UltraWebGrid1.Rows[i].Cells[8].Value + ",N'" + UltraWebGrid1.Rows[i].Cells[9].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[10].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[11].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[12].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[13].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[14].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[15].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[16].Value + "',IDENT_CURRENT('aes_master'))"; tranStrAL.Add(tranStr); tranStr = "SET ANSI_WARNINGS ON"; tranStrAL.Add(tranStr); } if (!feData.DataTransactions((string[])tranStrAL.ToArray(typeof(string)))) { txtResultBox.Text = feData.GetLastTransactionError(); txtResultBox.Visible = true; } else { feData.AddToDataSet("AESInfo", "SELECT * FROM aes_master WHERE elt_account_number=" + elt_account_number + " AND shipment_ref_no=N'" + SRN.Text + "'AND file_type='AE'"); if (feData.Tables["AESInfo"].Rows.Count > 0) { Response.Redirect("EditAES.aspx?AESID=" + feData.Tables["AESInfo"].Rows[0]["auto_uid"].ToString()); } } }
protected void btnAddAll_Click(object sender, EventArgs e) { FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData(); ArrayList tranStrAL = new ArrayList(); string tranStr = ""; tranStr = "DELETE FROM ig_schedule_b WHERE elt_account_number=" + elt_account_number + " AND org_account_number=" + hOrgID.Value; tranStrAL.Add(tranStr); tranStr = "INSERT INTO ig_schedule_b SELECT " + elt_account_number + " AS elt_account_number," + hOrgID.Value + " AS org_account_number" + ",sb,sb_unit1,sb_unit2,description,NULL AS is_org_merged,export_code,license_type,eccn,auto_uid" + " FROM scheduleB WHERE elt_account_number=" + elt_account_number; tranStrAL.Add(tranStr); if (!feData.DataTransactions((string[])tranStrAL.ToArray(typeof(string)))) { txtResultBox.Text = feData.GetLastTransactionError(); txtResultBox.Visible = true; } else { GridView1.DataBind(); GridView2.DataBind(); Initialize_Components(); } }
protected void UpdateAES() { FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData(); ArrayList tranStrAL = new ArrayList(); string tranStr = ""; tranStr = "SET ANSI_WARNINGS OFF"; tranStrAL.Add(tranStr); tranStr = "UPDATE aes_master SET " + "party_to_transaction=N'" + RCC.SelectedValue + "',export_date=N'" + EDA.Text + "',tran_ref_no=N'" + BN.Text + "',consignee_acct=" + MakeNullCase(hConsigneeAcct.Value) + ",inter_consignee_acct=" + MakeNullCase(hInterConsigneeAcct.Value) + ",origin_state=N'" + ST.SelectedValue + "',dest_country=N'" + COD.SelectedValue + "',tran_method=N'" + MOT.SelectedValue + "',export_port=N'" + POE.SelectedValue + "',unloading_port=N'" + POU.SelectedValue + "',carrier_id_code=N'" + lstCarrier.SelectedValue + "',export_carrier=N'" + lstCarrier.Items[lstCarrier.SelectedIndex].Text + "',shipment_ref_no=N'" + SRN.Text + "',hazardous_materials=N'" + HAZ.SelectedValue + "',route_export_tran=N'" + RT.SelectedValue + "',in_bond_type=N'" + IBT.SelectedValue + "',in_bond_no=N'" + IBN.Text + "',ftz=N'" + FTZ.Text + "',last_modified=GETDATE()" + ",shipper_acct=" + MakeNullCase(hShipperAcct.Value) + ",file_type=N'" + hFileType.Value + "',house_num=N'" + txtHouse.Text + "',master_num=N'" + txtMaster.Text + "' WHERE elt_account_number=" + elt_account_number + " AND auto_uid=" + AESNO.Value; tranStrAL.Add(tranStr); // tranStr = "DELETE FROM aes_detail WHERE EmailItemID=" + EmailItemID + " AND aes_id=" + AESNO.Value; tranStrAL.Add(tranStr); if (!feData.DataTransactions((string[])tranStrAL.ToArray(typeof(string)))) { txtResultBox.Text = feData.GetLastTransactionError(); txtResultBox.Visible = true; } else { SaveLineItems(int.Parse(AESNO.Value)); Response.Redirect("EditAES.aspx?AESID=" + AESNO.Value); } }
protected void Insert_Booking_Confirm() { FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData(); ArrayList tranStrAL = new ArrayList(); string tranStr = ""; tranStr = "SET ANSI_WARNINGS OFF"; tranStrAL.Add(tranStr); tranStr = @"INSERT INTO booking_confirm(elt_account_number,document_date,air_ocean,bc_no,booking_no,master_no,house_no,sub_house_no,shipper_acct, shipper_name,shipper_info,deliver_to_acct,deliver_to_name,deliver_to_info,cut_off_date,export_reference,carrier_acct,carrier_name,carrier_no, place_of_receipt,place_of_delivery,dep_port,arr_port,eta,etd,move_type,dest_agent_acct,dest_agent_name,dest_agent_info,empty_container_pick_up_acct, empty_container_pick_up_name,empty_container_pick_up_info,dangerous,quantity,quantity_unit,item_desc,gross_weight,weight_scale,dimension,dimension_scale,remark) VALUES(" + elt_account_number + "," + MakeDateString(this.txt_document_date.Text) + ",'O',N'" + this.ddl_prefix.Items[this.ddl_prefix.SelectedIndex].Text + "-" + this.ddl_prefix.SelectedValue + "',N'" + this.txt_booking_no.Text + "',N'" + this.hf_master_no.Value + "',N'" + this.hf_house_no.Value + "',N'" + this.hf_sub_house_no.Value + "'," + MakeNullCase(this.hShipperAcct.Value) + ",N'" + this.lstShipperName.Text + "',N'" + this.txtShipperInfo.Text + "'," + MakeNullCase(this.hConsigneeAcct.Value) + ",N'" + this.lstConsigneeName.Text + "',N'" + this.txtConsigneeInfo.Text + "',N'" + this.txt_cut_off_date.Text + "',N'" + this.txt_export_reference.Text + "'," + MakeNullCase(this.hCarrierAcct.Value) + ",N'" + this.lstCarrierName.Text + "',N'" + this.txt_carrier_no.Text + "',N'" + this.txt_place_of_receipt.Text + "',N'" + this.txt_place_of_delivery.Text + "',N'" + this.ddl_origin_port.SelectedValue + "',N'" + this.ddl_dest_port.SelectedValue + "'," + MakeDateString(this.txt_eta_date.Text) + "," + MakeDateString(this.txt_etd_date.Text) + ",N'" + this.txt_type_of_move.Text + "'," + MakeNullCase(this.hAgentAcct.Value) + ",N'" + this.lstAgentName.Text + "',N'" + this.txtAgentInfo.Text + "'," + MakeNullCase(this.hEmptyPickupAcct.Value) + ",N'" + this.lstEmptyPickupName.Text + "',N'" + this.txtEmptyPickupInfo.Text + "',N'" + this.rbl_dangerous_good.SelectedValue + "'," + MakeNullCase(this.txt_quantity.Text) + ",N'" + this.ddl_quantity_unit.SelectedValue + "',N'" + this.txt_description.Text + "'," + MakeNullCase(this.txt_weight.Text) + ",N'" + this.ddl_weight_scale.SelectedValue + "'," + MakeNullCase(this.txt_dimension.Text) + ",N'" + this.ddl_dimension_scale.SelectedValue + "',N'" + this.txt_remark.Text + "')"; tranStrAL.Add(tranStr); tranStr = "UPDATE user_prefix SET next_no=next_no+1 WHERE elt_account_number=" + elt_account_number + "AND type='BC' AND prefix=N'" + this.ddl_prefix.Items[this.ddl_prefix.SelectedIndex].Text + "'"; tranStrAL.Add(tranStr); tranStr = "SET ANSI_WARNINGS ON"; tranStrAL.Add(tranStr); if (!feData.DataTransactions((string[])tranStrAL.ToArray(typeof(string)))) { Response.Write(feData.GetLastTransactionError()); } else { feData.AddToDataSet("BookingConfirmNew", "SELECT * FROM booking_confirm WHERE auto_uid=IDENT_CURRENT('booking_confirm')"); Load_Booking_Confirm(feData.Tables["BookingConfirmNew"].Rows[0]["auto_uid"].ToString()); } }
protected void img_DeleteBC_Click(object sender, EventArgs e) { FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData(); ArrayList tranStrAL = new ArrayList(); string tranStr = "DELETE FROM booking_confirm WHERE elt_account_number=" + elt_account_number + " AND auto_uid=" + hSearchNum.Value; tranStrAL.Add(tranStr); if (!feData.DataTransactions((string[])tranStrAL.ToArray(typeof(string)))) { Response.Write(feData.GetLastTransactionError()); } else { Response.Redirect("BookingConfirm.aspx"); } }
protected void btnDelete_Click(object sender, EventArgs e) { ImageButton button = (ImageButton)sender; int rowIndex = int.Parse(button.CommandArgument); string SBID = UltraWebGrid1.Rows[rowIndex].Cells.FromKey("auto_uid").Value.ToString(); FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData(); string[] tranStr = new string[1]; tranStr[0] += "DELETE FROM scheduleb WHERE elt_account_number=" + elt_account_number + " AND auto_uid=" + SBID; if (!feData.DataTransactions(tranStr)) { Response.Write(feData.GetLastTransactionError()); } else { Response.Redirect("./SBMaster.aspx"); } }
protected void UpdateConsignee(string OrgID) { FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData(); string[] tranStr = new string[1]; tranStr[0] = "UPDATE organization SET " + "dba_name=N'" + txtDBA.Text.Replace("'", "`") + "',business_legal_name=N'" + txtLegalName.Text.Replace("'", "`") + "',business_address=N'" + txtAddress1.Text.Replace("'", "`") + "',business_address2=N'" + txtAddress2.Text.Replace("'", "`") + "',business_city=N'" + txtCity.Text.Replace("'", "`") + "',business_state=N'" + txtState.Text.Replace("'", "`") + "',business_zip=N'" + txtZip.Text + "',business_country=N'" + lstCountry.Items[lstCountry.SelectedIndex].Text.Replace("'", "`") + "',b_country_code=N'" + lstCountry.SelectedValue + "',business_phone=N'" + txtPhone.Text + "',business_fax=N'" + txtFax.Text + "',owner_lname=N'" + txtLastName.Text.Replace("'", "`") + "',owner_fname=N'" + txtFirstName.Text.Replace("'", "`") + "',owner_mname=N'" + txtMidName.Text.Replace("'", "`") + "',owner_phone=N'" + txtCell.Text + "',owner_email=N'" + txtEmail.Text.Replace("'", "`") + "',business_fed_taxid=N'" + txtTaxID.Text + "',account_status='A',last_update=GETDATE()" + " WHERE elt_account_number=" + elt_account_number + " AND org_account_number=" + OrgID; if (!feData.DataTransactions(tranStr)) { string errorStr = feData.GetLastTransactionError(); string errorMsg = "Unexpected error occurred. " + errorStr; tableContent.Visible = false; txtResultBox.Text = errorMsg; txtResultBox.Visible = true; btnSave.Visible = false; } else { this.ClientScript.RegisterClientScriptBlock(this.GetType(), "close_window_return", "<script>close_window_return(" + OrgID + ",'" + txtDBA.Text + "');</script>"); } }
protected void btnDelete_Click(object sender, EventArgs e) { ImageButton button = (ImageButton)sender; int rowIndex = int.Parse(button.CommandArgument); string aesIndex = UltraWebGrid1.Rows[rowIndex].Cells.FromKey("auto_uid").Value.ToString(); string[] sqlTxt = new string[2]; FreightEasy.DataManager.FreightEasyData FEData = new FreightEasy.DataManager.FreightEasyData(); sqlTxt[0] = "DELETE FROM aes_master WHERE elt_account_number=" + elt_account_number + " AND auto_uid=" + aesIndex; sqlTxt[1] = "DELETE FROM aes_detail WHERE elt_account_number=" + elt_account_number + " AND aes_id=" + aesIndex; if (!FEData.DataTransactions(sqlTxt)) { txtResultBox.Text = FEData.GetLastTransactionError(); txtResultBox.Visible = true; } else { Response.Redirect("ManageSED.aspx"); } }
protected void btnDeleteAll_Click(object sender, EventArgs e) { FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData(); ArrayList tranStrAL = new ArrayList(); string tranStr = ""; tranStr = "DELETE FROM ig_schedule_b WHERE elt_account_number=" + elt_account_number + " AND org_account_number=" + hOrgID.Value; tranStrAL.Add(tranStr); if (!feData.DataTransactions((string[])tranStrAL.ToArray(typeof(string)))) { txtResultBox.Text = feData.GetLastTransactionError(); txtResultBox.Visible = true; } else { GridView1.DataBind(); GridView2.DataBind(); Initialize_Components(); } }
protected void Update_Booking_Confirm() { FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData(); ArrayList tranStrAL = new ArrayList(); string tranStr = ""; tranStr = "SET ANSI_WARNINGS OFF"; tranStrAL.Add(tranStr); tranStr = @"UPDATE booking_confirm SET elt_account_number=" + elt_account_number + "," + "document_date=" + MakeDateString(this.txt_document_date.Text) + "," + "air_ocean='O'," + "booking_no=N'" + this.txt_booking_no.Text + "'," + "master_no=N'" + this.hf_master_no.Value + "'," + "house_no=N'" + this.hf_house_no.Value + "'," + "sub_house_no=N'" + this.hf_house_no.Value + "'," + "shipper_acct=" + MakeNullCase(this.hShipperAcct.Value) + "," + "shipper_name=N'" + this.lstShipperName.Text + "'," + "shipper_info=N'" + this.txtShipperInfo.Text + "'," + "deliver_to_acct=" + MakeNullCase(this.hConsigneeAcct.Value) + "," + "deliver_to_name=N'" + this.lstConsigneeName.Text + "'," + "deliver_to_info=N'" + this.txtConsigneeInfo.Text + "'," + "cut_off_date=N'" + this.txt_cut_off_date.Text + "'," + "export_reference=N'" + this.txt_export_reference.Text + "'," + "carrier_acct=" + MakeNullCase(this.hCarrierAcct.Value) + "," + "carrier_name=N'" + this.lstCarrierName.Text + "'," + "carrier_no=N'" + this.txt_carrier_no.Text + "'," + "place_of_receipt=N'" + this.txt_place_of_receipt.Text + "'," + "place_of_delivery=N'" + this.txt_place_of_delivery.Text + "'," + "dep_port=N'" + this.ddl_origin_port.SelectedValue + "'," + "arr_port=N'" + this.ddl_dest_port.SelectedValue + "'," + "eta=" + MakeDateString(this.txt_eta_date.Text) + "," + "etd=" + MakeDateString(this.txt_etd_date.Text) + "," + "move_type=N'" + this.txt_type_of_move.Text + "'," + "dest_agent_acct=" + MakeNullCase(this.hAgentAcct.Value) + "," + "dest_agent_name=N'" + this.lstAgentName.Text + "'," + "dest_agent_info=N'" + this.txtAgentInfo.Text + "'," + "empty_container_pick_up_acct=" + MakeNullCase(this.hEmptyPickupAcct.Value) + "," + "empty_container_pick_up_name=N'" + this.lstEmptyPickupName.Text + "'," + "empty_container_pick_up_info=N'" + this.txtEmptyPickupInfo.Text + "'," + "dangerous=N'" + this.rbl_dangerous_good.SelectedValue + "'," + "quantity=" + MakeNullCase(this.txt_quantity.Text) + "," + "quantity_unit=N'" + this.ddl_quantity_unit.SelectedValue + "'," + "item_desc=N'" + this.txt_description.Text + "'," + "gross_weight=" + MakeNullCase(this.txt_weight.Text) + "," + "weight_scale=N'" + this.ddl_weight_scale.SelectedValue + "'," + "dimension=" + MakeNullCase(this.txt_dimension.Text) + "," + "dimension_scale=N'" + this.ddl_dimension_scale.SelectedValue + "'," + "remark=N'" + this.txt_remark.Text + "' " + "WHERE auto_uid=" + hSearchNum.Value; tranStrAL.Add(tranStr); tranStr = "SET ANSI_WARNINGS ON"; tranStrAL.Add(tranStr); if (!feData.DataTransactions((string[])tranStrAL.ToArray(typeof(string)))) { Response.Write(feData.GetLastTransactionError()); } }
protected void UpdateAES() { FreightEasy.DataManager.FreightEasyData feData = new FreightEasy.DataManager.FreightEasyData(); ArrayList tranStrAL = new ArrayList(); string tranStr = ""; tranStr = "SET ANSI_WARNINGS OFF"; tranStrAL.Add(tranStr); tranStr = "UPDATE aes_master SET " + "party_to_transaction=N'" + RCC.SelectedValue + "',export_date=N'" + EDA.Text + "',tran_ref_no=N'" + BN.Text + "',consignee_acct=" + MakeNullCase(hConsigneeAcct.Value) + ",inter_consignee_acct=" + MakeNullCase(hInterConsigneeAcct.Value) + ",origin_state=N'" + ST.SelectedValue + "',dest_country=N'" + COD.SelectedValue + "',tran_method=N'" + MOT.SelectedValue + "',export_port=N'" + POE.SelectedValue + "',unloading_port=N'" + POU.SelectedValue + "',carrier_id_code=N'" + lstCarrier.SelectedValue + "',export_carrier=N'" + lstCarrier.Items[lstCarrier.SelectedIndex].Text + "',shipment_ref_no=N'" + SRN.Text + "',hazardous_materials=N'" + HAZ.SelectedValue + "',route_export_tran=N'" + RT.SelectedValue + "',in_bond_type=N'" + IBT.SelectedValue + "',in_bond_no=N'" + IBN.Text + "',ftz=N'" + FTZ.Text + "',last_modified=GETDATE()" + ",shipper_acct=" + MakeNullCase(hShipperAcct.Value) + ",file_type=N'" + hFileType.Value + "',house_num=N'" + txtHouse.Text + "',master_num=N'" + txtMaster.Text + "' WHERE elt_account_number=" + elt_account_number + " AND auto_uid=" + AESNO.Value; tranStrAL.Add(tranStr); tranStr = "DELETE FROM aes_detail WHERE elt_account_number=" + elt_account_number + " AND aes_id=" + AESNO.Value; tranStrAL.Add(tranStr); // AES item insert loop using grid entries for (int i = 0; i < UltraWebGrid1.Rows.Count; i++) { if (UltraWebGrid1.Rows[i].Cells[3].Value == null) { UltraWebGrid1.Rows[i].Cells[3].Value = "0"; } if (UltraWebGrid1.Rows[i].Cells[5].Value == null) { UltraWebGrid1.Rows[i].Cells[5].Value = "0"; } if (UltraWebGrid1.Rows[i].Cells[7].Value == null) { UltraWebGrid1.Rows[i].Cells[7].Value = "0"; } if (UltraWebGrid1.Rows[i].Cells[8].Value == null) { UltraWebGrid1.Rows[i].Cells[8].Value = "0"; } tranStr = @"INSERT INTO aes_detail(elt_account_number,item_no,dfm,b_number,item_desc,b_qty1,unit1,b_qty2,unit2,gross_weight,item_value,export_code,license_type,license_number,eccn,vin_type,vin,vc_title,vc_state,aes_id) VALUES(" + elt_account_number + "," + i + ",N'" + UltraWebGrid1.Rows[i].Cells[0].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[1].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[1].Text + "'," + UltraWebGrid1.Rows[i].Cells[3].Value + ",N'" + UltraWebGrid1.Rows[i].Cells[4].Value + "'," + UltraWebGrid1.Rows[i].Cells[5].Value + ",N'" + UltraWebGrid1.Rows[i].Cells[6].Value + "'," + UltraWebGrid1.Rows[i].Cells[7].Value + "," + UltraWebGrid1.Rows[i].Cells[8].Value + ",N'" + UltraWebGrid1.Rows[i].Cells[9].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[10].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[11].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[12].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[13].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[14].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[15].Value + "',N'" + UltraWebGrid1.Rows[i].Cells[16].Value + "'," + AESNO.Value + ")"; tranStrAL.Add(tranStr); tranStr = "SET ANSI_WARNINGS ON"; tranStrAL.Add(tranStr); } if (!feData.DataTransactions((string[])tranStrAL.ToArray(typeof(string)))) { txtResultBox.Text = feData.GetLastTransactionError(); txtResultBox.Visible = true; } else { Response.Redirect("EditAES.aspx?AESID=" + AESNO.Value); } }