//UPDATE [vicjos1_Heart2Start].[vicjos1_sysadm].[Co2Db_HtmlPageContent] // SET [IsAktiv] = <IsAktiv, bit,> // ,[IsDeleted] = <IsDeleted, bit,> // ,[PageType] = <PageType, int,> // ,[LocalCultureID] = <LocalCultureID, int,> // ,[Alias] = <Alias, nvarchar(100),> // ,[Title] = <Title, nvarchar(100),> // ,[ShowTitle] = <ShowTitle, bit,> // ,[SubTitle] = <SubTitle, nvarchar(100),> // ,[Description] = <Description, nvarchar(250),> // ,[KeyWords] = <KeyWords, nvarchar(250),> // ,[Content] = <Content, nvarchar(max),> // ,[PublishDate] = <PublishDate, datetime,> // ,[ExpireDate] = <ExpireDate, datetime,> // ,[OprettetAF] = <OprettetAF, nvarchar(50),> // ,[OprettetDen] = <OprettetDen, datetime,> // ,[OprettetIP] = <OprettetIP, nvarchar(15),> // ,[RettetAF] = <RettetAF, nvarchar(50),> // ,[RettetDen] = <RettetDen, datetime,> // ,[RettetIP] = <RettetIP, nvarchar(15),> // WHERE <Search Conditions,,> private static void AddParms(ref DBAccess db, PageContent c) { var with_1 = c; db.AddInt("Status", (System.Int32)with_1.Status); db.AddBoolean("IsActiv", with_1.IsActive); db.AddInt("PageType", with_1.PageType); db.AddInt("LocalCultureID", with_1.LocalCultureID); db.AddNVarChar("Title", with_1.Title, 100); db.AddNVarChar("Alias", with_1.Alias, 100); db.AddBoolean("ShowTitle", with_1.ShowTitle); db.AddNVarChar("SubTitle", with_1.SubTitle, 100); db.AddNVarChar("Description", with_1.Description, 250); db.AddNVarChar("KeyWords", with_1.KeyWords, 250); db.AddNVarChar("Content", with_1.Content, -1); db.AddDateTime("PublishDate", with_1.PublishDate); db.AddDateTime("ExpiredDate", with_1.ExpiredDate); // AddParmsStandard(db, c); }
private static void PopulateDBwithInfositePages(DBAccess db, Infosites po) { var with_1 = po; db.AddBoolean("@Aktiv", with_1.Aktiv); db.AddInt("Site_FK", with_1.Site_FK); db.AddInt("Parent_ID", with_1.Parent_ID); // db.AddInt("Sort", .Sort) db.AddBoolean("@IncludeInMenu", with_1.IncludeInMenu); db.AddBoolean("@Forside", with_1.Forside); db.AddBoolean("@IsDisabled", with_1.IsDisabled); db.AddBoolean("@IsDeleted", with_1.IsDeleted); db.AddNVarChar("PageName", with_1.PageName, 50); db.AddNVarChar("PageTitle", with_1.PageTitle, 50); db.AddNVarChar("Description", with_1.Description, 250); db.AddNVarChar("Keywords", with_1.Keywords, 250); db.AddInt("Template_ID", with_1.Template_ID); db.AddInt("Category_ID", with_1.Category_ID); db.AddInt("LinkType_ID", with_1.LinkType_ID); db.AddNVarChar("LinkUrl", with_1.LinkUrl, 250); db.AddInt("LinkPage_ID", with_1.LinkPage_ID); db.AddNVarChar("LinkTarget", with_1.LinkTarget, 50); db.AddDateTime("OpenDate", with_1.OpenDate); db.AddDateTime("ExpireDate", with_1.ExpireDate); db.AddNVarChar("RettetAf", with_1.CurUser); db.AddNVarChar("RettetIP", with_1.CurIP); }
private static void AddParms(ref DBAccess db, CampaignCompany rec) { var with_1 = rec; db.AddInt("CompanyID", with_1.CompanyID); db.AddInt("CampaignID", with_1.CampaignID); db.AddInt("Status", (System.Int32)with_1.Status); db.AddGuid("ResponsibleID", with_1.ResponsibleID); db.AddNVarChar("ResponsibleName", with_1.ResponsibleName, 50); db.AddNVarChar("ResponsibleEmail", with_1.ResponsibleEmail, 255); db.AddNVarChar("ContactPerson", with_1.ContactPerson, 50); db.AddBoolean("ContactedByPhone", with_1.ContactedByPhone); db.AddBoolean("MeetingHeld", with_1.MeetingHeld); db.AddBoolean("CampaignSale", with_1.CampaignSale); db.AddMoney("CampaignSaleAmount", (double)with_1.CampaignSaleAmount); db.AddBoolean("ExpectedSale", with_1.ExpectedSale); db.AddMoney("ExpectedSaleAmount", (double)with_1.ExpectedSaleAmount); db.AddNVarChar("Notes", with_1.Notes, -1); AddParmsStandard(db, rec); }
public static tilbudHeader GetTilbudByCompany(int CompanyID) { DBAccess db = new DBAccess(); tilbudHeader c = new tilbudHeader(); db.AddInt("CompanyID", CompanyID); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); SqlDataReader dr = (SqlDataReader)(db.ExecuteReader(_SQLSelectByCompany)); if (dr.HasRows) { while (dr.Read()) { Populate(dr, c); } dr.Close(); return(c); } else { dr.Close(); return(c); //Nothing } }
private static void AddParms(ref DBAccess db, Agents c) { var with_1 = c; db.AddGuid("AgentID", with_1.AgentID); db.AddNVarChar("CompanyName", with_1.CompanyName, 50); db.AddNVarChar("Title", with_1.Title, 50); db.AddNVarChar("Name", with_1.Name, 50); db.AddNVarChar("FirstName", with_1.FirstName, 50); db.AddNVarChar("LastName", with_1.LastName, 50); db.AddNVarChar("Address1", with_1.Address1, 50); db.AddNVarChar("Address2", with_1.Address2, 50); db.AddNVarChar("City", with_1.City, 50); db.AddNVarChar("ZipCode", with_1.ZipCode, 50); db.AddNVarChar("State", with_1.State, 50); db.AddInt("CountryID", with_1.CountryID); db.AddNVarChar("Email", with_1.Email, 250); db.AddNVarChar("OrdreEmail", with_1.OrdreEmail, 250); db.AddNVarChar("Phone", with_1.Phone, 16); db.AddNVarChar("CellPhone", with_1.CellPhone, 16); db.AddNVarChar("Fax", with_1.Fax, 16); db.AddInt("Status", (System.Int32)with_1.Status); db.AddNVarChar("UserID", with_1.UserID, 50); db.AddBoolean("ServiceAgent", with_1.ServiceAgent); db.AddNVarChar("AgentSignaturImg", with_1.AgentSignaturImg, 255); AddParmsStandard(db, c); }
public static DataSet GetEyeWash_SearchAll(string Postnr, string SerialNo) { DataSet ds = new DataSet(); DataSet dsTemp = new DataSet(); bool flag = false; DBAccess db = new DBAccess(); //Dim arr As String() = Search.Split(" "c) //For Each s As String In arr db.AddNVarChar("Postnr", Postnr, 50); db.AddNVarChar("SerialNo", SerialNo, 50); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); // EXEC @return_value = [vicjos1_sysadm].[Co2Db_EyeWash_Search] // @SerialNo = '' // , @Postnr = '3400' // , @IsAgent = 0 // , @AgentID = null dsTemp = db.ExecuteDataSet(_SQLSearch); db.Parameters.Clear(); ds.Merge(dsTemp); if (flag == false) { DataColumn[] pk = new DataColumn[2]; pk[0] = ds.Tables[0].Columns["ID"]; ds.Tables[0].PrimaryKey = pk; flag = true; } return(ds); }
public static System.Collections.Generic.List <AED_Trainer> GetAEDTrainerList(int CompanyID) { System.Collections.Generic.List <AED_Trainer> result = new System.Collections.Generic.List <AED_Trainer>(); int ID = -1; DBAccess db = new DBAccess(); db.AddInt("CompanyID", CompanyID); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); SqlDataReader dr = default(SqlDataReader); try { dr = (System.Data.SqlClient.SqlDataReader)(db.ExecuteReader(_SQLSelectIDByCompany)); if (dr.HasRows) { while (dr.Read()) { ID = System.Convert.ToInt32(dr.DBtoInt("ID")); result.Add(AED_Trainer.GetAED(ID)); } } dr.Close(); } catch (Exception ex) { throw (ex); } return(result); }
public static AED_Trainer GetAED(System.Guid Guid) { DBAccess db = new DBAccess(); db.AddGuid("Guid", Guid); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); SqlDataReader dr = (SqlDataReader)(db.ExecuteReader(_SQLSelectByGuid)); if (dr.HasRows) { AED_Trainer c = new AED_Trainer(); while (dr.Read()) { Populate(dr, c); } dr.Close(); return(c); } else { dr.Close(); return(null); } }
public static System.Collections.Generic.List <Aiva> GetAivaList() { System.Collections.Generic.List <Aiva> result = new System.Collections.Generic.List <Aiva>(); int ID = -1; DBAccess db = new DBAccess(); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); SqlDataReader dr = default(SqlDataReader); try { dr = (System.Data.SqlClient.SqlDataReader)(db.ExecuteReader(_SQLSelectAll)); if (dr.HasRows) { while (dr.Read()) { Aiva pc = new Aiva(); Populate(dr, pc); result.Add(pc); } } dr.Close(); } catch (Exception ex) { throw (ex); } return(result); }
public static DataSet GetEyeWashsByCriteriaDS(string fieldnames, string criteria, params SqlParameter[] @params) { DBAccess db = new DBAccess(); string query = ""; query += "SELECT "; if (fieldnames.Trim() != "") { query += fieldnames; } else { query += " * "; } query += " FROM vw_Co2Db_EyeWash "; query += " WHERE ( @IsAgent = 0 OR ( @IsAgent = 1 AND [AgentID] = @AgentID ) )"; if (criteria != "") { query += " AND (" + criteria + ")"; } db.CommandType = CommandType.Text; db.CommandText = query; db.AddRange(@params); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); DataSet ds = db.ExecuteDataSet(); //(_SQLSelectByGuid) return(ds); }
private static void AddParms(ref DBAccess db, Invoiceline c) { var with_1 = c; db.AddInt("InvoiceID", with_1.InvoiceID); db.AddInt("Pos", with_1.Pos); db.AddInt("Status", (System.Int32)with_1.Status); db.AddInt("ItemID", with_1.ItemID); db.AddNVarChar("ItemNo", with_1.ItemNo, 50); db.AddNVarChar("ItemName", with_1.ItemName, 100); db.AddNVarChar("LineText", with_1.LineText, 250); db.AddNVarChar("SerialNo", with_1.SerialNo, 250); db.AddDecimal("ItemPrice", with_1.ItemPrice); db.AddDecimal("Discount", with_1.Discount); db.AddDecimal("SalesPrice", with_1.SalesPrice); db.AddDecimal("Quantity", with_1.Quantity); db.AddDecimal("LineTotal", with_1.LineTotal); db.AddBoolean("VAT", with_1.VAT); db.AddDecimal("Freight", with_1.Freight); db.AddDecimal("ProvisionRate", with_1.ProvisionRate); db.AddDecimal("Provision", with_1.Provision); db.AddDecimal("LineProvision", with_1.LineProvision); AddParmsStandard(db, c); }
public static System.Collections.Generic.List <AED_Battery> GetBatteryList(int AED_FK) { System.Collections.Generic.List <AED_Battery> result = new System.Collections.Generic.List <AED_Battery>(); int ID = -1; DBAccess db = new DBAccess(); db.AddInt("AED_FK", AED_FK); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); SqlDataReader dr = default(SqlDataReader); //Try dr = (System.Data.SqlClient.SqlDataReader)(db.ExecuteReader(_SQLSelectByAED)); if (dr.HasRows) { while (dr.Read()) { ID = System.Convert.ToInt32(dr.DBtoInt("ID")); result.Add(AED_Battery.GetBattery(ID)); } } dr.Close(); //Catch ex As Exception //Throw ex //End Try return(result); }
public static System.Collections.Generic.List <EyeWash> GetListSoonExpired(int CompanyID) { System.Collections.Generic.List <EyeWash> result = new System.Collections.Generic.List <EyeWash>(); int ID = -1; DBAccess db = new DBAccess(); db.AddInt("CompanyID", CompanyID); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); SqlDataReader dr = default(SqlDataReader); //Try dr = (System.Data.SqlClient.SqlDataReader)(db.ExecuteReader(_SQLSelectAllSoonExpired)); if (dr.HasRows) { while (dr.Read()) { ID = System.Convert.ToInt32(dr.DBtoInt("ID")); result.Add(EyeWash.GetEyeWash(ID)); } } dr.Close(); //Catch ex As Exception // Throw ex //End Try return(result); }
public static DataSet Search_EyeWash(string Search) { DataSet ds = new DataSet(); DataSet dsTemp = new DataSet(); bool flag = false; DBAccess db = new DBAccess(); string[] arr = Search.Split(' '); foreach (string s in arr) { db.AddNVarChar("Search", s, 50); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); dsTemp = db.ExecuteDataSet(_SQLSelectBySearch); db.Parameters.Clear(); //If dsTemp.Tables.Count > 0 Then ds.Merge(dsTemp); if (flag == false) { DataColumn[] pk = new DataColumn[2]; pk[0] = ds.Tables[0].Columns["ID"]; ds.Tables[0].PrimaryKey = pk; flag = true; } //End If } return(ds); }
public static List <AED_Service> GetServicesByAED(int AED_FK) { List <AED_Service> result = new List <AED_Service>(); int ID = -1; DBAccess db = new DBAccess(); db.AddInt("AED_FK", AED_FK); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); SqlDataReader dr = default(SqlDataReader); try { dr = (System.Data.SqlClient.SqlDataReader)(db.ExecuteReader(_SQLSelectByAED)); if (dr.HasRows) { while (dr.Read()) { ID = System.Convert.ToInt32(dr.DBtoInt("ID")); result.Add(AED_Service.GetService(ID)); } } dr.Close(); } catch (Exception ex) { throw (ex); } return(result); }
public static System.Collections.Generic.List <FirstAidBag_Service> GetBatteryListExpiredEmail(int CompanyID) { System.Collections.Generic.List <FirstAidBag_Service> result = new System.Collections.Generic.List <FirstAidBag_Service>(); int ID = -1; DBAccess db = new DBAccess(); db.AddInt("CompanyID", CompanyID); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); SqlDataReader dr = default(SqlDataReader); try { dr = (System.Data.SqlClient.SqlDataReader)(db.ExecuteReader(_SQLSelectAllExpiredEmail)); if (dr.HasRows) { while (dr.Read()) { ID = System.Convert.ToInt32(dr.DBtoInt("ID")); result.Add(FirstAidBag_Service.GetService(ID)); } } dr.Close(); } catch (Exception ex) { throw (ex); } return(result); }
private static void AddParms(ref DBAccess db, IncassoSag i) { var with_1 = i; db.AddNVarChar("ContactEmail", with_1.ContactEmail, 250); db.AddNVarChar("ContactName", with_1.ContactName, 50); db.AddInt("Status", (System.Int32)with_1.Status); db.AddInt("CompanyID", with_1.CompanyID); db.AddInt("InvoiceID", with_1.InvoiceID); db.AddDateTime("IncassoDate", with_1.IncassoDate); db.AddNVarChar("Notes", with_1.Notes, -1); db.AddFloat("InvoiceTotal", with_1.InvoiceTotal); db.AddFloat("RenterOpgjortAfKreditor", with_1.RenterOpgjortAfKreditor); db.AddFloat("GebyrOpgjortAfKreditor", with_1.GebyrOpgjortAfKreditor); db.AddFloat("RenteTilskrevetFraPaymentDatetilDD", with_1.RenteTilskrevetFraPaymentDatetilDD); db.AddFloat("GebyrForDenneRykkerskrivelse", with_1.GebyrForDenneRykkerskrivelse); db.AddFloat("IncassoTotal", with_1.IncassoTotal); db.AddFloat("IncassoSalaer", with_1.IncassoSalaer); db.AddFloat("Oversendelsesgebyr", with_1.Oversendelsesgebyr); db.AddBoolean("Paid", with_1.Paid); db.AddDateTime("PaidDate", with_1.PaidDate); AddParmsStandard(db, i); }
private static void AddParms(ref DBAccess db, KursusDag c) { var with_1 = c; db.AddInt("KursusPolicyID", with_1.KursusPolicyID); db.AddDateTime("KursusDato", with_1.KursusDato); db.AddBoolean("Repetionskursus", with_1.Repetionskursus); db.AddInt("Status", (System.Int32)with_1.Status); AddParmsStandard(db, c); }
private static void AddParms(ref DBAccess db, Combobox c) { var with_1 = c; db.AddNVarChar("Field", with_1.Field, 100); db.AddNVarChar("Title", with_1.Title, 250); db.AddNVarChar("Value", with_1.Value, 250); db.AddNVarChar("Contents", with_1.Contents, -1); db.AddBoolean("Hidden", with_1.Hidden); db.AddBoolean("Valid", with_1.Valid); db.AddInt("Idx", with_1.Idx); db.AddNVarChar("ApplicationName", Roles.ApplicationName, 256); //db.AddDateTime("Dato", .Dato) //db.AddDecimal("Tal", .Tal) //db.AddInt("FieldType", .FieldType) AddParmsStandard(db, c); }
public static DataSet GetAllAED() { DBAccess db = new DBAccess(); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); DataSet ds = db.ExecuteDataSet(_SQLSelectAll); return(ds); }
private static void AddParms(ref DBAccess db, Postnummer c) { var with_1 = c; db.AddNVarChar("Postnr", with_1.Postnr, 10); db.AddNVarChar("Bynavn", with_1.Bynavn, 50); db.AddNVarChar("Gade", with_1.Gade, 50); db.AddNVarChar("Firma", with_1.Firma, 50); db.AddInt("Land", with_1.LandID); db.AddBoolean("Provins", bool.Parse(with_1.Provins)); AddParmsStandard(db, c); }
public static DataSet GetAivaByCompanyDS(int CompanyID) { DBAccess db = new DBAccess(); db.AddInt("CompanyID", CompanyID); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); DataSet ds = db.ExecuteDataSet(_SQLSelectCompanyID); return(ds); }
public static DataSet GetAllEyeWash() { DBAccess db = new DBAccess(); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); //db.Parameters.Add(New SqlParameter("@sUserName", username)) DataSet ds = db.ExecuteDataSet(_SQLSelectAll); return(ds); }
public static DataSet GetKorrespondanceSet(int CompanyID, int MedarbejderID, bool Ekstern) { DBAccess db = new DBAccess(); //db.Parameters.Add(New SqlParameter("@CompanyID", ToInt(CompanyID))) //db.Parameters.Add(New SqlParameter("@MedarbejderID", ToInt(MedarbejderID))) db.AddInt("CompanyID", CompanyID); db.AddInt("MedarbejderID", MedarbejderID); db.AddBoolean("Ekstern", Ekstern); DataSet ds = db.ExecuteDataSet("Co2Db_Korrespondance_SelectAll"); return(ds); }
public static DataSet GetBottleByEYE(int EYE_FK) { DBAccess db = new DBAccess(); db.AddInt("EYE_FK", EYE_FK); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); DataSet ds = db.ExecuteDataSet(_SQLSelectByEYE); return(ds); }
public static DataSet GetBatteryByAED(int AED_FK) { DBAccess db = new DBAccess(); db.AddInt("AED_FK", AED_FK); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); DataSet ds = db.ExecuteDataSet(_SQLSelectByAED); return(ds); }
public static int GetEyeWashcountByCompany(int CompanyID) { int res = 0; DBAccess db = new DBAccess(); db.AddInt("CompanyID", CompanyID); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); res = Funktioner.ToInt(db.ExecuteScalar(_SQLCountByCompany)); return(res); }
public static DataSet GetEyeWashbyGUID_DS(Guid GuID) { DBAccess db = new DBAccess(); db.AddGuid("Guid", GuID); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); DataSet ds = db.ExecuteDataSet(_SQLSelectByGuid); return(ds); }
public static DataSet GetAllTilbud(TilbudStatusEnum status) { DBAccess db = new DBAccess(); db.AddInt("status", System.Convert.ToInt32(status)); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); DataSet ds = db.ExecuteDataSet(_SQLSelectByStatus); return(ds); }
public static DataSet GetEyeWashbyBilagStatus(int CompanyID, int BilagStatus) { DBAccess db = new DBAccess(); db.AddInt("CompanyID", CompanyID); db.AddInt("BilagStatus", BilagStatus); db.AddBoolean("IsAgent", AdgangsKontrol.IsAgent()); db.AddGuid("AgentID", CurrentUserID); DataSet ds = db.ExecuteDataSet(_SQLSelectByBilagStatus); return(ds); }