public static void SaveArray(long docId, TypeOfAccessories typeOfAccessory, Dictionary<string, string> newElements)
 {
     foreach (KeyValuePair<string, string> element in newElements)
         {
         SaveItem(docId, typeOfAccessory, element.Key, element.Value);
         }
 }
        /// <summary>��������� ��������� �� ���������</summary>
        /// <param name="MainProcess"></param>
        /// <param name="barcode">�������� ��������������</param>
        /// <param name="type">��� ��������������</param>
        /// <param name="state">����� ������</param>
        public SetAccessoryNewState(WMSClient MainProcess, string barcode, TypeOfAccessories type, TypesOfLampsStatus state)
            : base(MainProcess, 1)
        {
            accessoryBarcode = barcode;
            typeOfAccessory = type;
            newState = state;

            IsLoad = true;
            DrawControls();
        }
        /// <summary>Прийомка з ...</summary>
        /// <param name="MainProcess"></param>
        /// <param name="type">Тип комплектуючого</param>
        public AcceptionSendingDocs(WMSClient MainProcess, TypeOfAccessories type)
            : base(MainProcess, 1)
        {
            rows = new Dictionary<string, DataRow>();
            accepted = new List<string>();

            typeOfAccessory = type;
            IsLoad = true;
            DrawControls();
        }
        /// <summary>Приемка нового коплектующего</summary>
        /// <param name="MainProcess"></param>
        /// <param name="topic">Заголовок</param>
        /// <param name="accessory">Тип комплектующего</param>
        public AcceptanceOfNewAccessory(WMSClient MainProcess, string topic, TypeOfAccessories accessory)
            : base(MainProcess, 1)
        {
            MainProcess.ToDoCommand = topic;
            FormNumber          = 1;
            BusinessProcessType = ProcessType.Registration;
            typeOfAccessory     = accessory;
            acceptanceDoc       = new AcceptanceOfNewComponents();

            IsLoad = true;
            DrawControls();
        }
        /// <summary>Приемка нового коплектующего</summary>
        /// <param name="MainProcess"></param>
        /// <param name="topic">Заголовок</param>
        /// <param name="accessory">Тип комплектующего</param>
        public AcceptanceOfNewAccessory(WMSClient MainProcess, string topic, TypeOfAccessories accessory)
            : base(MainProcess, 1)
        {
            MainProcess.ToDoCommand = topic;
            FormNumber = 1;
            BusinessProcessType = ProcessType.Registration;
            typeOfAccessory = accessory;
            acceptanceDoc = new AcceptanceOfNewComponents();

            IsLoad = true;
            DrawControls();
        }
 public static void SaveItem(long documentId, TypeOfAccessories typeOfAccessory, string barcode, string modelRef)
 {
     //todo: ��� ����� �� �������� ModelRef
     using (SqlCeCommand query = dbWorker.NewQuery(SAVE_QUERY))
         {
         query.AddParameter("DocumentId", documentId);
         query.AddParameter("TypeOfAccessory", (int)typeOfAccessory);
         query.AddParameter(dbObject.BARCODE_NAME, barcode);
         query.AddParameter("ModelRef", modelRef);
         query.ExecuteNonQuery();
         }
 }
Exemple #7
0
        /// <summary>Встановити новий статус</summary>
        /// <param name="accessory">Тип комплектуючого</param>
        /// <param name="newState">Новий статус</param>
        /// <param name="barcode">Штрихкод комплектуючого</param>
        public static void SetState(TypeOfAccessories accessory, TypesOfLampsStatus newState, string barcode)
        {
            string command = string.Format("UPDATE {0}s SET Status=@State WHERE RTRIM({1})=RTRIM(@{1})",
                                           accessory, BARCODE_NAME);

            using (SqlCeCommand query = dbWorker.NewQuery(command))
            {
                query.AddParameter("State", newState);
                query.AddParameter(BARCODE_NAME, barcode);
                query.ExecuteNonQuery();
            }
        }
        /// <summary>Прийомка з ...</summary>
        /// <param name="MainProcess"></param>
        /// <param name="topic">Заголовок</param>
        /// <param name="type">Тип комплектуючого</param>
        /// <param name="subTableName">Ім'я табличної частини</param>
        public AcceptionSendingDocs(WMSClient MainProcess, string topic, TypeOfAccessories type, string subTableName)
            : base(MainProcess, 1)
        {
            rows = new Dictionary<string, DataRow>();
            accepted = new List<string>();
            this.subTableName = subTableName;

            MainProcess.ToDoCommand = topic;
            typeOfAccessory = type;
            IsLoad = true;
            DrawControls();
        }
