public JOURNAL_DocProformaInvoice_Type_definitions()
 {
     //Proforma Invoice
     ProformaInvoiceDraftTime = new journaltype("ProformaInvoiceDraftTime", lngRPM.s_ProformaInvoiceDraftTime_description.s); ;
     journaltype_list.Add(ProformaInvoiceDraftTime);
     ProformaInvoiceTime = new journaltype("ProformaInvoiceTime", lngRPM.s_ProformaInvoiceTime_description.s);
     journaltype_list.Add(ProformaInvoiceTime);
 }
 public JOURNAL_DocInvoice_Type_definitions()
 {
     //Tax Invoice
     InvoiceDraftTime = new journaltype("InvoiceDraftTime", lngRPM.s_InvoiceDraftTime_description.s); ;
     journaltype_list.Add(InvoiceDraftTime);
     InvoiceTime = new journaltype("InvoiceTime", lngRPM.s_InvoiceTime_description.s);
     journaltype_list.Add(InvoiceTime);
     InvoicePaidTime = new journaltype("InvoicePaidTime", lngRPM.s_InvoicePaidTime_description.s); ;
     journaltype_list.Add(InvoicePaidTime);
     InvoiceStornoTime = new journaltype("InvoiceStornoTime", lngRPM.s_InvoiceStornoTime_description.s); ;
     journaltype_list.Add(InvoiceStornoTime);
 }
 private bool Get(journaltype jrt,DataTable dt)
 {
     foreach (DataRow dr in dt.Rows)
     {
         if (dr["Name"] is string)
         {
             string sName = (string)dr["Name"];
             if (jrt.Name.Equals(sName))
             {
                 jrt.ID = (long)dr["ID"];
                 return true;
             }
         }
     }
     return false;
 }
        private bool Set(journaltype jrt)
        {
            List<SQL_Parameter> lpar = new List<SQL_Parameter>();
            string spar_Name = "@par_Name";
            SQL_Parameter par_Name = new SQL_Parameter(spar_Name, SQL_Parameter.eSQL_Parameter.Nvarchar, false, jrt.Name);
            string sval_Name = spar_Name;
            lpar.Add(par_Name);

            string sval_Description = "null";
            if (jrt.Description!=null)
            {
                if (jrt.Description.Length>0)
                {
                    string spar_Description = "@par_Description";
                    SQL_Parameter par_Description = new SQL_Parameter(spar_Description,SQL_Parameter.eSQL_Parameter.Nvarchar,false,jrt.Description);
                    sval_Description = spar_Description;
                    lpar.Add(par_Description);
                }
            }

            string sql = "insert into JOURNAL_DocProformaInvoice_Type (Name,Description) values ("+sval_Name+","+sval_Description+")";
            long jrt_id =-1;
            object oret = null;
            string Err = null;
            if (DBSync.DBSync.ExecuteNonQuerySQLReturnID(sql,lpar,ref jrt_id,ref oret,ref Err,"JOURNAL_DocProformaInvoice_Type"))
            {
                jrt.ID = jrt_id;
                return true;
            }
            else
            {
                LogFile.Error.Show("ERROR:JOURNAL_DocInvoice_Type_definitions:Set:Err= "+Err);
                return false;
            }
        }