internal bool PredpisExport(int popl, string per, int ucetMes, int ucetRok, int idPredpisu) { try { P_NASTAVENI nast = sesna.GetObjectByKey <P_NASTAVENI>("VAZBA_UCTO_TYP"); bool procDB = false; if (nast != null) { procDB = (Convert.ToInt16(nast.HODNOTA) == 1); } if (!procDB) { return(false); } DBValue dbv = DBValue.Instance(sesna); string user = dbv.DBUserName.ToUpper(); P_POPL_USERS pUser = sesna.FindObject <P_POPL_USERS>( CriteriaOperator.Parse("CompoundKey1.LOGIN = ? " + "and CompoundKey1.HODNOTA_NAZEV = ? " + "and CompoundKey1.SEKCE is null", dbv.DBUserName.ToUpper(), "Expfin_predp_ihned")); #region logovani if (pUser != null) { Util.Util.WriteLog(string.Format("nastaveni pro export do ucta: LOGIN={0}, Expfin_predp_ihned={1}, " + "popl={2}, per={3}, ucetMes={4}, ucetRok={5}, predpisID={6}", dbv.DBUserName.ToUpper(), pUser.HODNOTA, popl, per, ucetMes, ucetRok, idPredpisu)); } else { Util.Util.WriteLog(string.Format("nastaveni pro export do ucta: LOGIN={0}, nebylo dohledano", dbv.DBUserName.ToUpper())); } #endregion logovani if ((pUser != null) && (Convert.ToInt32(pUser.HODNOTA) > 0)) { DevExpress.Xpo.DB.SelectedData selData = sesna.ExecuteSproc("GEO_EXP_PRPL_OX", new OperandValue(popl), new OperandValue(per), new OperandValue(ucetMes), new OperandValue(ucetRok), new OperandValue(idPredpisu)); return(true); } else { return(false); } } catch (Exception exc) { return(false); throw new Exception("Export předpisu do účetnictví neproběhl z důvodu chyby. \n\n" + exc.Message); } }
private void loadData() { using (UnitOfWork u = new UnitOfWork()) { //TODO сделать фильтр по критериям DevExpress.Xpo.DB.SelectedData _positionData = u.ExecuteQuery(string.Format(@" [GUID] ,[ProductsGUID] ,[OperationsGUID] ,[Volume] ,[UnitOfMeasurement] ,[MaterialGUID] ,[VolumeMaterial] ,[UnitOfMeasurementMaterial] ,[DateOfTheBeginning] ,[EndDate] ,[DateOfChange] ,[DeletedDate] FROM [dbo].[ProductionsView] WHERE [DeletedDate] is null" )); productionDataView.LoadData(_positionData); } GC.Collect(); }
public static string GetNumberOfEmployeesByBranchOid(string Oid, Session session) { DevExpress.Xpo.DB.SelectedData res = session.ExecuteQuery("SELECT COUNT(*) FROM `NhanVien` WHERE `Chinhanh` = " + Oid); if (res.ResultSet[0].Rows.Length > 0) { return(res.ResultSet[0].Rows[0].Values[0].ToString()); } else { return(null); } }
private void loadData() { using (UnitOfWork u = new UnitOfWork()) { //TODO сделать фильтр по критериям DevExpress.Xpo.DB.SelectedData _vendorData = u.ExecuteQuery(string.Format(@" SELECT [GUID] ,[Name] FROM [device].[Products] WHERE [DeletedDate] is null" )); productsDataView.LoadData(_vendorData); } GC.Collect(); }
private void loadData() { using (UnitOfWork u = new UnitOfWork()) { //TODO сделать фильтр по критериям DevExpress.Xpo.DB.SelectedData _positionData = u.ExecuteQuery(string.Format(@" SELECT [GUID] ,[NameOperationsType] FROM [device].[TypeOperations] WHERE [DeletedDate] is null" )); typeOperationsDataView.LoadData(_positionData); } GC.Collect(); }
private void loadData() { using (UnitOfWork u = new UnitOfWork()) { //TODO сделать фильтр по критериям DevExpress.Xpo.DB.SelectedData _typevendorData = u.ExecuteQuery(string.Format(@" SELECT [GUID] ,[TypeOfShift] ,[WorkingHours] ,[ShiftType] FROM [device].[WorkShifts] WHERE [DeletedDate] is null" )); workShiftsDataView.LoadData(_typevendorData); } GC.Collect(); }
private void loadData() { using (UnitOfWork u = new UnitOfWork()) { //TODO сделать фильтр по критериям DevExpress.Xpo.DB.SelectedData _typevendorData = u.ExecuteQuery(string.Format(@" SELECT [GUID] ,[Name] ,[Volume] ,[UnitOfMeasurement] FROM [device].[Material] WHERE [DeletedDate] is null" )); machineDataView.LoadData(_typevendorData); } GC.Collect(); }
private void loadData() { using (UnitOfWork u = new UnitOfWork()) { //TODO сделать фильтр по критериям DevExpress.Xpo.DB.SelectedData _positionData = u.ExecuteQuery(string.Format(@" SELECT [GUID] ,[Name] ,[NameType] ,[OperationsGUID] ,[CommissioningDate] ,[DateOfChange] ,[DeletedDate] FROM [dbo].[AgregatView] WHERE [DeletedDate] is null" )); machineDataView.LoadData(_positionData); } GC.Collect(); }
private void loadData() { using (UnitOfWork u = new UnitOfWork()) { //TODO сделать фильтр по критериям DevExpress.Xpo.DB.SelectedData _operationsData = u.ExecuteQuery(string.Format(@" SELECT [GUID] ,[NameOperations] ,[TypeOperationsGUID] ,[OperationTime] ,[WorkTeamGUID] ,[DateOfChange] ,[DeletedDate] FROM [dbo].[OperationsView] WHERE [DeletedDate] is null" )); operationsDataView.LoadData(_operationsData); } GC.Collect(); }
public int LIZNI_SEQ(string sequence) { DBVal dbv = new DBVal(sesna); IDBValFactory idbv = dbv.CreateDBV(); int ID = 0; if (idbv.Database == typeof(MSSQL)) { if (sequence == "PRPL_ID") { sequence = "P_SEQUENCE_PRPL"; } if (sequence == "PLATBA_ID") { sequence = "P_SEQUENCE_PLATBA"; } DevExpress.Xpo.DB.SelectedData selData = sesna.ExecuteSproc("LIZNI_SEQ", new OperandValue(sequence)); ID = Convert.ToInt32(selData.ResultSet[0].Rows[0].Values[0]); } if (idbv.GetType() == typeof(ORACLE)) { if (sequence == "PRPL_ID") { sequence = "P_SEQ_PRPL_ID"; } if (sequence == "PLATBA_ID") { sequence = "P_SEQ_PLATBA_ID"; } object obj = sesna.ExecuteScalar("select " + sequence + ".Nextval ID from dual"); ID = Convert.ToInt32(obj); } if (ID == 0) { throw new Exception(String.Format("chyba při čtení hodnoty sequence {0}", sequence)); } return(ID); }
public static XPDataView ExecDANGNHAPIntoDataView(Session session, string TenDangNhap, string MatKhau) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("DANGNHAP", new OperandValue(TenDangNhap), new OperandValue(MatKhau)); return(new XPDataView(session.Dictionary, session.GetClassInfo(typeof(DANGNHAPResult)), sprocData)); }
public static XPDataView ExecBOPHAN_UpdIntoDataView(Session session, int IdBP, string TenBP, string GhiChu) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("BOPHAN_Upd", new OperandValue(IdBP), new OperandValue(TenBP), new OperandValue(GhiChu)); return(new XPDataView(session.Dictionary, session.GetClassInfo(typeof(BOPHAN_UpdResult2)), sprocData)); }
public static void ExecBOPHAN_UpdIntoDataView(XPDataView dataView, Session session, int IdBP, string TenBP, string GhiChu) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("BOPHAN_Upd", new OperandValue(IdBP), new OperandValue(TenBP), new OperandValue(GhiChu)); dataView.PopulateProperties(session.GetClassInfo(typeof(BOPHAN_UpdResult2))); dataView.LoadData(sprocData); }
public static XPDataView ExecKHACHHANG_GetAllIntoDataView(Session session) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("KHACHHANG_GetAll"); return(new XPDataView(session.Dictionary, session.GetClassInfo(typeof(KHACHHANG_GetAllResult)), sprocData)); }
public static void ExecKHACHHANG_GetAllIntoDataView(XPDataView dataView, Session session) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("KHACHHANG_GetAll"); dataView.PopulateProperties(session.GetClassInfo(typeof(KHACHHANG_GetAllResult))); dataView.LoadData(sprocData); }
public static void ExecDICHVU_UpdIntoDataView(XPDataView dataView, Session session, int IdDV, string TenDV, decimal DonGiaDV, string GhiChu) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("DICHVU_Upd", new OperandValue(IdDV), new OperandValue(TenDV), new OperandValue(DonGiaDV), new OperandValue(GhiChu)); dataView.PopulateProperties(session.GetClassInfo(typeof(DICHVU_UpdResult2))); dataView.LoadData(sprocData); }
public static void ExecDOUONG_InsIntoDataView(XPDataView dataView, Session session, string TenDU, string DVT, decimal DonGia, decimal DonGia_PS, string GhiChu) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("DOUONG_Ins", new OperandValue(TenDU), new OperandValue(DVT), new OperandValue(DonGia), new OperandValue(DonGia_PS), new OperandValue(GhiChu)); dataView.PopulateProperties(session.GetClassInfo(typeof(DOUONG_InsResult1))); dataView.LoadData(sprocData); }
public static XPDataView ExecMONAN_DelIntoDataView(Session session, int IdMA) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("MONAN_Del", new OperandValue(IdMA)); return(new XPDataView(session.Dictionary, session.GetClassInfo(typeof(MONAN_DelResult1)), sprocData)); }
public static void ExecMONAN_DelIntoDataView(XPDataView dataView, Session session, int IdMA) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("MONAN_Del", new OperandValue(IdMA)); dataView.PopulateProperties(session.GetClassInfo(typeof(MONAN_DelResult1))); dataView.LoadData(sprocData); }
public static void ExecDODUNG_UpdIntoDataView(XPDataView dataView, Session session, int IdDD, string TenDD, decimal ChiPhiDD) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("DODUNG_Upd", new OperandValue(IdDD), new OperandValue(TenDD), new OperandValue(ChiPhiDD)); dataView.PopulateProperties(session.GetClassInfo(typeof(DODUNG_UpdResult1))); dataView.LoadData(sprocData); }
public static void ExecMANHINH_UpdIntoDataView(XPDataView dataView, Session session, int IdMH, string TenMH) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("MANHINH_Upd", new OperandValue(IdMH), new OperandValue(TenMH)); dataView.PopulateProperties(session.GetClassInfo(typeof(MANHINH_UpdResult1))); dataView.LoadData(sprocData); }
public static void ExecLOAITIEC_InsIntoDataView(XPDataView dataView, Session session, string TenLT) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("LOAITIEC_Ins", new OperandValue(TenLT)); dataView.PopulateProperties(session.GetClassInfo(typeof(LOAITIEC_InsResult1))); dataView.LoadData(sprocData); }
public static XPDataView ExecLOAITIEC_InsIntoDataView(Session session, string TenLT) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("LOAITIEC_Ins", new OperandValue(TenLT)); return(new XPDataView(session.Dictionary, session.GetClassInfo(typeof(LOAITIEC_InsResult1)), sprocData)); }
public static XPDataView ExecLOAIDOUONG_UpdIntoDataView(Session session, int IdLDU, string TenLDU, string GhiChu) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("LOAIDOUONG_Upd", new OperandValue(IdLDU), new OperandValue(TenLDU), new OperandValue(GhiChu)); return(new XPDataView(session.Dictionary, session.GetClassInfo(typeof(LOAIDOUONG_UpdResult1)), sprocData)); }
public static void ExecDANGNHAPIntoDataView(XPDataView dataView, Session session, string TenDangNhap, string MatKhau) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("DANGNHAP", new OperandValue(TenDangNhap), new OperandValue(MatKhau)); dataView.PopulateProperties(session.GetClassInfo(typeof(DANGNHAPResult))); dataView.LoadData(sprocData); }
public static XPDataView ExecNHANVIEN_ByIdIntoDataView(Session session, int IdNV) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("NHANVIEN_ById", new OperandValue(IdNV)); return(new XPDataView(session.Dictionary, session.GetClassInfo(typeof(NHANVIEN_ByIdResult)), sprocData)); }
public static XPDataView ExecDODUNG_UpdIntoDataView(Session session, int IdDD, string TenDD, decimal ChiPhiDD) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("DODUNG_Upd", new OperandValue(IdDD), new OperandValue(TenDD), new OperandValue(ChiPhiDD)); return(new XPDataView(session.Dictionary, session.GetClassInfo(typeof(DODUNG_UpdResult1)), sprocData)); }
public static void ExecNHANVIEN_ByIdIntoDataView(XPDataView dataView, Session session, int IdNV) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("NHANVIEN_ById", new OperandValue(IdNV)); dataView.PopulateProperties(session.GetClassInfo(typeof(NHANVIEN_ByIdResult))); dataView.LoadData(sprocData); }
public static XPDataView ExecMANHINH_UpdIntoDataView(Session session, int IdMH, string TenMH) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("MANHINH_Upd", new OperandValue(IdMH), new OperandValue(TenMH)); return(new XPDataView(session.Dictionary, session.GetClassInfo(typeof(MANHINH_UpdResult1)), sprocData)); }
public static XPDataView ExecDOUONG_InsIntoDataView(Session session, string TenDU, string DVT, decimal DonGia, decimal DonGia_PS, string GhiChu) { DevExpress.Xpo.DB.SelectedData sprocData = session.ExecuteSproc("DOUONG_Ins", new OperandValue(TenDU), new OperandValue(DVT), new OperandValue(DonGia), new OperandValue(DonGia_PS), new OperandValue(GhiChu)); return(new XPDataView(session.Dictionary, session.GetClassInfo(typeof(DOUONG_InsResult1)), sprocData)); }