Exemple #9
0
        /// <summary>Чи містить корпус вказаний тип комплектуючого</summary>
        /// <param name="caseBarcode">Штрихкод корпусу</param>
        /// <param name="type">Тип комплектуючого</param>
        public static bool IsCaseHaveAccessory(string caseBarcode, TypeOfAccessories type)
            {
            string column = GetColumnOfAccessory(type);
            using (
                SqlCeCommand query =
                    dbWorker.NewQuery(string.Format("SELECT {0} FROM Cases WHERE BarCode=@BarCode", column)))
                {
                query.AddParameter("BarCode", caseBarcode);
                object result = query.ExecuteScalar();

                return result != null && Convert.ToInt64(result) != 0;
                }
            }
Exemple #10
0
        /// <summary>Отображение</summary>
        /// <param name="id">Id</param>
        /// <param name="typeOfAccessories">Тип комплектующего</param>
        private void showInfoById(long id, TypeOfAccessories typeOfAccessories)
        {
            MainProcess.ClearControls();

            ListOfLabelsConstructor list = new ListOfLabelsConstructor(MainProcess);
            string topic;
            Dictionary <string, KeyValuePair <Type, object> > listOfDetail;

            //Отображаем текстовое инфо о элементе
            list.ListOfLabels       = CatalogObject.GetVisualPresenter(id, typeOfAccessories, out topic, out listOfDetail);
            MainProcess.ToDoCommand = topic;
            //Отображаем кнопки для перехода на связанные элементы
            drawButtons(listOfDetail);
        }
Exemple #11
0
        public ReplacingAccessory(WMSClient MainProcess, object caseBarcode, object accessoryBarcode, bool replaceProcess, TypeOfAccessories type)
            : base(MainProcess, 1)
        {
            CaseBarcode = caseBarcode;
            NewAccessoryBarcode = accessoryBarcode;
            FormNumber = 1;
            BusinessProcessType = ProcessType.Registration;
            this.replaceProcess = replaceProcess;
            this.type = type;

            IsLoad = true;
            fillStr();
            DrawControls();
        }
Exemple #12
0
        /// <summary>Получить статус комплектующего</summary>
        /// <param name="accessory">Тип комплектующего</param>
        /// <param name="barcode">Штихкод</param>
        /// <returns>Статус комплектующего</returns>
        public static TypesOfLampsStatus GetState(TypeOfAccessories accessory, string barcode)
        {
            string command = string.Format("SELECT Status FROM {0}s WHERE RTRIM({1})=RTRIM(@{1})",
                                           accessory, BARCODE_NAME);

            using (SqlCeCommand query = dbWorker.NewQuery(command))
            {
                query.AddParameter(BARCODE_NAME, barcode);
                object statusObj    = query.ExecuteScalar();
                int    statusNumber = statusObj == null ? 0 : Convert.ToInt32(statusObj);

                return((TypesOfLampsStatus)statusNumber);
            }
        }
Exemple #13
0
        public ReplacingAccessory(WMSClient MainProcess, object caseBarcode, object accessoryBarcode, bool replaceProcess, TypeOfAccessories type)
            : base(MainProcess, 1)
        {
            CaseBarcode         = caseBarcode;
            NewAccessoryBarcode = accessoryBarcode;
            FormNumber          = 1;
            BusinessProcessType = ProcessType.Registration;
            this.replaceProcess = replaceProcess;
            this.type           = type;

            IsLoad = true;
            fillStr();
            DrawControls();
        }
