public bool updateARNRecord(ref ARNRecord arnRec) { arnRec.replaceQuote(); //INSERT IV CHARGE ITEMS Cmd = new SqlCommand(); Cmd.Connection = Con; Con.Open(); SqlTransaction trans = Con.BeginTransaction(); Cmd.Transaction = trans; bool return_val = false; try { SQL = "UPDATE import_hawb "; SQL += "set elt_account_number='" + elt_account_number + "'"; SQL += ",agent_elt_acct='" + arnRec.agent_elt_acct + "'"; SQL += ",agent_org_acct ='" + arnRec.agent_org_acct + "'"; // SQL += ",arn_no ='" + arnRec.arn_no + "'"; SQL += ",arr_code ='" + arnRec.arr_code + "'"; SQL += ",arr_port ='" + arnRec.arr_port + "'"; SQL += ",broker_acct ='" + arnRec.broker_acct + "'"; SQL += " ,broker_info ='" + arnRec.broker_info + "'"; SQL += " , broker_name ='" + arnRec.broker_name + "'"; SQL += " ,cargo_location ='" + arnRec.cargo_location + "'"; SQL += " ,chg_wt ='" + arnRec.chg_wt + "'"; SQL += ", consignee_acct ='" + arnRec.consignee_acct + "'"; SQL += " , consignee_info ='" + arnRec.consignee_info + "'"; SQL += " ,consignee_name ='" + arnRec.consignee_name + "'"; SQL += " ,container_location ='" + arnRec.container_location + "'"; SQL += " ,CreatedBy ='" + arnRec.CreatedBy + "'"; SQL += " ,CreatedDate ='" + arnRec.CreatedDate + "'"; SQL += " ,customer_ref ='" + arnRec.customer_ref + "'"; SQL += " , delivery_place ='" + arnRec.delivery_place + "'"; SQL += " ,dep_code ='" + arnRec.dep_code + "'"; SQL += " , dep_port ='" + arnRec.dep_port + "'"; SQL += " ,desc1 ='" + arnRec.desc1 + "'"; SQL += " ,desc2 ='" + arnRec.desc2 + "'"; SQL += " ,desc3 ='" + arnRec.desc3 + "'"; SQL += " ,desc4 ='" + arnRec.desc4 + "'"; SQL += " ,desc5 ='" + arnRec.desc5 + "'"; SQL += " ,destination ='" + arnRec.destination + "'"; SQL += " ,eta ='" + arnRec.eta + "'"; SQL += " ,eta2 ='" + arnRec.eta2 + "'"; SQL += " ,etd ='" + arnRec.etd + "'"; SQL += " ,etd2 ='" + arnRec.etd2 + "'"; SQL += ", fc_charge ='" + arnRec.fc_charge + "'"; SQL += ",fc_rate ='" + arnRec.fc_rate + "'"; SQL += " ,flt_no ='" + arnRec.flt_no + "'"; SQL += " ,free_date ='" + arnRec.free_date + "'"; SQL += " ,freight_collect ='" + arnRec.freight_collect + "'"; SQL += " ,go_date ='" + arnRec.go_date + "'"; SQL += " ,gross_wt ='" + arnRec.gross_wt + "'"; SQL += " ,hawb_num ='" + arnRec.hawb_num + "'"; SQL += " ,igSub_HAWB ='" + arnRec.igSub_HAWB + "'"; SQL += " ,invoice_no ='" + arnRec.invoice_no + "'"; SQL += " , is_default_rate ='" + arnRec.is_default_rate + "'"; SQL += " ,is_org_merged ='" + arnRec.is_org_merged + "'"; SQL += " ,it_date ='" + arnRec.it_date + "'"; SQL += " , it_entry_port ='" + arnRec.it_entry_port + "'"; SQL += " ,it_number ='" + arnRec.it_number + "'"; SQL += " ,iType ='" + arnRec.iType + "'"; SQL += " ,mawb_num ='" + arnRec.mawb_num + "'"; SQL += " , ModifiedBy ='" + arnRec.ModifiedBy + "'"; SQL += " ,ModifiedDate ='" + arnRec.ModifiedDate + "'"; SQL += " ,notify_acct ='" + arnRec.notify_acct + "'"; SQL += " ,notify_info ='" + arnRec.notify_info + "'"; SQL += " , notify_name ='" + arnRec.notify_name + "'"; SQL += ",oc_collect ='" + arnRec.oc_collect + "'"; SQL += ", pickup_date ='" + arnRec.pickup_date + "'"; SQL += ",pieces ='" + arnRec.pieces + "'"; SQL += " ,prepaid_collect ='" + arnRec.prepaid_collect + "'"; SQL += ",prepared_by ='" + arnRec.prepared_by + "'"; SQL += ",process_dt ='" + arnRec.process_dt + "'"; SQL += " ,processed ='" + arnRec.processed + "'"; SQL += " ,remarks ='" + arnRec.remarks + "'"; SQL += " ,SalesPerson ='" + arnRec.SalesPerson + "'"; SQL += ",scale1 ='" + arnRec.scale1 + "'"; SQL += " ,scale2 ='" + arnRec.scale2 + "'"; SQL += " ,sec ='" + arnRec.sec + "'"; SQL += " ,shipper_acct ='" + arnRec.shipper_acct + "'"; SQL += " ,shipper_info ='" + arnRec.shipper_info + "'"; SQL += " ,shipper_name ='" + arnRec.shipper_name + "'"; SQL += " ,sub_mawb1 ='" + arnRec.sub_mawb1 + "'"; SQL += ",sub_mawb2 ='" + arnRec.sub_mawb2 + "'"; SQL += " ,term ='" + arnRec.term + "'"; SQL += ",total_other_charge ='" + arnRec.total_other_charge + "'"; SQL += ",tran_dt ='" + arnRec.tran_dt + "'"; SQL += ",uom = '" + arnRec.uom + "'"; SQL += " WHERE elt_account_number =" + elt_account_number; SQL += " and invoice_no =" + arnRec.invoice_no; Cmd.CommandText = SQL; Cmd.ExecuteNonQuery(); trans.Commit(); return_val = true; } catch (Exception ex) { trans.Rollback(); throw ex; } finally { Con.Close(); } return(return_val); }
public bool insertARNRecord(ARNRecord arnRec) { arnRec.replaceQuote(); //INSERT IV CHARGE ITEMS Cmd = new SqlCommand(); Cmd.Connection = Con; Con.Open(); SqlTransaction trans = Con.BeginTransaction(); Cmd.Transaction = trans; bool return_val = false; try { //INSERT INVOICE RECORD SQL = "INSERT INTO [import_hawb] "; SQL += "( elt_account_number, "; SQL += "agent_elt_acct,"; SQL += " agent_org_acct ,"; // SQL += " arn_no ,"; SQL += " arr_code ,"; SQL += " arr_port ,"; SQL += " broker_acct ,"; SQL += " broker_info ,"; SQL += " broker_name ,"; SQL += " cargo_location ,"; SQL += " chg_wt ,"; SQL += " consignee_acct ,"; SQL += " consignee_info ,"; SQL += " consignee_name ,"; SQL += " container_location ,"; SQL += " CreatedBy ,"; SQL += " CreatedDate ,"; SQL += " customer_ref ,"; SQL += " delivery_place ,"; SQL += " dep_code ,"; SQL += " dep_port ,"; SQL += " desc1 ,"; SQL += " desc2 ,"; SQL += " desc3 ,"; SQL += " desc4 ,"; SQL += " desc5 ,"; SQL += " destination ,"; SQL += " eta ,"; SQL += " eta2 ,"; SQL += " etd ,"; SQL += " etd2 ,"; SQL += " fc_charge ,"; SQL += "fc_rate ,"; SQL += " flt_no ,"; SQL += " free_date ,"; SQL += " freight_collect ,"; SQL += " go_date ,"; SQL += " gross_wt ,"; SQL += " hawb_num ,"; SQL += " igSub_HAWB ,"; SQL += " invoice_no ,"; SQL += " is_default_rate ,"; SQL += " is_org_merged ,"; SQL += " it_date ,"; SQL += " it_entry_port ,"; SQL += " it_number ,"; SQL += " iType ,"; SQL += " mawb_num ,"; SQL += " ModifiedBy ,"; SQL += " ModifiedDate ,"; SQL += " notify_acct ,"; SQL += " notify_info ,"; SQL += " notify_name ,"; SQL += "oc_collect ,"; SQL += " pickup_date ,"; SQL += "pieces ,"; SQL += " prepaid_collect ,"; SQL += "prepared_by ,"; SQL += "process_dt ,"; SQL += " processed ,"; SQL += " remarks ,"; SQL += " SalesPerson ,"; SQL += "scale1 ,"; SQL += " scale2 ,"; SQL += " sec ,"; SQL += " shipper_acct ,"; SQL += " shipper_info ,"; SQL += " shipper_name ,"; SQL += " sub_mawb1 ,"; SQL += "sub_mawb2 ,"; SQL += " term ,"; SQL += "total_other_charge ,"; SQL += "tran_dt ,"; SQL += "uom ) "; SQL += "VALUES"; SQL += "('" + base.elt_account_number; SQL += "','" + arnRec.agent_elt_acct; SQL += "','" + arnRec.agent_org_acct; //SQL += "','" + arnRec.arn_no; SQL += "','" + arnRec.arr_code; SQL += "','" + arnRec.arr_port; SQL += "','" + arnRec.broker_acct; SQL += "','" + arnRec.broker_info; SQL += "','" + arnRec.broker_name; SQL += "','" + arnRec.cargo_location; SQL += "','" + arnRec.chg_wt; SQL += "','" + arnRec.consignee_acct; SQL += "','" + arnRec.consignee_info; SQL += "','" + arnRec.consignee_name; SQL += "','" + arnRec.container_location; SQL += "','" + arnRec.CreatedBy; SQL += "','" + arnRec.CreatedDate; // SQL += "','" + arnRec.customer_ref; SQL += "','" + arnRec.delivery_place; SQL += "','" + arnRec.dep_code; SQL += "','" + arnRec.dep_port; SQL += "','" + arnRec.desc1; SQL += "','" + arnRec.desc2; SQL += "','" + arnRec.desc3; SQL += "','" + arnRec.desc4; SQL += "','" + arnRec.desc5; SQL += "','" + arnRec.destination; SQL += "','" + arnRec.eta; SQL += "','" + arnRec.eta2; SQL += "','" + arnRec.etd; SQL += "','" + arnRec.etd2; SQL += "','" + arnRec.fc_charge; SQL += "','" + arnRec.fc_rate; SQL += "','" + arnRec.flt_no; SQL += "','" + arnRec.free_date; // SQL += "','" + arnRec.freight_collect; SQL += "','" + arnRec.go_date; // SQL += "','" + arnRec.gross_wt; SQL += "','" + arnRec.hawb_num; SQL += "','" + arnRec.igSub_HAWB; SQL += "','" + arnRec.invoice_no; SQL += "','" + arnRec.is_default_rate; SQL += "','" + arnRec.is_org_merged; SQL += "','" + arnRec.it_date; // SQL += "','" + arnRec.it_entry_port; SQL += "','" + arnRec.it_number; SQL += "','" + arnRec.iType; SQL += "','" + arnRec.mawb_num; SQL += "','" + arnRec.ModifiedBy; SQL += "','" + arnRec.ModifiedDate; SQL += "','" + arnRec.notify_acct; SQL += "','" + arnRec.notify_info; SQL += "','" + arnRec.notify_name; SQL += "','" + arnRec.oc_collect; SQL += "','" + arnRec.pickup_date;// SQL += "','" + arnRec.pieces; SQL += "','" + arnRec.prepaid_collect; SQL += "','" + arnRec.prepared_by; SQL += "','" + arnRec.process_dt; SQL += "','" + arnRec.processed; SQL += "','" + arnRec.remarks; SQL += "','" + arnRec.SalesPerson; SQL += "','" + arnRec.scale1; SQL += "','" + arnRec.scale2; SQL += "','" + arnRec.sec; SQL += "','" + arnRec.shipper_acct; SQL += "','" + arnRec.shipper_info; SQL += "','" + arnRec.shipper_name; SQL += "','" + arnRec.sub_mawb1; SQL += "','" + arnRec.sub_mawb2; SQL += "','" + arnRec.term; SQL += "','" + arnRec.total_other_charge; SQL += "','" + arnRec.tran_dt; SQL += "','" + arnRec.uom; SQL += "')"; Cmd.CommandText = SQL; Cmd.ExecuteNonQuery(); trans.Commit(); return_val = true; } catch (Exception ex) { trans.Rollback(); throw ex; } finally { Con.Close(); } return(return_val); }