//logování přihlášení musí být zde, protože se logují i neńsspěšné pokusy o přihlášení a nešlo by to řešit v j03UserBL public void Write2AccessLog(BO.j90LoginAccessLog c) //zápis úspěšných přihlášení i neúspěšných pokusů o přihlášení { DL.DbHandler db = new DL.DbHandler(this.App.ConnectString, this.CurrentUser, this.App.LogFolder); string s = "INSERT INTO j90LoginAccessLog(j03ID,j90Date,j90BrowserUserAgent,j90BrowserFamily,j90BrowserOS,j90BrowserDeviceType,j90BrowserDeviceFamily,j90BrowserAvailWidth,j90BrowserAvailHeight,j90BrowserInnerWidth,j90BrowserInnerHeight,j90LoginMessage,j90LoginName,j90CookieExpiresInHours,j90LocationHost)"; s += " VALUES(@j03id,GETDATE(),@useragent,@browser,@os,@devicetype,@devicefamily,@aw,@ah,@iw,@ih,@mes,@loginname,@cookieexpire,@host)"; db.RunSql(s, new { j03id = BO.BAS.TestIntAsDbKey(c.j03ID), useragent = c.j90BrowserUserAgent, browser = c.j90BrowserFamily, os = c.j90BrowserOS, devicetype = c.j90BrowserDeviceType, devicefamily = c.j90BrowserDeviceFamily, aw = c.j90BrowserAvailWidth, ah = c.j90BrowserAvailHeight, iw = c.j90BrowserInnerWidth, ih = c.j90BrowserInnerHeight, mes = c.j90LoginMessage, loginname = c.j90LoginName, cookieexpire = c.j90CookieExpiresInHours, host = c.j90LocationHost }); }
public void InhaleUserByLogin(string strLogin) { DL.DbHandler db = new DL.DbHandler(this.App.ConnectString, this.CurrentUser, this.App.LogFolder); this.CurrentUser = db.Load <BO.RunningUser>("SELECT a.j03ID as pid,a.j02ID,a.j04ID,j02.p28ID,p28.p28Name,a.j03Login,j02.j02FirstName+' '+j02.j02LastName as FullName,a.j03FontStyleFlag,a.j03EnvironmentFlag,a.j03GridSelectionModeFlag,a.j03IsMustChangePassword,j04.j04PermissionValue,null as ErrorMessage,CASE WHEN GETDATE() BETWEEN a.ValidFrom AND a.ValidUntil THEN 0 ELSE 1 end as isclosed,a.j03LiveChatTimestamp,j02.j02Email,a.j03PingTimestamp,j04.j04IsClientRole FROM j03User a INNER JOIN j02Person j02 ON a.j02ID=j02.j02ID INNER JOIN j04UserRole j04 ON a.j04ID=j04.j04ID INNER JOIN p28Company p28 ON j02.p28ID=p28.p28ID WHERE a.j03Login LIKE @login", new { login = strLogin }); if (this.CurrentUser.j03Login.Contains("marktime") == false) { if (this.CurrentUser.j04IsClientRole) { this.CurrentUser.j03EnvironmentFlag = 2; //natvrdo CLIENT prostředí } else { this.CurrentUser.j03EnvironmentFlag = 1; //natvrdo MASTER prostředí } } }
private void SetupPallete() { BO.TheGridColumn onecol; //p28Company = klienti AF("p28Company", "p28Name", "Klient", 1, null, "string", false, true); AF("p28Company", "p28Code", "Kód"); AF("p28Company", "p28ShortName", "Zkrácený název"); AF("p28Company", "p28Street1", "Ulice", 1); AF("p28Company", "p28City1", "Město", 1); AF("p28Company", "p28PostCode1", "PSČ"); AF("p28Company", "p28Country1", "Stát"); AF("p28Company", "p28Street2", "Ulice 2"); AF("p28Company", "p28City2", "Město 2"); AF("p28Company", "p28PostCode2", "PSČ 2"); AF("p28Company", "p28Country2", "Stát 2"); AF("p28Company", "p28RegID", "IČ", 1); AF("p28Company", "p28VatID", "DIČ"); AF("p28Company", "p28CloudID", "CLOUD ID"); AF("p28Company", "RecordOwner", "Vlastník záznamu", 0, "dbo.j02_show_as_owner(a.j02ID_Owner)"); AppendTimestamp("p28Company"); //p10 = master produkty AF("p10MasterProduct", "p10Name", "Master produkt", 1, null, "string", false, true); AF("p10MasterProduct", "p10Code", "Kód produktu", 1); AF("p10MasterProduct", "p10TypeFlag", "Typ produktu", 1, "case a.p10TypeFlag when 1 then 'Zboží' when 2 then 'Polotovar' when 3 then 'Výrobek' when 4 then 'Surovina' when 5 then 'Obal' when 6 then 'Etiketa' end"); AF("p10MasterProduct", "p10Memo", "Podrobný popis"); AF("p10MasterProduct", "p10SwLicenseFlag", "SW licence", 0, "case when a.p10SwLicenseFlag>0 then 'SW licence '+convert(varchar(10),a.p10SwLicenseFlag) else null end"); AF("p10MasterProduct", "p10RecalcUnit2Kg", "Přepočet MJ na VJ", 0, null, "num3"); AF("p10MasterProduct", "p10PackagingCode", "Kód obalu"); AF("p10MasterProduct", "p10Davka", "Dávka", 0, null, "num0"); AF("p10MasterProduct", "p10DavkaMin", "Dávka Min.", 0, null, "num0"); AF("p10MasterProduct", "p10DavkaMax", "Dávka Max.", 0, null, "num0"); AF("p10MasterProduct", "p10SalesPerMonth", "Měsíční prodej", 0, null, "num0"); AF("p10MasterProduct", "p10SalesPerWeeek", "Týdenní prodej", 0, "a.p10SalesPerMonth/4", "num0"); AF("p10MasterProduct", "p10UnitsPerPalette", "Paleta ks", 0, null, "num0"); AF("p10MasterProduct", "p21Names", "Zařazeno do licencí", 0, "dbo.p10_license_inline(a.p10ID)"); AppendTimestamp("p10MasterProduct"); //p21 = licence AF("p21License", "p21Name", "Licence", 1, null, "string", false, true); AF("p21License", "p21Code", "Kód", 1); AF("p21License", "p21PermissionFlag", "Typ licence", 1, "case a.p21PermissionFlag when 1 then 'Standard' when 2 then 'Extend' when 3 then 'Full' else '???' end", "string", false, true); AF("p21License", "p21Price", "Cena", 0, null, "num", true); AppendTimestamp("p21License"); //p26 = skupina zařízení AF("p26Msz", "p26Name", "Skupina zařízení", 1, null, "string", false, true); AF("p26Msz", "p26Code", "Kód", 1); AF("p26Msz", "p26Memo", "Podrobný popis"); AppendTimestamp("p26Msz"); //p27 = zařízení AF("p27MszUnit", "p27Name", "Zařízení", 1, null, "string", false, true); AF("p27MszUnit", "p27Code", "Kód zařízení", 2); AF("p27MszUnit", "p27Capacity", "Kapacita", 1, null, "num0", true); AppendTimestamp("p27MszUnit"); //j02 = osoby AF("j02Person", "fullname_desc", "Příjmení+Jméno", 1, "a.j02LastName+' '+a.j02FirstName"); AF("j02Person", "fullname_asc", "Jméno+Příjmení", 0, "a.j02FirstName+' '+a.j02LastName"); AF("j02Person", "j02Email", "E-mail", 1); AF("j02Person", "j02FirstName", "Jméno"); AF("j02Person", "j02LastName", "Příjmení"); AF("j02Person", "j02TitleBeforeName", "Titul před"); AF("j02Person", "j02TitleAfterName", "Titul za"); AF("j02Person", "j02Tel1", "TEL1"); AF("j02Person", "j02Tel2", "TEL2"); AF("j02Person", "fullname_plus_client", "Jméno+Firma", 0, "a.j02FirstName+' '+a.j02LastName+isnull(' ['+relname._company.p28Name+']','')"); AppendTimestamp("j02Person"); //j03 = uživatelé AF("j03User", "j03Login", "Login", 1, null, "string", false, true); AF("j03User", "j04Name", "Aplikační role", 1, "j03_j04.j04Name", "string", false, true); AF("j03User", "j03PingTimestamp", "Last ping", 0, "a.j03PingTimestamp", "datetime"); //p13 = master receptury AF("p13MasterTpv", "p13Name", "Název receptury", 1, null, "string", false, true); AF("p13MasterTpv", "p13Code", "Číslo receptury", 1, null, "string", false, true); AF("p13MasterTpv", "p13Memo", "Podrobný popis"); AppendTimestamp("p13MasterTpv"); //o23 = dokumenty AF("o23Doc", "o23Name", "Název", 1); AF("o23Doc", "RecordPidAlias", "Vazba", 1, "dbo.getRecordAlias(a.o23Entity,a.o23RecordPid)"); AF("o23Doc", "EntityAlias", "Druh vazby", 1, "dbo.getEntityAlias(a.o23Entity)"); AF("o23Doc", "o23Memo", "Podrobný popis"); AF("o23Doc", "o23Date", "Datum dokumentu", 0, null, "date"); AF("o23Doc", "RecordOwner", "Vlastník záznamu", 0, "dbo.j02_show_as_owner(a.j02ID_Owner)"); AppendTimestamp("o23Doc"); //b02 = workflow stavy AF("b02Status", "b02Name", "Stav", 1, null, "string", false, true); AF("b02Status", "b02Color", "🚩", 1, "case when a.b02Color IS NOT NULL then '<div style='+char(34)+'background-color:'+a.b02Color+';'+char(34)+'> </div>' end"); AF("b02Status", "b02Code", "Kód", 1); AF("b02Status", "EntityAlias", "Vazba", 1, "dbo.getEntityAlias(a.b02Entity)"); AF("b02Status", "b02Ordinary", "Pořadí", 0, null, "num0"); AF("b02Status", "b02StartFlag", "Start", 0, "case when a.b02StartFlag=1 then 'ANO' end"); AF("b02Status", "b02MoveFlag", "Pohyb", 0, "case a.b02MoveFlag when 1 then 'Uživatel' when 2 then 'Systém' end"); AF("b02Status", "b02Memo", "Poznámka"); //b03 = skupina stavů AF("b03StatusGroup", "b03Name", "Skupina stavů", 1, null, "string", false, true); AppendTimestamp("b03StatusGroup"); //o51 = položka kategorie AF("o51Tag", "o51Name", "Položka kategorie", 1, null, "string", false, true); AF("o51Tag", "o51IsColor", "Má barvu", 2, null, "bool"); AF("o51Tag", "o51ForeColor", "Barva písma", 2, "'<div style=\"background-color:'+a.o51ForeColor+';\">písmo</div>'"); AF("o51Tag", "o51BackColor", "Barva pozadí", 2, "'<div style=\"background-color:'+a.o51BackColor+';\">pozadí</div>'"); AF("o51Tag", "o51Ordinary", "Pořadí", 0, null, "num0"); //o53 = kategorie (skupiny položek kategorie) AF("o53TagGroup", "o53Name", "Název kategorie", 1, null, "string", false, true); AF("o53TagGroup", "o53IsMultiSelect", "Multi-Select", 0, null, "bool"); AF("o53TagGroup", "o53Entities", "Vazby", 1, "dbo.getEntityAlias_Multi(a.o53Entities)"); AF("o53TagGroup", "o53Ordinary", "Pořadí", 0, null, "num0"); AF("o54TagBindingInline", "o54InlineHtml", "Kategorie", 1, null, "string", false, true); AF("o54TagBindingInline", "o54InlineText", "Kategorie (pouze text)", 1, null, "string", false, true); //zatím provizorně v rámci SINGLETON režimu této třídy: DL.DbHandler db = new DL.DbHandler(_app.ConnectString, new BO.RunningUser(), _app.LogFolder); var dt = db.GetDataTable("select * from o53TagGroup WHERE o53Field IS NOT NULL AND o53Entities IS NOT NULL ORDER BY o53Ordinary"); foreach (System.Data.DataRow dbrow in dt.Rows) { onecol = AF("o54TagBindingInline", dbrow["o53Field"].ToString(), dbrow["o53Name"].ToString(), 0, null, "string", false, true); onecol.VisibleWithinEntityOnly = dbrow["o53Entities"].ToString(); } //p19=materiál AF("p19Material", "p19Code", "Kód suroviny", 1, null, "string", false, true); AF("p19Material", "p19Name", "Název suroviny", 1, null, "string", false, true); AF("p19Material", "p19TypeFlag", "Typ suroviny", 1, "case a.p19TypeFlag when 1 then 'Zboží' when 2 then 'Polotovar' when 3 then 'Výrobek' when 4 then 'Surovina' when 5 then 'Obal' when 6 then 'Etiketa' end", "string", false, true); AF("p19Material", "p19Supplier", "Dodavatel", 2); AF("p19Material", "p19Intrastat", "Intrastat", 2); AF("p19Material", "p19NameAlias", "NAME-ALIAS"); AF("p19Material", "p19ITSINC", "ITSINC"); AF("p19Material", "p19ITSCAS", "ITSCAS"); AF("p19Material", "p19ITSEINECS", "ITSEINECS"); AF("p19Material", "p19StockActual", "Stav na skladě", 0, null, "num"); AF("p19Material", "p19StockReserve", "Rezervováno na skladě", 0, null, "num"); AF("p19Material", "p19StockDate", "Sklad k", 0, null, "datetime"); AF("p19Material", "p19Lang1", "Jazyk1"); AF("p19Material", "p19Lang2", "Jazyk2"); AF("p19Material", "p19Lang3", "Jazyk3"); AF("p19Material", "p19Lang4", "Jazyk4"); //j04=aplikační role AF("j04UserRole", "j04Name", "Název role", 1); AF("j04UserRole", "j04IsClientRole", "Klientská role", 2, null, "bool"); //p25 = typy zařízení AF("p25MszType", "p25Name", "Typ zařízení", 1, null, "string", false, true); AF("p25MszType", "p25Code", "Kód", 2); //p31 = kapacitní fondy AF("p31CapacityFond", "p31Name", "Časový fond", 1, null, "string", false, true); AF("p31CapacityFond", "p31DayHour1", "První hodina", 0, null, "num0"); AF("p31CapacityFond", "p31DayHour2", "Poslední hodina", 0, null, "num0"); AF("p31CapacityFond", "RecordOwner", "Vlastník záznamu", 0, "dbo.j02_show_as_owner(a.j02ID_Owner)"); AppendTimestamp("p31CapacityFond"); //p14 = technologické operace master receptury AF("p14MasterOper", "p14RowNum", "Číslo řádku", 1, null, "num0"); onecol = AF("p14MasterOper", "p14OperNum", "Číslo Oper", 2, "RIGHT('000'+convert(varchar(10),a.p14OperNum),3)"); onecol.FixedWidth = 70; AF("p14MasterOper", "p14OperParam", "Parameter", 2, null, "num1"); AF("p14MasterOper", "p14UnitsCount", "Množství na 1VJ", 2, null, "num7", true); AF("p14MasterOper", "p14DurationPreOper", "Před Oper. Čas", 2, null, "num0", true); AF("p14MasterOper", "p14DurationOper", "Oper. Čas", 2, null, "num4", true); AF("p14MasterOper", "p14DurOperMinutes", "Počet minut OČ", 0, null, "num", false, true); AF("p14MasterOper", "p14DurOperUnits", "Počet jednotek OČ", 0, null, "num", false, true); AF("p14MasterOper", "p14DurationPostOper", "Po Oper. Čas", 2, null, "num0", true); AF("p14MasterOper", "TotalDuration", "Celk.Čas", 2, "isnull(a.p14DurationPreOper,0)+isnull(a.p14DurationOper,0)+isnull(a.p14DurationPostOper,0)", "num", true); AppendTimestamp("p14MasterOper"); //p11 = klientský produkt AF("p11ClientProduct", "p11Code", "Kód produktu", 1, null, "string", false, true); AF("p11ClientProduct", "p11Name", "Produkt", 1, null, "string", false, true); AF("p11ClientProduct", "p11Memo", "Podrobný popis"); AF("p11ClientProduct", "p11UnitPrice", "Jedn.cena", 0, null, "num"); AF("p11ClientProduct", "p11TypeFlag", "Typ produktu", 1, "case a.p11TypeFlag when 1 then 'Zboží' when 2 then 'Polotovar' when 3 then 'Výrobek' when 4 then 'Surovina' when 5 then 'Obal' when 6 then 'Etiketa' end"); AF("p11ClientProduct", "p11RecalcUnit2Kg", "Přepočet MJ na VJ", 0, null, "num3"); AF("p11ClientProduct", "p11PackagingCode", "Kód obalu"); AF("p11ClientProduct", "p11Davka", "Dávka", 0, null, "num0"); AF("p11ClientProduct", "p11DavkaMin", "Dávka Min.", 0, null, "num0"); AF("p11ClientProduct", "p11DavkaMax", "Dávka Max.", 0, null, "num0"); AF("p11ClientProduct", "p11SalesPerMonth", "Měsíční prodej", 0, null, "num0"); AF("p11ClientProduct", "p11SalesPerWeeek", "Týdenní prodej", 0, "a.p11SalesPerMonth/4", "num0"); AF("p11ClientProduct", "p11ZasobaTydny", "Zásoba (týdny)", 0, "p11_z03.ZasobaTydny", "num0"); AF("p11ClientProduct", "p11ZasobaTydnyPolotovar", "Zásoba (týdny) Polotovar", 0, "p11_z04.ZasobaTydny", "num0"); AF("p11ClientProduct", "p11ZbyvaNaplanovat", "Zbývá naplánovat", 0, "p11_z03.ZbyvaNaplanovat", "num0"); AF("p11ClientProduct", "p11ZbyvaNaplanovatPolotovar", "Zbývá naplánovat Polotovar", 0, "p11_z04.ZbyvaNaplanovat", "num0"); AF("p11ClientProduct", "p11VyrobniPotreba", "Výrobní potřeba", 0, "p11_z03.VyrobniPotreba", "num0"); AF("p11ClientProduct", "p11VyrobniPotrebaPolotovar", "Výrobní potřeba Polotovar", 0, "p11_z04.VyrobniPotrebaPolotovar", "num0"); AF("p11ClientProduct", "p11DoporuceneVyrMnozstvi", "Dop.výr. množství", 0, "p11_z03.DopVyrMnozstvi", "num0"); AF("p11ClientProduct", "p11DoporuceneVyrMnozstviPolotovar", "Dop.výr. množství Polotovar", 0, "p11_z04.DopVyrMnozstviPolotovar", "num0"); AF("p11ClientProduct", "p11UnitsPerPalette", "Paleta ks", 0, null, "num0"); AppendTimestamp("p11ClientProduct"); AF("z03_produkty_plan_vyroby", "PocetVZ", "Počet VZ", 1, null, "num0", true, true); AF("z03_produkty_plan_vyroby", "PlanMnozstvi", "Σ plánováno", 1, null, "num", true, true); AF("z03_produkty_plan_vyroby", "PlanMnozstvi_krome_WS50az90", "Σ plánováno wsz(50-90)", 0, null, "num", true, true); //AF("z03_produkty_plan_vyroby", "PlanMnozstvi0", "Σ plánováno bez vlivu období", 0, null, "num", true, true); //AF("z03_produkty_plan_vyroby", "MinStart", "Start první VZ", 1, null, "datetime"); //AF("z03_produkty_plan_vyroby", "MaxStart", "Start poslední VZ", 1, null, "datetime"); //AF("z03_produkty_plan_vyroby", "p41CodeFirst", "Kód první VZ"); //AF("p11ClientProduct", "PlanMnozstvi_Polotovar", "Σ plánováno Polotovar wsz(50-90)", 0, null, "num", true, true); //AF("z03_produkty_plan_vyroby", "ObjednaneMnozstvi", "Σ objednáno", 1, null, "num", true, true); AF("z03_produkty_plan_vyroby", "ObjednaneMnozstvi_krome_WS10_900", "Σ objednáno wso(-10,-900)", 1, null, "num", true, true); AF("z04_produkty_plan_vyroby_polotovar", "PocetVZ", "Počet VZ Polotovar", 1, null, "num0", true, true); AF("z04_produkty_plan_vyroby_polotovar", "PlanMnozstvi", "Σ plánováno Polotovar", 1, null, "num", true, true); AF("z04_produkty_plan_vyroby_polotovar", "PlanMnozstvi_krome_WS50az90", "Σ plánováno wsz(50-90) Polotovar", 0, null, "num", true, true); AF("z04_produkty_plan_vyroby_polotovar", "ObjednaneMnozstvi_krome_WS10_900", "Σ objednáno wso(-10,-900) Polotovar", 1, null, "num", true, true); //AF("z03_produkty_plan_vyroby", "PocetP51", "Počet obj.", 1, null, "num", true, true); //AF("z03_produkty_plan_vyroby", "PocetP52", "Počet položek obj.", 1, null, "num", true, true); //p12 = klientské receptury AF("p12ClientTpv", "p12Name", "Název receptury", 1, null, "string", false, true); AF("p12ClientTpv", "p12Code", "Číslo receptury", 1, null, "string", false, true); AF("p12ClientTpv", "p12Memo", "Podrobný popis"); AppendTimestamp("p12ClientTpv"); //p20 = měrné jednotky AF("p20Unit", "p20Code", "MJ", 1, null, "string", false, false); AF("p20Unit", "p20Name", "Měrná jednotka", 1, null, "string", false, true); AppendTimestamp("p20Unit"); //p15 = technologické operace klientské receptury AF("p15ClientOper", "p15RowNum", "Číslo řádku", 1, null, "num0"); onecol = AF("p15ClientOper", "p15OperNum", "Číslo Oper", 2, "RIGHT('000'+convert(varchar(10),a.p15OperNum),3)"); onecol.FixedWidth = 70; AF("p15ClientOper", "p15OperParam", "Parametr", 2, null, "num1"); AF("p15ClientOper", "p15UnitsCount", "Množství na 1VJ", 2, null, "num7", true); AF("p15ClientOper", "p15DurationPreOper", "Před Oper. Čas", 2, null, "num0", true); AF("p15ClientOper", "p15DurationOper", "Oper. Čas", 2, null, "num4", true); AF("p15ClientOper", "p15DurOperMinutes", "Počet minut OČ", 0, null, "num", false, true); AF("p15ClientOper", "p15DurOperUnits", "Počet jednotek OČ", 0, null, "num", false, true); AF("p15ClientOper", "p15DurationPostOper", "Po Oper. Čas", 2, null, "num0", true); AF("p15ClientOper", "TotalDuration", "Celk.Čas", 2, "isnull(a.p15DurationPreOper,0)+isnull(a.p15DurationOper,0)+isnull(a.p15DurationPostOper,0)", "num", true); AppendTimestamp("p15ClientOper"); //p41 = zakázky AF("p41Task", "p41Code", "Kód", 1); AF("p41Task", "p41Name", "Název", 1); AF("p41Task", "p41PlanStart", "Plán zahájení", 2, null, "datetime"); AF("p41Task", "p41PlanEnd", "Plán dokončení", 2, null, "datetime"); AF("p41Task", "p41PlanUnitsCount", "Plán (VJ)", 2, null, "num", true); AF("p41Task", "p41Duration", "Plán trvá (min)", 2, null, "num", true); AF("p41Task", "DurationHours", "Plán trvá (hod)", 0, "a.p41Duration/60", "num", true); AF("p41Task", "p41DurationPoPre", "Plán PO-PRE trvá (min)", 2, null, "num", true); AF("p41Task", "p41DurationPoPost", "Plán PO-POST trvá (min)", 2, null, "num", true); AF("p41Task", "p41StockCode", "Kód skladu", 0); AF("p41Task", "p41ActualRowNum", "Aktuální RowNum", 0, null, "num0"); AF("p41Task", "p41RealStart", "Reálné zahájení", 0, null, "datetime"); AF("p41Task", "p41RealEnd", "Reálné dokončení", 0, null, "datetime"); AF("p41Task", "p41RealUnitsCount", "Skutečné množství", 0, null, "num"); AF("p41Task", "p41Memo", "Podrobný popis"); AF("p41Task", "RecordOwner", "Vlastník záznamu", 0, "dbo.j02_show_as_owner(a.j02ID_Owner)"); AppendTimestamp("p41Task"); //p44 = plán výrobních operací AF("p44TaskOperPlan", "p44RowNum", "Číslo řádku", 1, null, "num0"); onecol = AF("p44TaskOperPlan", "p44OperNum", "Číslo Oper", 2, "RIGHT('000'+convert(varchar(10),a.p44OperNum),3)"); onecol.FixedWidth = 70; AF("p44TaskOperPlan", "p44StartRounded", "Start", 1, "DATEADD(minute, DATEDIFF(minute, 0,DATEADD(second, 30 - DATEPART(second, a.p44Start + '00:00:30.000'),a.p44Start)), 0)", "time"); AF("p44TaskOperPlan", "p44EndRounded", "Stop", 1, "DATEADD(minute, DATEDIFF(minute, 0,DATEADD(second, 30 - DATEPART(second, a.p44End + '00:00:30.000'),a.p44End)), 0)", "time"); AF("p44TaskOperPlan", "p44StartTime", "Start HH:mm", 0, "a.p44Start", "time"); AF("p44TaskOperPlan", "p44EndTime", "Stop HH:mm", 0, "a.p44End", "time"); AF("p44TaskOperPlan", "p44Start", "Start (D+HM)", 0, null, "datetime"); AF("p44TaskOperPlan", "p44End", "Stop (D+HM)", 0, null, "datetime"); AF("p44TaskOperPlan", "p44Start", "Start (D+HMS)", 0, null, "datetimesec"); AF("p44TaskOperPlan", "p44End", "Stop (D+HMS)", 0, null, "datetimesec"); AF("p44TaskOperPlan", "p44TotalDurationOperMin", "Celk. Čas", 2, null, "num", true); AF("p44TaskOperPlan", "p44OperParam", "Parametr", 2, null, "num1"); AF("p44TaskOperPlan", "p44MaterialUnitsCount", "Množství ∑", 2, null, "num7", true); AF("p44TaskOperPlan", "p44DurationPreOper", "Před Oper. Čas", 2, null, "num0", true); AF("p44TaskOperPlan", "p44DurationOper", "Oper. Čas", 2, null, "num4", true); AF("p44TaskOperPlan", "p44DurationPostOper", "Po Oper. Čas", 2, null, "num0", true); //p45 = skutečná výroba AF("p45TaskOperReal", "p45RowNum", "Číslo řádku", 1, null, "num0"); onecol = AF("p45TaskOperReal", "p45OperNum", "Číslo Oper", 2, "RIGHT('000'+convert(varchar(10),a.p45OperNum),3)"); onecol.FixedWidth = 70; AF("p45TaskOperReal", "p45StartRounded", "Start", 1, "DATEADD(minute, DATEDIFF(minute, 0,DATEADD(second, 30 - DATEPART(second, a.p45Start + '00:00:30.000'),a.p45Start)), 0)", "time"); AF("p45TaskOperReal", "p45EndRounded", "Stop", 1, "DATEADD(minute, DATEDIFF(minute, 0,DATEADD(second, 30 - DATEPART(second, a.p45End + '00:00:30.000'),a.p45End)), 0)", "time"); AF("p45TaskOperReal", "p45StartTime", "Start HH:mm", 0, "a.p45Start", "time"); AF("p45TaskOperReal", "p45EndTime", "Stop HH:mm", 0, "a.p45End", "time"); AF("p45TaskOperReal", "p45Start", "Start (D+HM)", 0, null, "datetime"); AF("p45TaskOperReal", "p45End", "Stop (D+HM)", 0, null, "datetime"); AF("p45TaskOperReal", "p45Start", "Start (D+HMS)", 0, null, "datetimesec"); AF("p45TaskOperReal", "p45End", "Stop (D+HMS)", 0, null, "datetimesec"); AF("p45TaskOperReal", "p45TotalDurationOperMin", "Celk. Čas", 2, null, "num", true); AF("p45TaskOperReal", "p45OperParam", "Parametr", 2, null, "num1"); AF("p45TaskOperReal", "p45MaterialBatch", "Šarže suroviny"); AF("p45TaskOperReal", "p45MaterialUnitsCount", "Množství ∑", 2, null, "num7", true); AF("p45TaskOperReal", "p45Operator", "Operátor", 2); //p51 = objednávky AF("p51Order", "p51Code", "Kód objednávky", 1, null, "string", false, true); AF("p51Order", "p51Name", "Název", 1); AF("p51Order", "p51Date", "Datum přijetí", 2, null, "datetime", false, true); AF("p51Order", "p51DateDelivery", "Termín dodání", 2, null, "datetime", false, true); AF("p51Order", "p51DateDeliveryConfirmed", "Potvrzený termín dodání", 2, null, "datetime", false, true); //AF("p51Order", "p51Order_Kg", "Objednáno kg", 1, null, "num", true); //AF("p51Order", "p51Task_Kg", "Již naplánováno kg", 0, null, "num", true); //AF("p51Order", "ZbyvaNaplanovat", "Zbývá naplánovat kg ", 1, "a.p51Order_Kg - isnull(a.p51Task_Kg,0)", "num", true); AF("p51Order", "p51CodeByClient", "Kód podle klienta", 0); AF("p51Order", "p51IsDraft", "Draft", 0, null, "bool"); AF("p51Order", "p51Memo", "Podrobný popis"); AF("p51Order", "RecordOwner", "Vlastník záznamu", 0, "dbo.j02_show_as_owner(a.j02ID_Owner)"); AppendTimestamp("p51Order"); //p52 = položky objednávky AF("p52OrderItem", "p52Code", "Kód", 1); AF("p52OrderItem", "p52UnitsCount", "Množství", 1, null, "num"); onecol = AF("p52OrderItem", "Recalc2Kg", "Přepočet na VJ", 0, "a.p52UnitsCount*p11RecalcUnit2Kg", "num", true); onecol.RelName = "p52_p11"; AF("p52OrderItem", "p52Task_UnitsCount", "Již naplánováno", 0, null, "num"); AF("p52OrderItem", "ZbyvaNaplanovatUnits", "Zbývá naplánovat", 1, "a.p52UnitsCount-isnull(a.p52Task_UnitsCount,0)", "num"); AF("p52OrderItem", "p52Task_Kg", "Již naplánováno VJ", 0, null, "num", true); AF("p52OrderItem", "ZbyvaNaplanovatKg", "Zbývá naplánovat VJ", 0, "a.p52UnitsCount*p11RecalcUnit2Kg-isnull(a.p52Task_Kg,0)", "num", true); AF("p52OrderItem", "p52DateNeeded", "Datum potřeby", 0, null, "datetime", false, true); AF("p52OrderItem", "RecordOwner", "Vlastník záznamu", 0, "dbo.j02_show_as_owner(a.j02ID_Owner)"); AppendTimestamp("p52OrderItem"); //p18 = Kódy technologických operací //AF("p18OperCode", "p18Code", "Kód operace", 1); onecol = AF("p18OperCode", "p18Code", "Kód operace", 1, null, "string", false, true); onecol.FixedWidth = 70; AF("p18OperCode", "p18Name", "Název operace", 1, null, "string", false, true); AF("p18OperCode", "p18Flag", "Atribut pro plánování", 2, "case a.p18Flag when 1 then 'TO' when 2 then 'PO-PRE' when 3 then 'PO-POST' when 4 then 'PO-COOP' end", "string", false, true); AF("p18OperCode", "p18Memo", "Poznámka"); //AF("p18OperCode", "p25Name", "Typ zařízení", 2, "p25.p25Name"); //AF("p18OperCode", "p19Name", "Materiál", 2, "p19.p19Name"); AF("p18OperCode", "p18UnitsCount", "Množství", 2, null, "num7"); AF("p18OperCode", "p18DurationPreOper", "Před Oper. Čas", 2, null, "num0"); AF("p18OperCode", "p18DurationOper", "Oper. Čas", 2, null, "num4"); AF("p18OperCode", "p18DurOperMinutes", "Počet minut OČ", 0, null, "num", false, true); AF("p18OperCode", "p18DurOperUnits", "Počet jednotek OČ", 0, null, "num", false, true); AF("p18OperCode", "p18DurationPostOper", "Po Oper. Čas", 2, null, "num0"); AF("p18OperCode", "p18OperParam", "Parametr", 2, null, "num1"); AF("p18OperCode", "p18IsRepeatable", "Opakovatelná operace", 0, null, "bool", false, true); AF("p18OperCode", "p18IsManualAmount", "Ruční zadání množství", 0, null, "bool", false, true); AF("p18OperCode", "p18DurOperUnits", "Počet jednotek pro Oper-čas", 0, null, "num"); AF("p18OperCode", "p18DurOperMinutes", "Počet minut pro Oper-čas", 0, null, "num"); AF("p18OperCode", "p18Lang1", "Jazyk1"); AF("p18OperCode", "p18Lang2", "Jazyk2"); AF("p18OperCode", "p18Lang3", "Jazyk3"); AF("p18OperCode", "p18Lang4", "Jazyk4"); AppendTimestamp("p18OperCode"); //j90 = access log uživatelů AF("j90LoginAccessLog", "j90Date", "Čas", 1, null, "datetime"); AF("j90LoginAccessLog", "j90BrowserFamily", "Prohlížeč", 1); AF("j90LoginAccessLog", "j90BrowserOS", "OS", 1); AF("j90LoginAccessLog", "j90BrowserDeviceType", "Device"); AF("j90LoginAccessLog", "j90BrowserAvailWidth", "Šířka (px)", 1); AF("j90LoginAccessLog", "j90BrowserAvailHeight", "Výška (px)", 1); AF("j90LoginAccessLog", "j90LocationHost", "Host", 1); AF("j90LoginAccessLog", "j90LoginMessage", "Chyba", 1); AF("j90LoginAccessLog", "j90CookieExpiresInHours", "Expirace přihlášení", 1, null, "num0"); AF("j90LoginAccessLog", "j90LoginName", "Login", 1); //j92 = ping log uživatelů AF("j92PingLog", "j92Date", "Čas", 1, null, "datetime"); AF("j92PingLog", "j92BrowserFamily", "Prohlížeč", 1); AF("j92PingLog", "j92BrowserOS", "OS", 1); AF("j92PingLog", "j92BrowserDeviceType", "Device", 1); AF("j92PingLog", "j92BrowserAvailWidth", "Šířka (px)", 1); AF("j92PingLog", "j92BrowserAvailHeight", "Výška (px)", 1); AF("j92PingLog", "j92RequestURL", "Url", 1); //j40 = poštovní účty AF("j40MailAccount", "j40SmtpHost", "Smtp server", 1); AF("j40MailAccount", "j40SmtpName", "Název odesílatele", 2); AF("j40MailAccount", "j40SmtpEmail", "Adresa odesílatele", 1); AF("j40MailAccount", "j40SmtpPort", "Smtp Port", 2, null, "num0"); AF("j40MailAccount", "j40UsageFlag", "Typ účtu", 1, "case a.j40UsageFlag when 1 then 'Privátní Smtp účet' when 2 then 'Globální Smtp účet' when 3 then 'Osobní Imap účet' when 4 then 'Globální Imap účet' else null end"); //x40 = OUTBOX AF("x40MailQueue", "x40WhenProceeded", "Čas", 1, null, "datetime"); AF("x40MailQueue", "x40SenderName", "Odesílatel", 1); AF("x40MailQueue", "x40SenderAddress", "Odesílatel (adresa)"); AF("x40MailQueue", "x40To", "Komu", 1); AF("x40MailQueue", "x40Cc", "Cc"); AF("x40MailQueue", "x40Bcc", "Bcc"); AF("x40MailQueue", "x40Subject", "Předmět zprávy", 1); AF("x40MailQueue", "x40Body", "Text zprávy", 1, "convert(varchar(150),a.x40Body)+'...'"); AF("x40MailQueue", "x40Attachments", "Přílohy"); AF("x40MailQueue", "x40EmlFileSize_KB", "Velikost (kB)", 0, "a.x40EmlFileSize/1024", "num0", true); AF("x40MailQueue", "x40EmlFileSize_MB", "Velikost (MB)", 0, "convert(float,a.x40EmlFileSize)/1048576", "num", true); AF("x40MailQueue", "x40ErrorMessage", "Chyba", 1); //VIEW AF("z01_produkty_plan_vyroby", "PocetVZ", "Počet VZ", 1, null, "num0"); AF("z01_produkty_plan_vyroby", "MinStart", "Start první VZ", 1, null, "datetime"); AF("z01_produkty_plan_vyroby", "MaxStart", "Start poslední VZ", 1, null, "datetime"); AF("z01_produkty_plan_vyroby", "p41CodeFirst", "Kód první VZ"); AF("z01_produkty_plan_vyroby", "PlanMnozstvi", "Plánované množství", 1, null, "num"); AF("z01_produkty_plan_vyroby", "SkladoveMnozstvi", "Skladové množství", 1, null, "num"); AF("z02_suroviny_plan_vyroby", "Mnozstvi", "Plánované množství", 1, null, "num"); AF("z02_suroviny_plan_vyroby", "PocetVZ", "Počet VZ", 1, null, "num0"); AF("z02_suroviny_plan_vyroby", "Pocet", "Počet operací", 1, null, "num0"); AF("z02_suroviny_plan_vyroby", "MinStart", "Start první VZ", 1, null, "datetime"); AF("z02_suroviny_plan_vyroby", "MaxStart", "Start poslední VZ", 1, null, "datetime"); AF("z02_suroviny_plan_vyroby", "p41CodeFirst", "Kód první VZ"); AF("z02_suroviny_plan_vyroby", "PokrytiSurovinou", "Pokrytí Surovinou", 1, "z02_p19.p19StockActual-a.Mnozstvi", "num"); //x31 = tisková sestava AF("x31Report", "x31Name", "Tisková sestava", 1, null, "string", false, true); AF("x31Report", "x31Code", "Kód sestavy"); AF("x31Report", "x31FileName", "Šablona sestavy", 2); AF("x31Report", "x31Is4SingleRecord", "Kontextová sestava", 2, null, "bool"); AF("x31Report", "RepFormat", "Formát", 1, "case a.x31ReportFormat when 1 then 'REP' when 2 then 'DOCX' when 3 then 'XLSX' when 4 then 'MSREP' end"); AF("x31Report", "x31Description", "Popis"); AppendTimestamp("x31Report"); //y01 = pevné tiskové sestavy pro tisk AF("y01_core_view_reports", "x31Name", "Tisková sestava", 1, null, "string", false, true); AF("y01_core_view_reports", "Preview", "Náhled", 2, "'<a class='+char(34)+'grid-link'+char(34)+' href='+char(34)+'javascript:report_nocontext('+convert(varchar(10),a.x31ID)+')'+CHAR(34)+'>Náhled</a>'"); AF("y01_core_view_reports", "x31Code", "Kód sestavy", 2); AF("y01_core_view_reports", "x31FileName", "Šablona sestavy", 2); AF("y01_core_view_reports", "x31Description", "Popis", 1); //y02 = řádkový rozpis kapacitních fondů AF("y02_fond_zarizeni", "p33Date", "Den", 1, null, "date"); onecol = AF("y02_fond_zarizeni", "Hodina1", "Začátek", 1, null, "time"); onecol.FixedWidth = 70; onecol = AF("y02_fond_zarizeni", "Hodina2", "Konec", 1, null, "time"); onecol.FixedWidth = 70; AF("y02_fond_zarizeni", "Den v týdnu", "Den", 0, "DATENAME(weekday,p33Date)"); AF("y02_fond_zarizeni", "Měsíc", "Mesic", 0, "DATENAME(month,p33Date)"); }
public BaseBL(BL.Factory mother) { _mother = mother; _db = new DL.DbHandler(_mother.App.ConnectString, _mother.CurrentUser, _mother.App.LogFolder); _sb = new System.Text.StringBuilder(); }