Exemple #14
0
        /// <summary>Получить тип комплектующего со штрих-кода</summary>
        /// <param name="barcode">Штрих-код</param>
        /// <returns>Тип комплектующего</returns>
        public static TypeOfAccessories GetTypeOfAccessoriesByBarcode(string barcode)
        {
            using (SqlCeCommand query = dbWorker.NewQuery(string.Format(ACCESSORY_QUERY_COMMAND, "Type")))
            {
                query.AddParameter("Barcode", barcode);
                object result = query.ExecuteScalar();

                if (result != null)
                {
                    TypeOfAccessories type = (TypeOfAccessories)Convert.ToInt32(result);

                    return(type);
                }

                return(TypeOfAccessories.None);
            }
        }
Exemple #15
0
        /// <summary>ВСтановити статус комплектующего</summary>
        /// <param name="accessory">Тип комплектуючого</param>
        /// <param name="barcode">Штихкод</param>
        /// <param name="state">Новий статус</param>
        public static void SetNewState(TypeOfAccessories accessory, string barcode, TypesOfLampsStatus state)
        {
            if (accessory == TypeOfAccessories.Case)
            {
                Cases.ChangeLighterState(barcode, state, true);
            }

            string command = string.Format(
                "UPDATE {0}s SET Status=@{1} WHERE RTRIM({2})=RTRIM(@{2})",
                accessory, dbSynchronizer.PARAMETER, BARCODE_NAME);

            using (SqlCeCommand query = dbWorker.NewQuery(command))
            {
                query.AddParameter(BARCODE_NAME, barcode);
                query.AddParameter(dbSynchronizer.PARAMETER, state);
                query.ExecuteNonQuery();
            }
        }
Exemple #16
0
        /// <summary>Скан штрихкода для Эл.блока/Лампы</summary>
        /// <param name="Barcode">Штрихкод</param>
        public override void OnBarcode(string Barcode)
        {
            if (Barcode.IsValidBarcode())
            {
                //Скан ел.блоків?
                if (stage == Stages.ScanUnitBarcode)
                {
                    TypeOfAccessories accessory = BarcodeWorker.GetTypeOfAccessoriesByBarcode(Barcode);

                    //Чи використовується цей штрихкод?
                    if (accessory == TypeOfAccessories.None)
                    {
                        unitBarcode = Barcode;
                        stage       = Stages.ExtractionElectricUnit;
                        DrawControls();
                    }
                    else
                    {
                        MessageBox.Show("Штрихкод уже используеться!");
                    }
                }
                //Скан ламп?
                else if (stage == Stages.ScanLampBarcode)
                {
                    TypeOfAccessories accessory = BarcodeWorker.GetTypeOfAccessoriesByBarcode(Barcode);

                    //Чи використовується цей штрихкод?
                    if (accessory == TypeOfAccessories.None)
                    {
                        lampBarcode = Barcode;
                        stage       = Stages.ExtractionLamp;
                        DrawControls();
                    }
                    else
                    {
                        MessageBox.Show("Штрихкод уже используеться!");
                    }
                }
            }
        }
        public override void OnBarcode(string barcode)
        {
            if (barcode.Equals(AcceptingAfterFixing.START_ACCEPTING_AFTER_FIXING_BARCODE))
            {
                MainProcess.ClearControls();
                MainProcess.Process = new AcceptingAfterFixing(MainProcess);
            }
            else if (barcode.IsValidPositionBarcode())
            {
                tryPlacingLight(barcode);
            }
            else if (barcode.IsValidBarcode())
            {
                //Тип комплектуючого визначений за штрихкодом (якщо ШК відсутній, то тип = None)
                TypeOfAccessories type = BarcodeWorker.GetTypeOfAccessoriesByBarcode(barcode);

                //Перехід на відповідний процес відповідно до типу комплектуючого
                switch (type)
                {
                case TypeOfAccessories.Lamp:
                    lampProcess(barcode);
                    break;

                case TypeOfAccessories.ElectronicUnit:
                    unitProcess(barcode);
                    break;

                case TypeOfAccessories.Case:
                    caseProcess(barcode);
                    break;

                default:
                    ShowMessage("Не існує комплектуюче з таким штрихкодом!");
                    break;
                }
            }
        }
