hello sir i have problem related to entity framwork 4.0 when i insert data into client table then it show below error plz help me sir

Violation of PRIMARY KEY constraint 'PK_client'. Cannot insert duplicate key in object 'dbo.client'.
The statement has been terminated.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint 'PK_client'. Cannot insert duplicate key in object 'dbo.client'.
The statement has been terminated.

Source Error: 


Line 405:            }
Line 406:    
Line 407:            return base.ExecuteFunction<Nullable<global::System.Int32>>("sp1_client", uidParameter, usernameParameter, addressParameter, phone_noParameter, ageParameter, genderParameter, invoice_noParameter, cforParameter, trans_typeParameter, aaParameter);
Line 408:        }
Line 409:    

Source File: c:\Users\Administrator\Documents\Visual Studio 2010\WebSites\dealer_invoice\App_Code\Model.Designer.cs    Line: 407 

Stack Trace: 


[SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PK_client'. Cannot insert duplicate key in object 'dbo.client'.
The statement has been terminated.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +2030802
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5009584
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
   System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +33
   System.Data.SqlClient.SqlDataReader.get_MetaData() +86
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +311
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +987
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141
   System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
   System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) +10
   System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) +443

[EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details.]
   System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) +479
   System.Data.Objects.ObjectContext.CreateFunctionObjectResult(EntityCommand entityCommand, EntitySet entitySet, EdmType edmType, MergeOption mergeOption) +150
   System.Data.Objects.ObjectContext.ExecuteFunction(String functionName, MergeOption mergeOption, ObjectParameter[] parameters) +141
   System.Data.Objects.ObjectContext.ExecuteFunction(String functionName, ObjectParameter[] parameters) +11
   DatabaseModel.DatabaseEntities.sp1_client(Nullable`1 uid, String username, String address, String phone_no, Nullable`1 age, String gender, String invoice_no, Nullable`1 cfor, String trans_type, Nullable`1 aa) in c:\Users\Administrator\Documents\Visual Studio 2010\WebSites\dealer_invoice\App_Code\Model.Designer.cs:407
   conferm_ticket.Button1_Click(Object sender, EventArgs e) in c:\Users\Administrator\Documents\Visual Studio 2010\WebSites\dealer_invoice\conferm_ticket.aspx.cs:80
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
[CODE]this is my stored procedure
ALTER PROCEDURE sp_client
    (
    @uid int,@username nvarchar(50),@address nvarchar(50),@phone_no nvarchar(50),@age int,@gender nchar(10),@invoice_no nvarchar(50),@cfor int,@trans_type nvarchar(50),@aa int
    )
AS

    if @aa=1
    insert into client(uid,username,address,phone_no,age,gender,invoice_no,cfor,type) values(@uid,@username,@address,@phone_no,@age,@gender,@invoice_no,@cfor,@trans_type)
    select * from client

    if @aa=2
    select * from client

    if @aa=3
    select * from client where username = @username

    if @aa=4
    select max(uid) from client

    if @aa=5
    select max(uid+1) from client

this is my c# code

protected void Button1_Click(object sender, EventArgs e)
{

    //string fname = Request.QueryString["fname"].ToString();
    //string lname = Request.QueryString["lname"].ToString();
    //string username = fname + "" + lname;
    //string phone =  Request.QueryString["phone"].ToString();
    //string gen = Request.QueryString["gender"].ToString();
    //string age = Request.QueryString["age"].ToString();
    //string tra_type = Request.QueryString["trans_type"].ToString();
    te = new DatabaseEntities();
    System.Nullable<int> c_max = te.sp1_client(1, "", "", "", 12, "", "", 33, "", 5).FirstOrDefault();
    System.Nullable<int> i_client = te.sp1_client(c_max.Value, Label1.Text, Label10.Text, Label13.Text, 12, Label2.Text, Label1.Text, 45, Label6.Text, 1).Max();
    //System.Nullable<int> uid = te.sp1_client(1, "", "", "", 1, "", "", 1, "", 4).Single();
    //System.Nullable<int> t_max = te.sp1_ticket(1,1,"","","",1.2,1.2,1.2,1.2,1.2,1.2,"","","",2).Single();
    //System.Nullable<int> i_ticket = te.sp1_ticket(t_max.Value, uid.Value, Label12.Text, Label14.Text, Label10.Text, Convert.ToDouble(Label15.Text), Convert.ToDouble(Label16.Text), Convert.ToDouble(Label17.Text), Convert.ToDouble(Label18.Text), Convert.ToDouble(Label19.Text), Convert.ToDouble(Label20.Text), Label4.Text, Label3.Text, "", 1).Max();
    //System.Nullable<int> i_max = te.sp1_invoice(1, 1, "", 1.3, 2).Single();
    //System.Nullable<int> i_invoice = te.sp1_invoice(i_max.Value, uid.Value, Label2.Text, Convert.ToDouble(Label21.Text), 1).Max();
    //System.Nullable<int> a_max = te.sp1_airline(1, 1, "", "", 1, 3).Single();
    //System.Nullable<int> i_airline = te.sp1_airline(a_max.Value, uid.Value, Label18.Text, Label13.Text, 1, 1).Max();
    te.SaveChanges();
     if (i_client.HasValue)
     {
         Response.Write(i_client.Value + "<br/>" + "Data Submited");
     }
}

