public frmAddMemberToGroup(UniXP.Common.CProfile objProfile) { InitializeComponent(); m_objProfile = objProfile; m_objSelectedObjectsList = new List <CConditionObject>(); }
public frmProductDetail(UniXP.Common.CProfile objProfile, UniXP.Common.MENUITEM objMenuItem) { System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("ru-RU"); ci.NumberFormat.CurrencyDecimalSeparator = "."; ci.NumberFormat.NumberDecimalSeparator = "."; System.Threading.Thread.CurrentThread.CurrentCulture = ci; AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.AssemblyResolve += new ResolveEventHandler(MyResolveEventHandler); InitializeComponent(); m_objProfile = objProfile; m_objMenuItem = objMenuItem; frmProductDetailEditor = new ERP_Mercury.Common.ctrlPartsDetail(m_objProfile, m_objMenuItem); tableLayoutPanelBgrnd.Controls.Add(frmProductDetailEditor, 0, 0); frmProductDetailEditor.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top) | (System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); Text = m_objMenuItem.strName; }
public ctrlCustomerLimit(UniXP.Common.CProfile objProfile, UniXP.Common.MENUITEM objMenuItem) { InitializeComponent(); m_objProfile = objProfile; m_objMenuItem = objMenuItem; m_bIsChanged = false; m_bDisableEvents = false; m_objSelectedCustomer = null; m_objCreditLimitList = null; cboxCurrency.Properties.Items.Clear(); List <CCurrency> objCurrencyList = CCurrency.GetCurrencyList(m_objProfile, null); if (objCurrencyList != null) { foreach (CCurrency objCurrency in objCurrencyList) { cboxCurrency.Properties.Items.Add(objCurrency); } } objCurrencyList = null; if (cboxCurrency.Properties.Items.Count > 0) { cboxCurrency.SelectedItem = cboxCurrency.Properties.Items[0]; } CheckClientsRight(); }
/* public CCompanyType(Guid uuidID, string strName) * : base(uuidID, strName) * { * * }*/ #region Список объектов public static List <CCompanyType> GetCompanyTypeList(UniXP.Common.CProfile objProfile, System.Data.SqlClient.SqlCommand cmdSQL) { List <CCompanyType> objList = new List <CCompanyType>(); System.Data.SqlClient.SqlConnection DBConnection = null; System.Data.SqlClient.SqlCommand cmd = null; try { if (cmdSQL == null) { DBConnection = objProfile.GetDBSource(); if (DBConnection == null) { DevExpress.XtraEditors.XtraMessageBox.Show( "Не удалось получить соединение с базой данных.", "Внимание", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); return(objList); } cmd = new System.Data.SqlClient.SqlCommand(); cmd.Connection = DBConnection; cmd.CommandType = System.Data.CommandType.StoredProcedure; } else { cmd = cmdSQL; cmd.Parameters.Clear(); } cmd.CommandText = System.String.Format("[{0}].[dbo].[usp_GetCompanyType]", objProfile.GetOptionsDllDBName()); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ERROR_NUM", System.Data.SqlDbType.Int, 8, System.Data.ParameterDirection.Output, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ERROR_MES", System.Data.SqlDbType.NVarChar, 4000)); cmd.Parameters["@ERROR_MES"].Direction = System.Data.ParameterDirection.Output; System.Data.SqlClient.SqlDataReader rs = cmd.ExecuteReader(); if (rs.HasRows) { while (rs.Read()) { objList.Add(new CCompanyType((System.Guid)rs["CustomerStateType_Guid"], (System.String)rs["CustomerStateType_Name"], (System.String)rs["CustomerStateType_Description"], (System.Boolean)rs["CustomerStateType_IsActive"])); } } rs.Dispose(); if (cmdSQL == null) { cmd.Dispose(); DBConnection.Close(); } } catch (System.Exception f) { DevExpress.XtraEditors.XtraMessageBox.Show( "Не удалось получить список форм собственности.\n\nТекст ошибки: " + f.Message, "Внимание", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } return(objList); }
/// <summary> /// Возвращает список расчетов прогноза продаж /// </summary> /// <param name="objProfile">профайл</param> /// <param name="cmdSQL">SQL-команда</param> /// <returns>список расчетов прогноза продаж</returns> public static List<CSalePrognosis> GetSalePrognosisList(UniXP.Common.CProfile objProfile, System.Data.SqlClient.SqlCommand cmdSQL) { List<CSalePrognosis> objList = new List<CSalePrognosis>(); System.Data.SqlClient.SqlConnection DBConnection = null; System.Data.SqlClient.SqlCommand cmd = null; try { if (cmdSQL == null) { DBConnection = objProfile.GetDBSource(); if (DBConnection == null) { DevExpress.XtraEditors.XtraMessageBox.Show( "Не удалось получить соединение с базой данных.", "Внимание", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); return objList; } cmd = new System.Data.SqlClient.SqlCommand(); cmd.Connection = DBConnection; cmd.CommandType = System.Data.CommandType.StoredProcedure; } else { cmd = cmdSQL; cmd.Parameters.Clear(); } cmd.CommandText = System.String.Format("[{0}].[dbo].[usp_GetSalePrognosisListFromERP_Report]", objProfile.GetOptionsDllDBName()); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ERROR_NUM", System.Data.SqlDbType.Int, 8, System.Data.ParameterDirection.Output, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ERROR_MES", System.Data.SqlDbType.NVarChar, 4000)); cmd.Parameters["@ERROR_MES"].Direction = System.Data.ParameterDirection.Output; System.Data.SqlClient.SqlDataReader rs = cmd.ExecuteReader(); if (rs.HasRows) { while (rs.Read()) { objList.Add(new CSalePrognosis(System.Convert.ToDateTime(rs["REPORTDATE"]), System.Convert.ToInt32(rs["SALEPROGNOSIS_ID"]), System.Convert.ToInt32(rs["MonthID"]), System.Convert.ToInt32(rs["YearID"]), System.Convert.ToString(rs["YearMonth"]))); } } rs.Dispose(); if (cmdSQL == null) { cmd.Dispose(); DBConnection.Close(); } } catch (System.Exception f) { DevExpress.XtraEditors.XtraMessageBox.Show( "Не удалось получить список расчетов прогноза продаж.\n\nТекст ошибки : " + f.Message, "Внимание", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } return objList; }
public frmSelectAddressForRtt(UniXP.Common.CProfile objProfile, System.Guid OwnerId) { InitializeComponent(); m_objProfile = objProfile; m_uuidOwnerId = OwnerId; m_objAddressSelected = null; }
public frmProductOwnerList(UniXP.Common.CProfile objProfile) { m_objProfile = objProfile; InitializeComponent(); LoadProductOwnerList(); LoadSalePrognosisList(); }
public ctrlCalcOrderItem(UniXP.Common.CProfile objProfile, CCalcOrder objCalcOrder) { m_objProfile = objProfile; InitializeComponent(); m_objCalcOrder = objCalcOrder; m_bPlanIsChanged = false; }
/// <summary> /// Удаляет запись из базы данных /// </summary> /// <param name="BUDGETPROJECT_GUID">УИ проекта</param> /// <param name="objProfile">профайл</param> /// <param name="strErr">сообщение об ошибке</param> /// <returns>true - запись удалена; false - ошибка</returns> public static System.Boolean RemoveObjectFromDataBase(System.Guid BUDGETPROJECT_GUID, UniXP.Common.CProfile objProfile, ref System.String strErr) { System.Boolean bRet = false; System.Data.SqlClient.SqlConnection DBConnection = null; System.Data.SqlClient.SqlCommand cmd = null; System.Data.SqlClient.SqlTransaction DBTransaction = null; try { DBConnection = objProfile.GetDBSource(); if (DBConnection == null) { strErr += ("Не удалось получить соединение с базой данных."); return(bRet); } DBTransaction = DBConnection.BeginTransaction(); cmd = new System.Data.SqlClient.SqlCommand(); cmd.Connection = DBConnection; cmd.Transaction = DBTransaction; cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.CommandText = System.String.Format("[{0}].[dbo].[usp_DeleteBudgetProject]", objProfile.GetOptionsDllDBName()); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@BUDGETPROJECT_GUID", System.Data.SqlDbType.UniqueIdentifier)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ERROR_NUM", System.Data.SqlDbType.Int, 8, System.Data.ParameterDirection.Output, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ERROR_MES", System.Data.SqlDbType.NVarChar, 4000)); cmd.Parameters["@ERROR_MES"].Direction = System.Data.ParameterDirection.Output; cmd.Parameters["@BUDGETPROJECT_GUID"].Value = BUDGETPROJECT_GUID; cmd.ExecuteNonQuery(); System.Int32 iRes = (System.Int32)cmd.Parameters["@RETURN_VALUE"].Value; if (iRes == 0) { // подтверждаем транзакцию DBTransaction.Commit(); } else { DBTransaction.Rollback(); strErr += ((cmd.Parameters["@ERROR_MES"].Value == System.DBNull.Value) ? "" : (System.String)cmd.Parameters["@ERROR_MES"].Value); } cmd.Dispose(); bRet = (iRes == 0); } catch (System.Exception f) { DBTransaction.Rollback(); strErr += ("Не удалось удалить объект 'проект'. Текст ошибки: " + f.Message); } finally { DBConnection.Close(); } return(bRet); }
/// <summary> /// Удалить запись из БД /// </summary> /// <param name="objProfile">профайл</param> /// <returns>true - удачное завершение; false - ошибка</returns> public override System.Boolean Remove(UniXP.Common.CProfile objProfile) { System.Boolean bRet = false; System.Data.SqlClient.SqlConnection DBConnection = null; System.Data.SqlClient.SqlCommand cmd = null; System.String strErr = ""; try { DBConnection = objProfile.GetDBSource(); if (DBConnection == null) { DevExpress.XtraEditors.XtraMessageBox.Show( "Не удалось получить соединение с базой данных.", "Внимание", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); return(bRet); } cmd = new System.Data.SqlClient.SqlCommand(); cmd.Connection = DBConnection; cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.CommandText = System.String.Format("[{0}].[dbo].[usp_DeleteCertificateType]", objProfile.GetOptionsDllDBName()); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@CertificateType_Guid", System.Data.SqlDbType.UniqueIdentifier)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ERROR_NUM", System.Data.SqlDbType.Int, 8, System.Data.ParameterDirection.Output, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ERROR_MES", System.Data.SqlDbType.NVarChar, 4000)); cmd.Parameters["@ERROR_MES"].Direction = System.Data.ParameterDirection.Output; cmd.Parameters["@CertificateType_Guid"].Value = this.ID; cmd.ExecuteNonQuery(); System.Int32 iRes = (System.Int32)cmd.Parameters["@RETURN_VALUE"].Value; if (iRes != 0) { strErr = (cmd.Parameters["@ERROR_MES"].Value == System.DBNull.Value) ? "" : (System.String)cmd.Parameters["@ERROR_MES"].Value; DevExpress.XtraEditors.XtraMessageBox.Show("Ошибка удаления записи.\n\nТекст ошибки: " + strErr, "Ошибка", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } cmd.Dispose(); bRet = (iRes == 0); } catch (System.Exception f) { strErr = f.Message; DevExpress.XtraEditors.XtraMessageBox.Show( "Не удалось удалить запись в справочнике типов сертификатов.\n\nТекст ошибки: " + f.Message, "Внимание", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } finally { if (DBConnection != null) { DBConnection.Close(); } } return(bRet); }
public ctrlSetting(UniXP.Common.CProfile objProfile, UniXP.Common.MENUITEM objMenuItem) { m_objProfile = objProfile; m_objMenuItem = objMenuItem; m_objSetting = null; m_bIsChanged = false; m_bDisableEvents = false; InitializeComponent(); }
public ctrlWarehous(UniXP.Common.CProfile objProfile, UniXP.Common.MENUITEM objMenuItem) { InitializeComponent(); m_objProfile = objProfile; m_objMenuItem = objMenuItem; m_bIsChanged = false; //m_bDisableEvents = false; m_bNewWareHouse = false; m_objSelectedWareHouse = null; frmAddress = new ERP_Mercury.Common.ctrlAddress(ERP_Mercury.Common.EnumObject.Warehouse, m_objProfile, m_objMenuItem, System.Guid.Empty); frmAddress.InitAddressControl(); layoutControlAddress.Size = new Size(layoutControlAddress.Size.Width, (frmAddress.Size.Height)); layoutControlAddress.MaximumSize = new Size(layoutControlAddress.Size.Width, layoutControlAddress.Size.Height); layoutControlGroupAddress.Size = new Size(layoutControlGroupAddress.Size.Width, (frmAddress.Size.Height)); this.layoutControlItemAddress = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItemAddress.Parent = layoutControlGroupAddress; this.layoutControlItemAddress.Control = frmAddress; this.layoutControlItemAddress.CustomizationFormText = "layoutControlItemAddress"; this.layoutControlItemAddress.Location = new System.Drawing.Point(0, 0); this.layoutControlItemAddress.Name = "layoutControlItemAddress"; this.layoutControlItemAddress.Padding = new DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5); this.layoutControlItemAddress.Size = new System.Drawing.Size(642, 38); this.layoutControlItemAddress.Spacing = new DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0); this.layoutControlItemAddress.Text = "layoutControlItemAddress"; this.layoutControlItemAddress.TextSize = new System.Drawing.Size(93, 20); this.layoutControlItemAddress.TextVisible = false; /* * this.frmAddress.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top // | System.Windows.Forms.AnchorStyles.Bottom ) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))));*/ this.frmAddress.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); frmAddress.ChangeAddressPropertie += OnChangeAddressPropertie; LoadComboBoxItems(); m_bIsReadOnly = false; CheckClientsRight(); }
/// <summary> /// Возвращает признак того, находится ли клиент в "черном списке" по кредитномулимиту /// </summary> /// <param name="objProfile">профайл</param> /// <param name="cmdSQL">SQL-команда</param> /// <param name="objCustomer">клиент</param> /// <returns>true - клиент в "черном списке"; false - клиента НЕТ в "черном списке"</returns> public static System.Boolean IsCustomerInBlackList(UniXP.Common.CProfile objProfile, System.Data.SqlClient.SqlCommand cmdSQL, CCustomer objCustomer) { System.Boolean bRet = false; System.Data.SqlClient.SqlConnection DBConnection = null; System.Data.SqlClient.SqlCommand cmd = null; try { if (cmdSQL == null) { DBConnection = objProfile.GetDBSource(); if (DBConnection == null) { DevExpress.XtraEditors.XtraMessageBox.Show( "Не удалось получить соединение с базой данных.", "Внимание", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); return(bRet); } cmd = new System.Data.SqlClient.SqlCommand(); cmd.Connection = DBConnection; cmd.CommandType = System.Data.CommandType.StoredProcedure; } else { cmd = cmdSQL; cmd.Parameters.Clear(); } cmd.CommandText = System.String.Format("[{0}].[dbo].[usp_GetIsCustomerInBlackList]", objProfile.GetOptionsDllDBName()); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Customer_Guid", System.Data.SqlDbType.UniqueIdentifier)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@IsInBlackList", System.Data.SqlDbType.Bit)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ERROR_NUM", System.Data.SqlDbType.Int, 8, System.Data.ParameterDirection.Output, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ERROR_MES", System.Data.SqlDbType.NVarChar, 4000)); cmd.Parameters["@ERROR_MES"].Direction = System.Data.ParameterDirection.Output; cmd.Parameters["@IsInBlackList"].Direction = System.Data.ParameterDirection.Output; cmd.Parameters["@Customer_Guid"].Value = objCustomer.ID; cmd.ExecuteNonQuery(); bRet = System.Convert.ToBoolean(cmd.Parameters["@IsInBlackList"].Value); if (cmdSQL == null) { cmd.Dispose(); DBConnection.Close(); } } catch (System.Exception f) { DevExpress.XtraEditors.XtraMessageBox.Show( "Не удалось получить информацию о вхождении клиента в черный список.\n\nТекст ошибки: " + f.Message, "Внимание", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } return(bRet); }
/// <summary> /// Загружает из БД изображение товара /// </summary> /// <param name="objProfile">профайл</param> /// <param name="uuidCertificateID">УИ сертификата</param> /// <param name="arAttach">изображение в виде массива байт</param> /// <param name="strCertificateFileName">название файла с изображением</param> /// <param name="strErr">сообщение об ошибке</param> /// <returns>true - удачное завершение операции; false - ошибка</returns> public static System.Boolean LoadImageFromDB(UniXP.Common.CProfile objProfile, System.Guid uuidCertificateID, ref byte[] arAttach, ref System.String strCertificateFileName, ref System.String strErr) { System.Boolean bRet = false; //Создаем соединение с базой данных System.Data.SqlClient.SqlConnection DBConnection = objProfile.GetDBSource(); if (DBConnection == null) { DevExpress.XtraEditors.XtraMessageBox.Show( "Не удалось получить соединение с БД.", "Внимание", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); return(bRet); } try { // соединение с БД получено, прописываем команду на выборку данных System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand() { Connection = DBConnection, CommandType = System.Data.CommandType.StoredProcedure, CommandText = System.String.Format("[{0}].[dbo].[usp_GetPartCertificateImage]", objProfile.GetOptionsDllDBName()) }; cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Certificate_Guid", System.Data.SqlDbType.UniqueIdentifier)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ERROR_NUM", System.Data.SqlDbType.Int, 8, System.Data.ParameterDirection.Output, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ERROR_MES", System.Data.SqlDbType.NVarChar, 4000)); cmd.Parameters["@ERROR_MES"].Direction = System.Data.ParameterDirection.Output; cmd.Parameters["@Certificate_Guid"].Value = uuidCertificateID; System.Data.SqlClient.SqlDataReader rs = cmd.ExecuteReader(); if (rs.HasRows) { // набор данных непустой rs.Read(); if (rs["Certificate_Image"] != System.DBNull.Value) { strCertificateFileName = ((rs["Certificate_ImageFileFullName"] == System.DBNull.Value) ? "" : System.Convert.ToString(rs["Certificate_ImageFileFullName"])); arAttach = (byte[])rs["Certificate_Image"]; } } rs.Close(); rs.Dispose(); bRet = true; } catch (System.Exception f) { strErr = "Не удалось получить изображение сертификата. Текст ошибки: " + f.Message; } finally { DBConnection.Close(); } return(bRet); }
public frmCalcOrder(UniXP.Common.CProfile objProfile, UniXP.Common.MENUITEM objMenuItem) { InitializeComponent(); m_objProfile = objProfile; m_objMenuItem = objMenuItem; m_bPlanIsChanged = false; m_objCalcOrderList = null; AddGridColumns(); LoadCalcOrderList(); Text = m_objMenuItem.strName; }
/// <summary> /// Удалить запись из БД /// </summary> /// <param name="objProfile">профайл</param> /// <param name="uuidID">уникальный идентификатор объекта</param> /// <returns>true - удачное завершение; false - ошибка</returns> public override System.Boolean Remove(UniXP.Common.CProfile objProfile) { System.String strErr = ""; System.Boolean bRet = CBudgetProjectDataBaseModel.RemoveObjectFromDataBase(this.ID, objProfile, ref strErr); if (bRet == false) { DevExpress.XtraEditors.XtraMessageBox.Show(strErr, "Внимание", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } return(bRet); }
public ctrlCustomerChild(UniXP.Common.CProfile objProfile, UniXP.Common.MENUITEM objMenuItem) { InitializeComponent(); m_objProfile = objProfile; m_objMenuItem = objMenuItem; m_bIsChanged = false; //m_bDisableEvents = false; m_objSelectedCustomer = null; m_objChildDepartList = null; CheckClientsRight(); }
/// <summary> /// Сохранить изменения в БД /// </summary> /// <param name="objProfile">профайл</param> /// <returns>true - удачное завершение; false - ошибка</returns> public override System.Boolean Update(UniXP.Common.CProfile objProfile) { System.String strErr = ""; System.Boolean bRet = CBudgetProjectDataBaseModel.EditObjectInDataBase(this.ID, this.Name, this.Description, this.IsActive, this.CodeIn1C, objProfile, ref strErr); if (bRet == false) { DevExpress.XtraEditors.XtraMessageBox.Show(strErr, "Внимание", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } return(bRet); }
public ctrlCustomerCategory(UniXP.Common.CProfile objProfile, UniXP.Common.MENUITEM objMenuItem) { InitializeComponent(); m_objProfile = objProfile; m_objMenuItem = objMenuItem; m_bIsChanged = false; m_bDisableEvents = false; m_objSelectedCustomer = null; InitializeTreeList(); CheckClientsRight(); }
public frmDatabaseDirectory(UniXP.Common.CProfile objProfile, ERP_Mercury.Common.EnumDirectSimple DirectSimple, UniXP.Common.MENUITEM objMenuItem) { InitializeComponent(); m_objProfile = objProfile; m_DirectSimple = DirectSimple; m_objMenuItem = objMenuItem; m_objDatabaseDirectory = new ERP_Mercury.Common.ctrlDatabaseDirectory(m_objProfile, m_DirectSimple, m_objMenuItem); if (m_objDatabaseDirectory != null) { this.Controls.Add(m_objDatabaseDirectory); m_objDatabaseDirectory.Dock = DockStyle.Fill; } }
/// <summary> /// Сохраняет в БД настройки для импорта данных в заказ /// </summary> /// <param name="objProfile">профайл</param> /// <param name="cmdSQL">SQL-команда</param> /// <param name="strErr">строка с сообщением об ошибке</param> /// <returns>true - успешное завершение операции; false - ошибка</returns> public System.Boolean SaveExportSetting(UniXP.Common.CProfile objProfile, System.Data.SqlClient.SqlCommand cmdSQL, ref System.String strErr) { System.Boolean bRet = false; try { bRet = CSetting.SaveSettingInDB(this.ID, this.XMLSettings.InnerXml, objProfile, cmdSQL, ref strErr); } catch (System.Exception f) { strErr += (f.Message); } finally { } return(bRet); }
/// <summary> /// Загружает в m_objAllConstTypeList список типов констант /// </summary> /// <param name="objProfile">профайл</param> /// <param name="cmdSQL">SQL-команда</param> public void InitConstTypeList(UniXP.Common.CProfile objProfile, System.Data.SqlClient.SqlCommand cmdSQL) { try { this.m_objAllConstTypeList = CConstType.GetConstTypeList(objProfile, cmdSQL); if ((this.m_objAllConstTypeList != null) && (this.m_objAllConstTypeList.Count > 0)) { this.ConstType = this.m_objAllConstTypeList[0]; } } catch (System.Exception f) { DevExpress.XtraEditors.XtraMessageBox.Show( "Не удалось загрузить список типов констант.\n\nТекст ошибки: " + f.Message, "Внимание", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } return; }
public frmFilterForPartsList(UniXP.Common.CProfile objProfile, UniXP.Common.MENUITEM objMenuItem, List <CProductSubType> objProductSubTypeList, List <CProductTradeMark> objProductTradeMarkList, List <CProductType> objProductTypeList) { m_objProfile = objProfile; m_objMenuItem = objMenuItem; m_objProductSubTypeList = objProductSubTypeList; m_objProductTradeMarkList = objProductTradeMarkList; m_objProductTypeList = objProductTypeList; SelectedProductSubTypeList = new List <CProductSubType>(); SelectedProductTradeMarkList = new List <CProductTradeMark>(); SelectedProductTypeList = new List <CProductType>(); InitializeComponent(); LoadSourceList(); }
/// <summary> /// Возвращает список состояний возвратной накладной /// </summary> /// <param name="objProfile">профайл</param> /// <param name="cmdSQL">SQL-команда</param> /// <param name="strErr">сообщение об ошибке</param> /// <returns>список состояний возвратной накладной</returns> public static List <CBackWaybillState> GetBackWaybillStateList(UniXP.Common.CProfile objProfile, ref System.String strErr) { List <CBackWaybillState> objList = new List <CBackWaybillState>(); try { // вызов статического метода из класса, связанного с БД System.Data.DataTable dtList = CBackWaybillStateDataBaseModel.GetBackWaybillStateList(objProfile, null, ref strErr); if (dtList != null) { CBackWaybillState objListItem = null; foreach (System.Data.DataRow objItem in dtList.Rows) { objListItem = new CBackWaybillState(); objListItem.ID = new Guid(System.Convert.ToString(objItem["BackWaybillState_Guid"])); objListItem.Name = ((objItem["BackWaybillState_Name"] == System.DBNull.Value) ? "" : System.Convert.ToString(objItem["BackWaybillState_Name"])); objListItem.Description = ((objItem["BackWaybillState_Description"] == System.DBNull.Value) ? "" : System.Convert.ToString(objItem["BackWaybillState_Description"])); objListItem.BackWaybillStateId = ((objItem["BackWaybillState_Id"] == System.DBNull.Value) ? 0 : System.Convert.ToInt32(System.Convert.ToString(objItem["BackWaybillState_Id"]))); if (objItem["BackWaybillState_IsActive"] != System.DBNull.Value) { objListItem.IsActive = System.Convert.ToBoolean(System.Convert.ToString(objItem["BackWaybillState_IsActive"])); } if (objItem["BackWaybillState_IsDefault"] != System.DBNull.Value) { objListItem.IsDefault = System.Convert.ToBoolean(System.Convert.ToString(objItem["BackWaybillState_IsDefault"])); } objList.Add(objListItem); } } dtList = null; } catch (System.Exception f) { strErr += (String.Format(" {0}", f.Message)); } return(objList); }
/// <summary> /// Добавить запись в БД /// </summary> /// <param name="objProfile">профайл</param> /// <returns>true - удачное завершение; false - ошибка</returns> public override System.Boolean Add(UniXP.Common.CProfile objProfile) { System.String strErr = ""; System.Guid GUID_ID = System.Guid.Empty; System.Boolean bRet = CBudgetProjectDataBaseModel.AddNewObjectToDataBase(this.Name, this.Description, this.IsActive, this.CodeIn1C, ref GUID_ID, objProfile, ref strErr); if (bRet == true) { this.ID = GUID_ID; } else { DevExpress.XtraEditors.XtraMessageBox.Show(strErr, "Внимание", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } return(bRet); }
public frmGroupProperties(UniXP.Common.CProfile objProfile) { InitializeComponent(); m_objProfile = objProfile; m_bNewGroup = false; m_objGroup = null; m_objConditionGroupTypList = CConditionGroupType.GetConditionGroupTypeList(m_objProfile, null); cboxGroupType.Properties.Items.Clear(); if (m_objConditionGroupTypList != null) { foreach (CConditionGroupType objGroupType in m_objConditionGroupTypList) { cboxGroupType.Properties.Items.Add(objGroupType); } } m_bGroupPropertiesIsChanged = false; m_bGroupStructureIsChanged = false; DialogResult = DialogResult.None; }
/// <summary> /// Отгрузка товара по накладной /// </summary> /// <param name="objProfile">Профайл</param> /// <param name="IntWaybill_Guid">УИ накладной на отгрузку</param> /// <param name="IntWaybill_ShipDate">Дата отгрузки</param> /// <param name="SetIntWaybillShipMode_Guid">УИ варианта отгрузки</param> /// <param name="IntWaybillState_Guid">УИ текущего состояния накладной</param> /// <param name="iErr">целочисленный код ошибки</param> /// <param name="strErr">текст ошибки</param> /// <returns>0 - накладная отгружена; <>0 - ошибка</returns> public static System.Int32 ShippedProductsByIntWaybill(UniXP.Common.CProfile objProfile, System.Guid IntWaybill_Guid, System.DateTime IntWaybill_ShipDate, System.Guid SetIntWaybillShipMode_Guid, ref System.Guid IntWaybillState_Guid, ref System.Int32 iErr, ref System.String strErr) { System.Int32 iRet = -1; try { iRet = CIntWaybillDataBaseModel.ShippedProductsByIntWaybill(objProfile, null, IntWaybill_Guid, IntWaybill_ShipDate, SetIntWaybillShipMode_Guid, ref IntWaybillState_Guid, ref iErr, ref strErr); } catch (System.Exception f) { strErr += ("\n" + f.Message); } finally { } return(iRet); }
/// <summary> /// Возвращает объект класса "Накладная на внутреннее перемещение" /// </summary> /// <param name="objProfile">профайл</param> /// <param name="Waybill_Guid">УИ накладной</param> /// <param name="strErr">текст ошибки</param> /// <returns>объект класса "Накладная"</returns> public static CIntWaybill GetWaybill(UniXP.Common.CProfile objProfile, System.Guid IntWaybill_Guid, ref System.String strErr) { CIntWaybill objWaybill = null; try { // вызов статического метода из класса, связанного с БД List <CIntWaybill> objList = CIntWaybill.GetWaybillList(objProfile, IntWaybill_Guid, System.DateTime.MinValue, System.DateTime.MinValue, System.Guid.Empty, System.Guid.Empty, System.Guid.Empty, System.Guid.Empty, System.Guid.Empty, ref strErr, false, false); if ((objList != null) && (objList.Count > 0)) { objWaybill = objList[0]; } objList = null; } catch (System.Exception f) { strErr += (String.Format("\nНе удалось получить информацию о накладной.\nТекст ошибки: {0}", f.Message)); } return(objWaybill); }
public ctrlAgreementWithCarrier(UniXP.Common.CProfile objProfile, UniXP.Common.MENUITEM objMenuItem) { InitializeComponent(); m_objProfile = objProfile; m_objMenuItem = objMenuItem; m_bIsChanged = false; m_bDisableEvents = false; m_bNewObject = false; m_objSelectedAgreement = null; m_objAgreementType = null; List <CAgreementType> objAgreementTypeList = CAgreementType.GetAgreementTypeList(m_objProfile, null); if (objAgreementTypeList != null) { m_objAgreementType = objAgreementTypeList.Single <CAgreementType>(x => x.Name == ERP_Mercury.Global.Consts.strAgreementWithCustomerTypeName); objAgreementTypeList = null; } LoadComboBoxItems(); m_bIsReadOnly = false; }
/// <summary> /// Возвращает список настроек /// </summary> /// <param name="objProfile">профайл</param> /// <param name="cmdSQL">SQL-команда</param> /// <returns>список настроек</returns> public static List <CSetting> GetSettingsList(UniXP.Common.CProfile objProfile, System.Data.SqlClient.SqlCommand cmdSQL) { List <CSetting> objList = new List <CSetting>(); System.Data.SqlClient.SqlConnection DBConnection = null; System.Data.SqlClient.SqlCommand cmd = null; try { if (cmdSQL == null) { DBConnection = objProfile.GetDBSource(); if (DBConnection == null) { DevExpress.XtraEditors.XtraMessageBox.Show( "Не удалось получить соединение с базой данных.", "Внимание", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); return(objList); } cmd = new System.Data.SqlClient.SqlCommand(); cmd.Connection = DBConnection; cmd.CommandType = System.Data.CommandType.StoredProcedure; } else { cmd = cmdSQL; cmd.Parameters.Clear(); } cmd.CommandText = System.String.Format("[{0}].[dbo].[sp_GetSettings]", objProfile.GetOptionsDllDBName()); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ERROR_NUM", System.Data.SqlDbType.Int, 8, System.Data.ParameterDirection.Output, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); cmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@ERROR_MES", System.Data.SqlDbType.NVarChar, 4000)); cmd.Parameters["@ERROR_MES"].Direction = System.Data.ParameterDirection.Output; System.Data.SqlClient.SqlDataReader rs = cmd.ExecuteReader(); if (rs.HasRows) { CSetting objSetting = null; System.Xml.XmlDocument docInfoAboutParam = null; CAdvancedParam objParam = null; System.Xml.XmlNode objRootNode = null; while (rs.Read()) { objSetting = new CSetting(); objSetting.ID = (System.Guid)rs["Settings_Guid"]; objSetting.Name = System.Convert.ToString(rs["Settings_Name"]); objSetting.ParamList = new List <CAdvancedParam>(); if (rs["Settings_XML"] != System.DBNull.Value) { docInfoAboutParam = new System.Xml.XmlDocument(); docInfoAboutParam.LoadXml(System.Convert.ToString(rs["Settings_XML"])); if ((docInfoAboutParam != null) && (docInfoAboutParam.ChildNodes.Count > 0)) { objSetting.xmldocAdvancedParamList = docInfoAboutParam; objRootNode = docInfoAboutParam.ChildNodes[0]; //objSetting.Name = objRootNode.Name; foreach (System.Xml.XmlNode objNode in objRootNode.ChildNodes) { //if (objNode.Name == "CommonParams") //{ foreach (System.Xml.XmlNode objChildNode in objNode.ChildNodes) { //if (objChildNode.Name == "Params") //{ foreach (System.Xml.XmlAttribute objAttribute in objChildNode.Attributes) { objParam = new CAdvancedParam(System.Guid.Empty, objAttribute.Name, "", new CParamDataType(0, "")); objParam.GroupName = objNode.Name; objParam.Value = objAttribute.Value; objSetting.ParamList.Add(objParam); } //} //} } } } } objList.Add(objSetting); } } rs.Dispose(); if (cmdSQL == null) { cmd.Dispose(); DBConnection.Close(); } } catch (System.Exception f) { DevExpress.XtraEditors.XtraMessageBox.Show( "Не удалось получить список настроек.\n\nТекст ошибки: " + f.Message, "Внимание", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } return(objList); }