Exemple #18
0
        /// <summary>Получить визуальное представление (с информацией о элементах на которые возможны переходы)</summary>
        /// <param name="id">ID комплектующего</param>
        /// <param name="typeOfAccessories">Тип комплектующего</param>
        /// <param name="topic">Заголовок</param>
        /// <param name="listOfDetail">Словарь єлементов с детальной информацией</param>
        /// <returns>Список ...</returns>
        public static List <LabelForConstructor> GetVisualPresenter(long id, TypeOfAccessories typeOfAccessories, out string topic, out Dictionary <string, KeyValuePair <Type, object> > listOfDetail)
        {
            Accessory accessory = null;

            switch (typeOfAccessories)
            {
            case TypeOfAccessories.Lamp:
                accessory = new Lamps();
                accessory.Read <Lamps>(id);
                break;

            case TypeOfAccessories.Case:
                accessory = new Cases();
                accessory.Read <Cases>(id);
                break;

            case TypeOfAccessories.ElectronicUnit:
                accessory = new ElectronicUnits();
                accessory.Read <ElectronicUnits>(id);
                break;
            }

            return(GetVisualPresenter(typeOfAccessories, accessory, out topic, out listOfDetail));
        }
Exemple #19
0
        /// <summary>Отримати назву таблиці комплектуючого за типом</summary>
        /// <param name="type">Тип комплектуючого</param>
        /// <returns>Назва таблиці комплектуючого</returns>
        public static string GetTableNameForAccessory(TypeOfAccessories type)
            {
            Accessory accessory = null;

            switch (type)
                {
                case TypeOfAccessories.Lamp:
                    accessory = new Lamps();
                    break;
                case TypeOfAccessories.ElectronicUnit:
                    accessory = new ElectronicUnits();
                    break;
                case TypeOfAccessories.Case:
                    accessory = new Cases();
                    break;
                }

            if (accessory == null)
                {
                throw new Exception("Не знайдено тип комплектуючого!");
                }

            return accessory.GetType().Name;
            }