More code:

//------------------------------------------------------------------------------
// <auto-generated>
//    This code was generated from a template.
//
//    Manual changes to this file may cause unexpected behavior in your application.
//    Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
using System.Data.EntityClient;
using System.ComponentModel;
using System.Xml.Serialization;
using System.Runtime.Serialization;

[assembly: EdmSchemaAttribute()]

namespace DatabaseModel
{
    #region Contexts

    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    public partial class DatabaseEntities : ObjectContext
    {
        #region Constructors

        /// <summary>
        /// Initializes a new DatabaseEntities object using the connection string found in the 'DatabaseEntities' section of the application configuration file.
        /// </summary>
        public DatabaseEntities() : base("name=DatabaseEntities", "DatabaseEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }

        /// <summary>
        /// Initialize a new DatabaseEntities object.
        /// </summary>
        public DatabaseEntities(string connectionString) : base(connectionString, "DatabaseEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }

        /// <summary>
        /// Initialize a new DatabaseEntities object.
        /// </summary>
        public DatabaseEntities(EntityConnection connection) : base(connection, "DatabaseEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }

        #endregion

        #region Partial Methods

        partial void OnContextCreated();

        #endregion

        #region ObjectSet Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<airline> airlines
        {
            get
            {
                if ((_airlines == null))
                {
                    _airlines = base.CreateObjectSet<airline>("airlines");
                }
                return _airlines;
            }
        }
        private ObjectSet<airline> _airlines;

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<client> clients
        {
            get
            {
                if ((_clients == null))
                {
                    _clients = base.CreateObjectSet<client>("clients");
                }
                return _clients;
            }
        }
        private ObjectSet<client> _clients;

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<invoice> invoices
        {
            get
            {
                if ((_invoices == null))
                {
                    _invoices = base.CreateObjectSet<invoice>("invoices");
                }
                return _invoices;
            }
        }
        private ObjectSet<invoice> _invoices;

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<receipt> receipts
        {
            get
            {
                if ((_receipts == null))
                {
                    _receipts = base.CreateObjectSet<receipt>("receipts");
                }
                return _receipts;
            }
        }
        private ObjectSet<receipt> _receipts;

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<ticket> tickets
        {
            get
            {
                if ((_tickets == null))
                {
                    _tickets = base.CreateObjectSet<ticket>("tickets");
                }
                return _tickets;
            }
        }
        private ObjectSet<ticket> _tickets;

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<tran> trans
        {
            get
            {
                if ((_trans == null))
                {
                    _trans = base.CreateObjectSet<tran>("trans");
                }
                return _trans;
            }
        }
        private ObjectSet<tran> _trans;

        #endregion
        #region AddTo Methods

        /// <summary>
        /// Deprecated Method for adding a new object to the airlines EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToairlines(airline airline)
        {
            base.AddObject("airlines", airline);
        }

        /// <summary>
        /// Deprecated Method for adding a new object to the clients EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToclients(client client)
        {
            base.AddObject("clients", client);
        }

        /// <summary>
        /// Deprecated Method for adding a new object to the invoices EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToinvoices(invoice invoice)
        {
            base.AddObject("invoices", invoice);
        }

        /// <summary>
        /// Deprecated Method for adding a new object to the receipts EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToreceipts(receipt receipt)
        {
            base.AddObject("receipts", receipt);
        }

        /// <summary>
        /// Deprecated Method for adding a new object to the tickets EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddTotickets(ticket ticket)
        {
            base.AddObject("tickets", ticket);
        }

        /// <summary>
        /// Deprecated Method for adding a new object to the trans EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddTotrans(tran tran)
        {
            base.AddObject("trans", tran);
        }

        #endregion
        #region Function Imports

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        /// <param name="aid">No Metadata Documentation available.</param>
        /// <param name="uid">No Metadata Documentation available.</param>
        /// <param name="airline_pref">No Metadata Documentation available.</param>
        /// <param name="flt_no">No Metadata Documentation available.</param>
        /// <param name="status">No Metadata Documentation available.</param>
        /// <param name="aa">No Metadata Documentation available.</param>
        public ObjectResult<Nullable<global::System.Int32>> sp1_airline(Nullable<global::System.Int32> aid, Nullable<global::System.Int32> uid, global::System.String airline_pref, global::System.String flt_no, Nullable<global::System.Int32> status, Nullable<global::System.Int32> aa)
        {
            ObjectParameter aidParameter;
            if (aid.HasValue)
            {
                aidParameter = new ObjectParameter("aid", aid);
            }
            else
            {
                aidParameter = new ObjectParameter("aid", typeof(global::System.Int32));
            }

            ObjectParameter uidParameter;
            if (uid.HasValue)
            {
                uidParameter = new ObjectParameter("uid", uid);
            }
            else
            {
                uidParameter = new ObjectParameter("uid", typeof(global::System.Int32));
            }

            ObjectParameter airline_prefParameter;
            if (airline_pref != null)
            {
                airline_prefParameter = new ObjectParameter("airline_pref", airline_pref);
            }
            else
            {
                airline_prefParameter = new ObjectParameter("airline_pref", typeof(global::System.String));
            }

            ObjectParameter flt_noParameter;
            if (flt_no != null)
            {
                flt_noParameter = new ObjectParameter("flt_no", flt_no);
            }
            else
            {
                flt_noParameter = new ObjectParameter("flt_no", typeof(global::System.String));
            }

            ObjectParameter statusParameter;
            if (status.HasValue)
            {
                statusParameter = new ObjectParameter("status", status);
            }
            else
            {
                statusParameter = new ObjectParameter("status", typeof(global::System.Int32));
            }

            ObjectParameter aaParameter;
            if (aa.HasValue)
            {
                aaParameter = new ObjectParameter("aa", aa);
            }
            else
            {
                aaParameter = new ObjectParameter("aa", typeof(global::System.Int32));
            }

            return base.ExecuteFunction<Nullable<global::System.Int32>>("sp1_airline", aidParameter, uidParameter, airline_prefParameter, flt_noParameter, statusParameter, aaParameter);
        }

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        /// <param name="uid">No Metadata Documentation available.</param>
        /// <param name="username">No Metadata Documentation available.</param>
        /// <param name="address">No Metadata Documentation available.</param>
        /// <param name="phone_no">No Metadata Documentation available.</param>
        /// <param name="age">No Metadata Documentation available.</param>
        /// <param name="gender">No Metadata Documentation available.</param>
        /// <param name="invoice_no">No Metadata Documentation available.</param>
        /// <param name="cfor">No Metadata Documentation available.</param>
        /// <param name="trans_type">No Metadata Documentation available.</param>
        /// <param name="aa">No Metadata Documentation available.</param>
        public ObjectResult<Nullable<global::System.Int32>> sp1_client(Nullable<global::System.Int32> uid, global::System.String username, global::System.String address, global::System.String phone_no, Nullable<global::System.Int32> age, global::System.String gender, global::System.String invoice_no, Nullable<global::System.Int32> cfor, global::System.String trans_type, Nullable<global::System.Int32> aa)
        {
            ObjectParameter uidParameter;
            if (uid.HasValue)
            {
                uidParameter = new ObjectParameter("uid", uid);
            }
            else
            {
                uidParameter = new ObjectParameter("uid", typeof(global::System.Int32));
            }

            ObjectParameter usernameParameter;
            if (username != null)
            {
                usernameParameter = new ObjectParameter("username", username);
            }
            else
            {
                usernameParameter = new ObjectParameter("username", typeof(global::System.String));
            }

            ObjectParameter addressParameter;
            if (address != null)
            {
                addressParameter = new ObjectParameter("address", address);
            }
            else
            {
                addressParameter = new ObjectParameter("address", typeof(global::System.String));
            }

            ObjectParameter phone_noParameter;
            if (phone_no != null)
            {
                phone_noParameter = new ObjectParameter("phone_no", phone_no);
            }
            else
            {
                phone_noParameter = new ObjectParameter("phone_no", typeof(global::System.String));
            }

            ObjectParameter ageParameter;
            if (age.HasValue)
            {
                ageParameter = new ObjectParameter("age", age);
            }
            else
            {
                ageParameter = new ObjectParameter("age", typeof(global::System.Int32));
            }

            ObjectParameter genderParameter;
            if (gender != null)
            {
                genderParameter = new ObjectParameter("gender", gender);
            }
            else
            {
                genderParameter = new ObjectParameter("gender", typeof(global::System.String));
            }

            ObjectParameter invoice_noParameter;
            if (invoice_no != null)
            {
                invoice_noParameter = new ObjectParameter("invoice_no", invoice_no);
            }
            else
            {
                invoice_noParameter = new ObjectParameter("invoice_no", typeof(global::System.String));
            }

            ObjectParameter cforParameter;
            if (cfor.HasValue)
            {
                cforParameter = new ObjectParameter("cfor", cfor);
            }
            else
            {
                cforParameter = new ObjectParameter("cfor", typeof(global::System.Int32));
            }

            ObjectParameter trans_typeParameter;
            if (trans_type != null)
            {
                trans_typeParameter = new ObjectParameter("trans_type", trans_type);
            }
            else
            {
                trans_typeParameter = new ObjectParameter("trans_type", typeof(global::System.String));
            }

            ObjectParameter aaParameter;
            if (aa.HasValue)
            {
                aaParameter = new ObjectParameter("aa", aa);
            }
            else
            {
                aaParameter = new ObjectParameter("aa", typeof(global::System.Int32));
            }

            return base.ExecuteFunction<Nullable<global::System.Int32>>("sp1_client", uidParameter, usernameParameter, addressParameter, phone_noParameter, ageParameter, genderParameter, invoice_noParameter, cforParameter, trans_typeParameter, aaParameter);
        }

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        /// <param name="i_id">No Metadata Documentation available.</param>
        /// <param name="uid">No Metadata Documentation available.</param>
        /// <param name="date">No Metadata Documentation available.</param>
        /// <param name="amount">No Metadata Documentation available.</param>
        /// <param name="aa">No Metadata Documentation available.</param>
        public ObjectResult<Nullable<global::System.Int32>> sp1_invoice(Nullable<global::System.Int32> i_id, Nullable<global::System.Int32> uid, global::System.String date, Nullable<global::System.Double> amount, Nullable<global::System.Int32> aa)
        {
            ObjectParameter i_idParameter;
            if (i_id.HasValue)
            {
                i_idParameter = new ObjectParameter("i_id", i_id);
            }
            else
            {
                i_idParameter = new ObjectParameter("i_id", typeof(global::System.Int32));
            }

            ObjectParameter uidParameter;
            if (uid.HasValue)
            {
                uidParameter = new ObjectParameter("uid", uid);
            }
            else
            {
                uidParameter = new ObjectParameter("uid", typeof(global::System.Int32));
            }

            ObjectParameter dateParameter;
            if (date != null)
            {
                dateParameter = new ObjectParameter("date", date);
            }
            else
            {
                dateParameter = new ObjectParameter("date", typeof(global::System.String));
            }

            ObjectParameter amountParameter;
            if (amount.HasValue)
            {
                amountParameter = new ObjectParameter("amount", amount);
            }
            else
            {
                amountParameter = new ObjectParameter("amount", typeof(global::System.Double));
            }

            ObjectParameter aaParameter;
            if (aa.HasValue)
            {
                aaParameter = new ObjectParameter("aa", aa);
            }
            else
            {
                aaParameter = new ObjectParameter("aa", typeof(global::System.Int32));
            }

            return base.ExecuteFunction<Nullable<global::System.Int32>>("sp1_invoice", i_idParameter, uidParameter, dateParameter, amountParameter, aaParameter);
        }

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        /// <param name="r_id">No Metadata Documentation available.</param>
        /// <param name="uid">No Metadata Documentation available.</param>
        /// <param name="receipt_date">No Metadata Documentation available.</param>
        /// <param name="amount">No Metadata Documentation available.</param>
        /// <param name="aa">No Metadata Documentation available.</param>
        public int sp1_receipt(Nullable<global::System.Int32> r_id, Nullable<global::System.Int32> uid, global::System.String receipt_date, Nullable<global::System.Double> amount, Nullable<global::System.Int32> aa)
        {
            ObjectParameter r_idParameter;
            if (r_id.HasValue)
            {
                r_idParameter = new ObjectParameter("r_id", r_id);
            }
            else
            {
                r_idParameter = new ObjectParameter("r_id", typeof(global::System.Int32));
            }

            ObjectParameter uidParameter;
            if (uid.HasValue)
            {
                uidParameter = new ObjectParameter("uid", uid);
            }
            else
            {
                uidParameter = new ObjectParameter("uid", typeof(global::System.Int32));
            }

            ObjectParameter receipt_dateParameter;
            if (receipt_date != null)
            {
                receipt_dateParameter = new ObjectParameter("receipt_date", receipt_date);
            }
            else
            {
                receipt_dateParameter = new ObjectParameter("receipt_date", typeof(global::System.String));
            }

            ObjectParameter amountParameter;
            if (amount.HasValue)
            {
                amountParameter = new ObjectParameter("amount", amount);
            }
            else
            {
                amountParameter = new ObjectParameter("amount", typeof(global::System.Double));
            }

            ObjectParameter aaParameter;
            if (aa.HasValue)
            {
                aaParameter = new ObjectParameter("aa", aa);
            }
            else
            {
                aaParameter = new ObjectParameter("aa", typeof(global::System.Int32));
            }

            return base.ExecuteFunction("sp1_receipt", r_idParameter, uidParameter, receipt_dateParameter, amountParameter, aaParameter);
        }

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        /// <param name="tick_id">No Metadata Documentation available.</param>
        /// <param name="uid">No Metadata Documentation available.</param>
        /// <param name="f_date">No Metadata Documentation available.</param>
        /// <param name="s_d">No Metadata Documentation available.</param>
        /// <param name="class">No Metadata Documentation available.</param>
        /// <param name="fare">No Metadata Documentation available.</param>
        /// <param name="ser_tax">No Metadata Documentation available.</param>
        /// <param name="edu_hec">No Metadata Documentation available.</param>
        /// <param name="scs_mfree">No Metadata Documentation available.</param>
        /// <param name="mcd_psf">No Metadata Documentation available.</param>
        /// <param name="void_tax">No Metadata Documentation available.</param>
        /// <param name="pnr">No Metadata Documentation available.</param>
        /// <param name="code">No Metadata Documentation available.</param>
        /// <param name="seat_pref">No Metadata Documentation available.</param>
        /// <param name="aa">No Metadata Documentation available.</param>
        public ObjectResult<Nullable<global::System.Int32>> sp1_ticket(Nullable<global::System.Int32> tick_id, Nullable<global::System.Int32> uid, global::System.String f_date, global::System.String s_d, global::System.String @class, Nullable<global::System.Double> fare, Nullable<global::System.Double> ser_tax, Nullable<global::System.Double> edu_hec, Nullable<global::System.Double> scs_mfree, Nullable<global::System.Double> mcd_psf, Nullable<global::System.Double> void_tax, global::System.String pnr, global::System.String code, global::System.String seat_pref, Nullable<global::System.Int32> aa)
        {
            ObjectParameter tick_idParameter;
            if (tick_id.HasValue)
            {
                tick_idParameter = new ObjectParameter("tick_id", tick_id);
            }
            else
            {
                tick_idParameter = new ObjectParameter("tick_id", typeof(global::System.Int32));
            }

            ObjectParameter uidParameter;
            if (uid.HasValue)
            {
                uidParameter = new ObjectParameter("uid", uid);
            }
            else
            {
                uidParameter = new ObjectParameter("uid", typeof(global::System.Int32));
            }

            ObjectParameter f_dateParameter;
            if (f_date != null)
            {
                f_dateParameter = new ObjectParameter("f_date", f_date);
            }
            else
            {
                f_dateParameter = new ObjectParameter("f_date", typeof(global::System.String));
            }

            ObjectParameter s_dParameter;
            if (s_d != null)
            {
                s_dParameter = new ObjectParameter("s_d", s_d);
            }
            else
            {
                s_dParameter = new ObjectParameter("s_d", typeof(global::System.String));
            }

            ObjectParameter classParameter;
            if (@class != null)
            {
                classParameter = new ObjectParameter("class", @class);
            }
            else
            {
                classParameter = new ObjectParameter("class", typeof(global::System.String));
            }

            ObjectParameter fareParameter;
            if (fare.HasValue)
            {
                fareParameter = new ObjectParameter("fare", fare);
            }
            else
            {
                fareParameter = new ObjectParameter("fare", typeof(global::System.Double));
            }

            ObjectParameter ser_taxParameter;
            if (ser_tax.HasValue)
            {
                ser_taxParameter = new ObjectParameter("ser_tax", ser_tax);
            }
            else
            {
                ser_taxParameter = new ObjectParameter("ser_tax", typeof(global::System.Double));
            }

            ObjectParameter edu_hecParameter;
            if (edu_hec.HasValue)
            {
                edu_hecParameter = new ObjectParameter("edu_hec", edu_hec);
            }
            else
            {
                edu_hecParameter = new ObjectParameter("edu_hec", typeof(global::System.Double));
            }

            ObjectParameter scs_mfreeParameter;
            if (scs_mfree.HasValue)
            {
                scs_mfreeParameter = new ObjectParameter("scs_mfree", scs_mfree);
            }
            else
            {
                scs_mfreeParameter = new ObjectParameter("scs_mfree", typeof(global::System.Double));
            }

            ObjectParameter mcd_psfParameter;
            if (mcd_psf.HasValue)
            {
                mcd_psfParameter = new ObjectParameter("mcd_psf", mcd_psf);
            }
            else
            {
                mcd_psfParameter = new ObjectParameter("mcd_psf", typeof(global::System.Double));
            }

            ObjectParameter void_taxParameter;
            if (void_tax.HasValue)
            {
                void_taxParameter = new ObjectParameter("void_tax", void_tax);
            }
            else
            {
                void_taxParameter = new ObjectParameter("void_tax", typeof(global::System.Double));
            }

            ObjectParameter pnrParameter;
            if (pnr != null)
            {
                pnrParameter = new ObjectParameter("pnr", pnr);
            }
            else
            {
                pnrParameter = new ObjectParameter("pnr", typeof(global::System.String));
            }

            ObjectParameter codeParameter;
            if (code != null)
            {
                codeParameter = new ObjectParameter("code", code);
            }
            else
            {
                codeParameter = new ObjectParameter("code", typeof(global::System.String));
            }

            ObjectParameter seat_prefParameter;
            if (seat_pref != null)
            {
                seat_prefParameter = new ObjectParameter("seat_pref", seat_pref);
            }
            else
            {
                seat_prefParameter = new ObjectParameter("seat_pref", typeof(global::System.String));
            }

            ObjectParameter aaParameter;
            if (aa.HasValue)
            {
                aaParameter = new ObjectParameter("aa", aa);
            }
            else
            {
                aaParameter = new ObjectParameter("aa", typeof(global::System.Int32));
            }

            return base.ExecuteFunction<Nullable<global::System.Int32>>("sp1_ticket", tick_idParameter, uidParameter, f_dateParameter, s_dParameter, classParameter, fareParameter, ser_taxParameter, edu_hecParameter, scs_mfreeParameter, mcd_psfParameter, void_taxParameter, pnrParameter, codeParameter, seat_prefParameter, aaParameter);
        }

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        /// <param name="trans_id">No Metadata Documentation available.</param>
        /// <param name="uid">No Metadata Documentation available.</param>
        /// <param name="trans_date">No Metadata Documentation available.</param>
        /// <param name="crad">No Metadata Documentation available.</param>
        /// <param name="debit">No Metadata Documentation available.</param>
        /// <param name="aa">No Metadata Documentation available.</param>
        public ObjectResult<Nullable<global::System.Int32>> sp1_trans(Nullable<global::System.Int32> trans_id, Nullable<global::System.Int32> uid, global::System.String trans_date, Nullable<global::System.Double> crad, Nullable<global::System.Double> debit, Nullable<global::System.Int32> aa)
        {
            ObjectParameter trans_idParameter;
            if (trans_id.HasValue)
            {
                trans_idParameter = new ObjectParameter("trans_id", trans_id);
            }
            else
            {
                trans_idParameter = new ObjectParameter("trans_id", typeof(global::System.Int32));
            }

            ObjectParameter uidParameter;
            if (uid.HasValue)
            {
                uidParameter = new ObjectParameter("uid", uid);
            }
            else
            {
                uidParameter = new ObjectParameter("uid", typeof(global::System.Int32));
            }

            ObjectParameter trans_dateParameter;
            if (trans_date != null)
            {
                trans_dateParameter = new ObjectParameter("trans_date", trans_date);
            }
            else
            {
                trans_dateParameter = new ObjectParameter("trans_date", typeof(global::System.String));
            }

            ObjectParameter cradParameter;
            if (crad.HasValue)
            {
                cradParameter = new ObjectParameter("crad", crad);
            }
            else
            {
                cradParameter = new ObjectParameter("crad", typeof(global::System.Double));
            }

            ObjectParameter debitParameter;
            if (debit.HasValue)
            {
                debitParameter = new ObjectParameter("debit", debit);
            }
            else
            {
                debitParameter = new ObjectParameter("debit", typeof(global::System.Double));
            }

            ObjectParameter aaParameter;
            if (aa.HasValue)
            {
                aaParameter = new ObjectParameter("aa", aa);
            }
            else
            {
                aaParameter = new ObjectParameter("aa", typeof(global::System.Int32));
            }

            return base.ExecuteFunction<Nullable<global::System.Int32>>("sp1_trans", trans_idParameter, uidParameter, trans_dateParameter, cradParameter, debitParameter, aaParameter);
        }

        #endregion
    }


    #endregion

    #region Entities

    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="DatabaseModel", Name="airline")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class airline : EntityObject
    {
        #region Factory Method

        /// <summary>
        /// Create a new airline object.
        /// </summary>
        /// <param name="aid">Initial value of the aid property.</param>
        public static airline Createairline(global::System.Int32 aid)
        {
            airline airline = new airline();
            airline.aid = aid;
            return airline;
        }

        #endregion
        #region Primitive Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 aid
        {
            get
            {
                return _aid;
            }
            set
            {
                if (_aid != value)
                {
                    OnaidChanging(value);
                    ReportPropertyChanging("aid");
                    _aid = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("aid");
                    OnaidChanged();
                }
            }
        }
        private global::System.Int32 _aid;
        partial void OnaidChanging(global::System.Int32 value);
        partial void OnaidChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> uid
        {
            get
            {
                return _uid;
            }
            set
            {
                OnuidChanging(value);
                ReportPropertyChanging("uid");
                _uid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("uid");
                OnuidChanged();
            }
        }
        private Nullable<global::System.Int32> _uid;
        partial void OnuidChanging(Nullable<global::System.Int32> value);
        partial void OnuidChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String airline_pref
        {
            get
            {
                return _airline_pref;
            }
            set
            {
                Onairline_prefChanging(value);
                ReportPropertyChanging("airline_pref");
                _airline_pref = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("airline_pref");
                Onairline_prefChanged();
            }
        }
        private global::System.String _airline_pref;
        partial void Onairline_prefChanging(global::System.String value);
        partial void Onairline_prefChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String flt_no
        {
            get
            {
                return _flt_no;
            }
            set
            {
                Onflt_noChanging(value);
                ReportPropertyChanging("flt_no");
                _flt_no = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("flt_no");
                Onflt_noChanged();
            }
        }
        private global::System.String _flt_no;
        partial void Onflt_noChanging(global::System.String value);
        partial void Onflt_noChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> status
        {
            get
            {
                return _status;
            }
            set
            {
                OnstatusChanging(value);
                ReportPropertyChanging("status");
                _status = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("status");
                OnstatusChanged();
            }
        }
        private Nullable<global::System.Int32> _status;
        partial void OnstatusChanging(Nullable<global::System.Int32> value);
        partial void OnstatusChanged();

        #endregion

    }

    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="DatabaseModel", Name="client")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class client : EntityObject
    {
        #region Factory Method

        /// <summary>
        /// Create a new client object.
        /// </summary>
        /// <param name="uid">Initial value of the uid property.</param>
        public static client Createclient(global::System.Int32 uid)
        {
            client client = new client();
            client.uid = uid;
            return client;
        }

        #endregion
        #region Primitive Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 uid
        {
            get
            {
                return _uid;
            }
            set
            {
                if (_uid != value)
                {
                    OnuidChanging(value);
                    ReportPropertyChanging("uid");
                    _uid = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("uid");
                    OnuidChanged();
                }
            }
        }
        private global::System.Int32 _uid;
        partial void OnuidChanging(global::System.Int32 value);
        partial void OnuidChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String username
        {
            get
            {
                return _username;
            }
            set
            {
                OnusernameChanging(value);
                ReportPropertyChanging("username");
                _username = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("username");
                OnusernameChanged();
            }
        }
        private global::System.String _username;
        partial void OnusernameChanging(global::System.String value);
        partial void OnusernameChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String address
        {
            get
            {
                return _address;
            }
            set
            {
                OnaddressChanging(value);
                ReportPropertyChanging("address");
                _address = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("address");
                OnaddressChanged();
            }
        }
        private global::System.String _address;
        partial void OnaddressChanging(global::System.String value);
        partial void OnaddressChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String phone_no
        {
            get
            {
                return _phone_no;
            }
            set
            {
                Onphone_noChanging(value);
                ReportPropertyChanging("phone_no");
                _phone_no = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("phone_no");
                Onphone_noChanged();
            }
        }
        private global::System.String _phone_no;
        partial void Onphone_noChanging(global::System.String value);
        partial void Onphone_noChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> age
        {
            get
            {
                return _age;
            }
            set
            {
                OnageChanging(value);
                ReportPropertyChanging("age");
                _age = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("age");
                OnageChanged();
            }
        }
        private Nullable<global::System.Int32> _age;
        partial void OnageChanging(Nullable<global::System.Int32> value);
        partial void OnageChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String gender
        {
            get
            {
                return _gender;
            }
            set
            {
                OngenderChanging(value);
                ReportPropertyChanging("gender");
                _gender = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("gender");
                OngenderChanged();
            }
        }
        private global::System.String _gender;
        partial void OngenderChanging(global::System.String value);
        partial void OngenderChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String invoice_no
        {
            get
            {
                return _invoice_no;
            }
            set
            {
                Oninvoice_noChanging(value);
                ReportPropertyChanging("invoice_no");
                _invoice_no = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("invoice_no");
                Oninvoice_noChanged();
            }
        }
        private global::System.String _invoice_no;
        partial void Oninvoice_noChanging(global::System.String value);
        partial void Oninvoice_noChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> cfor
        {
            get
            {
                return _cfor;
            }
            set
            {
                OncforChanging(value);
                ReportPropertyChanging("cfor");
                _cfor = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("cfor");
                OncforChanged();
            }
        }
        private Nullable<global::System.Int32> _cfor;
        partial void OncforChanging(Nullable<global::System.Int32> value);
        partial void OncforChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String type
        {
            get
            {
                return _type;
            }
            set
            {
                OntypeChanging(value);
                ReportPropertyChanging("type");
                _type = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("type");
                OntypeChanged();
            }
        }
        private global::System.String _type;
        partial void OntypeChanging(global::System.String value);
        partial void OntypeChanged();

        #endregion

    }

    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="DatabaseModel", Name="invoice")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class invoice : EntityObject
    {
        #region Factory Method

        /// <summary>
        /// Create a new invoice object.
        /// </summary>
        /// <param name="i_id">Initial value of the i_id property.</param>
        public static invoice Createinvoice(global::System.Int32 i_id)
        {
            invoice invoice = new invoice();
            invoice.i_id = i_id;
            return invoice;
        }

        #endregion
        #region Primitive Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 i_id
        {
            get
            {
                return _i_id;
            }
            set
            {
                if (_i_id != value)
                {
                    Oni_idChanging(value);
                    ReportPropertyChanging("i_id");
                    _i_id = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("i_id");
                    Oni_idChanged();
                }
            }
        }
        private global::System.Int32 _i_id;
        partial void Oni_idChanging(global::System.Int32 value);
        partial void Oni_idChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> uid
        {
            get
            {
                return _uid;
            }
            set
            {
                OnuidChanging(value);
                ReportPropertyChanging("uid");
                _uid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("uid");
                OnuidChanged();
            }
        }
        private Nullable<global::System.Int32> _uid;
        partial void OnuidChanging(Nullable<global::System.Int32> value);
        partial void OnuidChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String date
        {
            get
            {
                return _date;
            }
            set
            {
                OndateChanging(value);
                ReportPropertyChanging("date");
                _date = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("date");
                OndateChanged();
            }
        }
        private global::System.String _date;
        partial void OndateChanging(global::System.String value);
        partial void OndateChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Double> amount
        {
            get
            {
                return _amount;
            }
            set
            {
                OnamountChanging(value);
                ReportPropertyChanging("amount");
                _amount = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("amount");
                OnamountChanged();
            }
        }
        private Nullable<global::System.Double> _amount;
        partial void OnamountChanging(Nullable<global::System.Double> value);
        partial void OnamountChanged();

        #endregion

    }

    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="DatabaseModel", Name="receipt")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class receipt : EntityObject
    {
        #region Factory Method

        /// <summary>
        /// Create a new receipt object.
        /// </summary>
        /// <param name="r_id">Initial value of the r_id property.</param>
        public static receipt Createreceipt(global::System.Int32 r_id)
        {
            receipt receipt = new receipt();
            receipt.r_id = r_id;
            return receipt;
        }

        #endregion
        #region Primitive Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 r_id
        {
            get
            {
                return _r_id;
            }
            set
            {
                if (_r_id != value)
                {
                    Onr_idChanging(value);
                    ReportPropertyChanging("r_id");
                    _r_id = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("r_id");
                    Onr_idChanged();
                }
            }
        }
        private global::System.Int32 _r_id;
        partial void Onr_idChanging(global::System.Int32 value);
        partial void Onr_idChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> uid
        {
            get
            {
                return _uid;
            }
            set
            {
                OnuidChanging(value);
                ReportPropertyChanging("uid");
                _uid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("uid");
                OnuidChanged();
            }
        }
        private Nullable<global::System.Int32> _uid;
        partial void OnuidChanging(Nullable<global::System.Int32> value);
        partial void OnuidChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String date
        {
            get
            {
                return _date;
            }
            set
            {
                OndateChanging(value);
                ReportPropertyChanging("date");
                _date = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("date");
                OndateChanged();
            }
        }
        private global::System.String _date;
        partial void OndateChanging(global::System.String value);
        partial void OndateChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Double> amount
        {
            get
            {
                return _amount;
            }
            set
            {
                OnamountChanging(value);
                ReportPropertyChanging("amount");
                _amount = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("amount");
                OnamountChanged();
            }
        }
        private Nullable<global::System.Double> _amount;
        partial void OnamountChanging(Nullable<global::System.Double> value);
        partial void OnamountChanged();

        #endregion

    }

    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="DatabaseModel", Name="ticket")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class ticket : EntityObject
    {
        #region Factory Method

        /// <summary>
        /// Create a new ticket object.
        /// </summary>
        /// <param name="tick_id">Initial value of the tick_id property.</param>
        public static ticket Createticket(global::System.Int32 tick_id)
        {
            ticket ticket = new ticket();
            ticket.tick_id = tick_id;
            return ticket;
        }

        #endregion
        #region Primitive Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 tick_id
        {
            get
            {
                return _tick_id;
            }
            set
            {
                if (_tick_id != value)
                {
                    Ontick_idChanging(value);
                    ReportPropertyChanging("tick_id");
                    _tick_id = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("tick_id");
                    Ontick_idChanged();
                }
            }
        }
        private global::System.Int32 _tick_id;
        partial void Ontick_idChanging(global::System.Int32 value);
        partial void Ontick_idChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> uid
        {
            get
            {
                return _uid;
            }
            set
            {
                OnuidChanging(value);
                ReportPropertyChanging("uid");
                _uid = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("uid");
                OnuidChanged();
            }
        }
        private Nullable<global::System.Int32> _uid;
        partial void OnuidChanging(Nullable<global::System.Int32> value);
        partial void OnuidChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String f_date
        {
            get
            {
                return _f_date;
            }
            set
            {
                Onf_dateChanging(value);
                ReportPropertyChanging("f_date");
                _f_date = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("f_date");
                Onf_dateChanged();
            }
        }
        private global::System.String _f_date;
        partial void Onf_dateChanging(global::System.String value);
        partial void Onf_dateChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String source_destination
        {
            get
            {
                return _source_destination;
            }
            set
            {
                Onsource_destinationChanging(value);
                ReportPropertyChanging("source_destination");
                _source_destination = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("source_destination");
                Onsource_destinationChanged();
            }
        }
        private global::System.String _source_destination;
        partial void Onsource_destinationChanging(global::System.String value);
        partial void Onsource_destinationChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String @class
        {
            get
            {
                return _class;
            }
            set
            {
                OnclassChanging(value);
                ReportPropertyChanging("class");
                _class = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("class");
                OnclassChanged();
            }
        }
        private global::System.String _class;
        partial void OnclassChanging(global::System.String value);
        partial void OnclassChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Double> fare
        {
            get
            {
                return _fare;
            }
            set
            {
                OnfareChanging(value);
                ReportPropertyChanging("fare");
                _fare = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("fare");
                OnfareChanged();
            }
        }
        private Nullable<global::System.Double> _fare;
        partial void OnfareChanging(Nullable<global::System.Double> value);
        partial void OnfareChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Double> ser_tax
        {
            get
            {
                return _ser_tax;
            }
            set
            {
                Onser_taxChanging(value);
                ReportPro

I didn't read your code and also it is not possible but the error is simple you are trying to insert record in table and also passing the primary key value to table that is already exist in table. You can avoid such errors just to make the primary key autoincrement or put logic to check either your primary key value exist in DB then change it to someting else.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.