Exemple #20
0
        /// <summary>�������� ���������� ������������� (� ����������� � ��������� �� ������� �������� ��������)</summary>
        /// <param name="typeOfAccessories">��� ��������������</param>
        /// <param name="accessory">������</param>
        /// <param name="topic">���������</param>
        /// <param name="listOfDetail">������� ��������� � ��������� �����������</param>
        /// <returns>������ ...</returns>
        public static List<LabelForConstructor> GetVisualPresenter(TypeOfAccessories typeOfAccessories, Accessory accessory, out string topic, out Dictionary<string, KeyValuePair<Type, object>> listOfDetail)
        {
            topic = Cases.GetDescriptionOfAccessory(typeOfAccessories);
            listOfDetail = new Dictionary<string, KeyValuePair<Type, object>>();
            List<LabelForConstructor> list = new List<LabelForConstructor>();

            bool notCase = (typeOfAccessories == TypeOfAccessories.ElectronicUnit ||
                            typeOfAccessories == TypeOfAccessories.Lamp);
            if (accessory != null)
                {
                Type type = accessory.GetType();
                PropertyInfo[] fields = type.GetProperties();

                if (notCase)
                    {
                    listOfDetail.Add("������", new KeyValuePair<Type, object>(typeof(Cases), CatalogHelper.FindCaseId(accessory.Id, typeOfAccessories)));
                    }

                foreach (PropertyInfo field in fields)
                    {
                    if (notCase && field.Name == "Case")
                        {
                        continue;
                        }
                    Attribute[] attributes = Attribute.GetCustomAttributes(field);

                    foreach (Attribute a in attributes)
                        {
                        dbFieldAtt attribute = a as dbFieldAtt;

                        if (attribute != null)
                            {
                            if (attribute.NeedDetailInfo)
                                {
                                object value = field.GetValue(accessory, null);
                                listOfDetail.Add(attribute.Description, new KeyValuePair<Type, object>(attribute.dbObjectType, value));
                                }
                            else if (!attribute.NotShowInForm || attribute.ShowEmbadedInfo)
                                {
                                object value = field.GetValue(accessory, null);

                                if (attribute.dbObjectType == null)
                                    {
                                    if (field.PropertyType == typeof(DateTime))
                                        {
                                        DateTime dateValue = (DateTime)value;

                                        value = dateValue != SqlDateTime.MinValue.Value
                                                    ? String.Format("{0:dd.MM.yyyy}", dateValue)
                                                    : string.Empty;
                                        }
                                    else if (field.PropertyType.IsEnum)
                                        {
                                        value = EnumWorker.GetDescription(field.PropertyType, Convert.ToInt32(value));
                                        }
                                    else if (field.PropertyType == typeof(bool))
                                        {
                                        value = (bool)value ? "+" : "-";
                                        }
                                    }
                                else
                                    {
                                    if (attribute.ShowEmbadedInfo)
                                        {
                                        dbObject detailObject = (dbObject)Activator.CreateInstance(attribute.dbObjectType);
                                        detailObject = (dbObject)detailObject.Read(attribute.dbObjectType, value, IDENTIFIER_NAME);
                                        Dictionary<string, KeyValuePair<Type, object>> subListOfDetail;
                                        List<LabelForConstructor> subList = GetSingleVisualPresenter(
                                            attribute.dbObjectType, out subListOfDetail, detailObject, false);

                                        list.AddRange(subList);
                                        }

                                    if (!attribute.NotShowInForm)
                                        {
                                        value = ReadDescription(attribute.dbObjectType, value);
                                        }
                                    }

                                string data = String.Format("{0}: {1}", attribute.Description, value);

                                list.Add(new LabelForConstructor(data, ControlsStyle.LabelSmall, false));
                                break;
                                }
                            }
                        }
                    }
                }

            return list;
        }
Exemple #21
0
        /// <summary>�������� ���������� ������������� (� ����������� � ��������� �� ������� �������� ��������)</summary>
        /// <param name="id">ID ��������������</param>
        /// <param name="typeOfAccessories">��� ��������������</param>
        /// <param name="topic">���������</param>
        /// <param name="listOfDetail">������� ��������� � ��������� �����������</param>
        /// <returns>������ ...</returns>
        public static List<LabelForConstructor> GetVisualPresenter(long id, TypeOfAccessories typeOfAccessories, out string topic, out Dictionary<string, KeyValuePair<Type, object>> listOfDetail)
        {
            Accessory accessory = null;

            switch (typeOfAccessories)
                {
                case TypeOfAccessories.Lamp:
                    accessory = new Lamps();
                    accessory.Read<Lamps>(id);
                    break;
                case TypeOfAccessories.Case:
                    accessory = new Cases();
                    accessory.Read<Cases>(id);
                    break;
                case TypeOfAccessories.ElectronicUnit:
                    accessory = new ElectronicUnits();
                    accessory.Read<ElectronicUnits>(id);
                    break;
                }

            return GetVisualPresenter(typeOfAccessories, accessory, out topic, out listOfDetail);
        }
Exemple #22
0
        /// <summary>Получить визуальное представление (с информацией о элементах на которые возможны переходы)</summary>
        /// <param name="typeOfAccessories">Тип комплектующего</param>
        /// <param name="accessory">Объект</param>
        /// <param name="topic">Заголовок</param>
        /// <param name="listOfDetail">Словарь єлементов с детальной информацией</param>
        /// <returns>Список ...</returns>
        public static List <LabelForConstructor> GetVisualPresenter(TypeOfAccessories typeOfAccessories, Accessory accessory, out string topic, out Dictionary <string, KeyValuePair <Type, object> > listOfDetail)
        {
            topic        = Cases.GetDescriptionOfAccessory(typeOfAccessories);
            listOfDetail = new Dictionary <string, KeyValuePair <Type, object> >();
            List <LabelForConstructor> list = new List <LabelForConstructor>();

            bool notCase = (typeOfAccessories == TypeOfAccessories.ElectronicUnit ||
                            typeOfAccessories == TypeOfAccessories.Lamp);

            if (accessory != null)
            {
                Type           type   = accessory.GetType();
                PropertyInfo[] fields = type.GetProperties();

                if (notCase)
                {
                    listOfDetail.Add("Корпус", new KeyValuePair <Type, object>(typeof(Cases), CatalogHelper.FindCaseId(accessory.Id, typeOfAccessories)));
                }

                foreach (PropertyInfo field in fields)
                {
                    if (notCase && field.Name == "Case")
                    {
                        continue;
                    }
                    Attribute[] attributes = Attribute.GetCustomAttributes(field);

                    foreach (Attribute a in attributes)
                    {
                        dbFieldAtt attribute = a as dbFieldAtt;

                        if (attribute != null)
                        {
                            if (attribute.NeedDetailInfo)
                            {
                                object value = field.GetValue(accessory, null);
                                listOfDetail.Add(attribute.Description, new KeyValuePair <Type, object>(attribute.dbObjectType, value));
                            }
                            else if (!attribute.NotShowInForm || attribute.ShowEmbadedInfo)
                            {
                                object value = field.GetValue(accessory, null);

                                if (attribute.dbObjectType == null)
                                {
                                    if (field.PropertyType == typeof(DateTime))
                                    {
                                        DateTime dateValue = (DateTime)value;

                                        value = dateValue != SqlDateTime.MinValue.Value
                                                    ? String.Format("{0:dd.MM.yyyy}", dateValue)
                                                    : string.Empty;
                                    }
                                    else if (field.PropertyType.IsEnum)
                                    {
                                        value = EnumWorker.GetDescription(field.PropertyType, Convert.ToInt32(value));
                                    }
                                    else if (field.PropertyType == typeof(bool))
                                    {
                                        value = (bool)value ? "+" : "-";
                                    }
                                }
                                else
                                {
                                    if (attribute.ShowEmbadedInfo)
                                    {
                                        dbObject detailObject = (dbObject)Activator.CreateInstance(attribute.dbObjectType);
                                        detailObject = (dbObject)detailObject.Read(attribute.dbObjectType, value, IDENTIFIER_NAME);
                                        Dictionary <string, KeyValuePair <Type, object> > subListOfDetail;
                                        List <LabelForConstructor> subList = GetSingleVisualPresenter(
                                            attribute.dbObjectType, out subListOfDetail, detailObject, false);

                                        list.AddRange(subList);
                                    }

                                    if (!attribute.NotShowInForm)
                                    {
                                        value = ReadDescription(attribute.dbObjectType, value);
                                    }
                                }

                                string data = String.Format("{0}: {1}", attribute.Description, value);

                                list.Add(new LabelForConstructor(data, ControlsStyle.LabelSmall, false));
                                break;
                            }
                        }
                    }
                }
            }

            return(list);
        }
Exemple #23
0
        /// <summary>�������� ����� ������� �������������� �� �����</summary>
        /// <param name="type">��� ��������������</param>
        /// <returns>����� ������� ��������������</returns>
        public static string GetTableNameForAccessory(TypeOfAccessories type)
        {
            Accessory accessory = null;

            switch (type)
                {
                case TypeOfAccessories.Lamp:
                    accessory = new Lamps();
                    break;
                case TypeOfAccessories.ElectronicUnit:
                    accessory = new ElectronicUnits();
                    break;
                case TypeOfAccessories.Case:
                    accessory = new Cases();
                    break;
                }

            if (accessory == null)
                {
                throw new Exception("�� �������� ��� ��������������!");
                }

            return accessory.GetType().Name;
        }
Exemple #24
0
        /// <summary>�� ������ ������ �������� ��� ��������������</summary>
        /// <param name="caseBarcode">�������� �������</param>
        /// <param name="type">��� ��������������</param>
        public static bool IsCaseHaveAccessory(string caseBarcode, TypeOfAccessories type)
        {
            string column = GetColumnOfAccessory(type);
            using (
                SqlCeCommand query =
                    dbWorker.NewQuery(string.Format("SELECT {0} FROM Cases WHERE BarCode=@BarCode", column)))
                {
                query.AddParameter("BarCode", caseBarcode);
                object result = query.ExecuteScalar();

                return result != null && Convert.ToInt64(result) != 0;
                }
        }
Exemple #25
0
 /// <summary>Отримати опис комплектуючого за типом</summary>
 /// <param name="type">Тип комплектуючого</param>
 /// <returns>Опис комплектуючого</returns>
 public static string GetDescriptionOfAccessory(TypeOfAccessories type)
     {
     return EnumWorker.GetDescription(typeof(TypeOfAccessories), (int)type);
     }
Exemple #26
0
 /// <summary>Отримати назву колонки по типу</summary>
 /// <param name="type">Тип комплектуючого</param>
 /// <returns>Назва колонки комплектуючого</returns>
 public static string GetColumnOfAccessory(TypeOfAccessories type)
     {
     return type.ToString();
     }
Exemple #27
0
        /// <summary>���������� ��� ��������� ������ � "����������"</summary>
        /// <param name="accessory">��� ��������������</param>
        /// <param name="caseBarcode">�������� �������</param>
        /// <param name="barcode">�������� ��������������</param>
        /// <param name="syncRef">SyncRef ��������������</param>
        /// <returns>�� ������� ����� ��� �������������� � ������ ������</returns>
        public static bool GetMovementInfo(TypeOfAccessories accessory, string caseBarcode, out string barcode, out string syncRef)
        {
            string command = string.Format(@"
            SELECT s.{0}, s.{1}
            FROM Cases c
            JOIN {2}s s ON s.Id=c.{2}
            WHERE RTRIM(c.{0})=RTRIM(@{0})",
                 BARCODE_NAME,
                 SYNCREF_NAME,
                 accessory.ToString());
            using (SqlCeCommand query = dbWorker.NewQuery(command))
                {
                query.AddParameter(BARCODE_NAME, caseBarcode);
                SqlCeDataReader reader = query.ExecuteReader();

                if (reader != null && reader.Read())
                    {
                    barcode = reader[BARCODE_NAME].ToString();
                    syncRef = reader[SYNCREF_NAME].ToString();
                    return true;
                    }

                barcode = string.Empty;
                syncRef = string.Empty;
                return false;
                }
        }
Exemple #28
0
 /// <summary>�������� ���� �������������� �� �����</summary>
 /// <param name="type">��� ��������������</param>
 /// <returns>���� ��������������</returns>
 public static string GetDescriptionOfAccessory(TypeOfAccessories type)
 {
     return EnumWorker.GetDescription(typeof(TypeOfAccessories), (int)type);
 }
Exemple #29
0
 /// <summary>�������� ����� ������� �� ����</summary>
 /// <param name="type">��� ��������������</param>
 /// <returns>����� ������� ��������������</returns>
 public static string GetColumnOfAccessory(TypeOfAccessories type)
 {
     return type.ToString();
 }
Exemple #30
0
        /// <summary>�����������</summary>
        /// <param name="id">Id</param>
        /// <param name="typeOfAccessories">��� ��������������</param>
        private void showInfoById(long id, TypeOfAccessories typeOfAccessories)
        {
            MainProcess.ClearControls();

            ListOfLabelsConstructor list = new ListOfLabelsConstructor(MainProcess);
            string topic;
            Dictionary<string, KeyValuePair<Type, object>> listOfDetail;

            //���������� ��������� ���� � ��������
            list.ListOfLabels = CatalogObject.GetVisualPresenter(id, typeOfAccessories, out topic, out listOfDetail);
            MainProcess.ToDoCommand = topic;
            //���������� ������ ��� �������� �� ��������� ��������
            drawButtons(listOfDetail);
        }