コード例 #1
0
ファイル: LDAP.cs プロジェクト: njmube/LogProSubVersionado
        public static IList <ShowData> GetCustomersList()
        {
            //Variables Auxiliares
            IList <ShowData> CustomerList = new List <ShowData>();
            ShowData         Customer;
            IList <Location> ListadoClientes;
            DaoFactory       factory = new DaoFactory();

            //Obtenemos el listado de clientes habilitados, Status = 1001
            ListadoClientes = factory.DaoLocation().Select(new Location {
                Status = new Status {
                    StatusID = 1001
                }
            });

            //Recorro el listado de clientes y creo el listado
            foreach (Location Cliente in ListadoClientes)
            {
                //Inicializo la variable del cliente
                Customer = new ShowData();

                //Asigno los datos
                Customer.DataKey   = Cliente.Name;
                Customer.DataValue = Cliente.LocationID.ToString();

                //Adicionamos el cliente al listado
                CustomerList.Add(Customer);
            }

            return(CustomerList);
        }
コード例 #2
0
    private void Update()
    {
        string message = "Detected: ";

        List <ShowData> removeList = new List <ShowData>();

        for (int i = 0; i < DataList.Count; i++)
        {
            ShowData data = DataList[i];
            message += data.text + ", ";
            float time = data.time;
            time -= Time.deltaTime;
            if (time <= 0.0f)
            {
                removeList.Add(data);
            }
            data.time   = time;
            DataList[i] = data;
        }

        m_Text.text = message;

        foreach (ShowData data in removeList)
        {
            DataList.Remove(data);
        }
    }
コード例 #3
0
        public static bool ReadMenuTypes(string menuOption)
        {
            Console.Clear();
            Console.WriteLine();
            Console.WriteLine();

            switch (menuOption)
            {
            case "1":
                Console.WriteLine(" ----- Cadastro de tipo de plano ----- ");
                Console.WriteLine();
                Console.WriteLine();
                Console.Write("Nome do Tipo de plano: ");
                Console.WriteLine();
                Program.listTypes.AddType(new Types(Console.ReadLine()));
                Console.WriteLine();
                Console.WriteLine("Tecle enter para continuar . . .");
                Console.ReadLine();
                break;

            case "2":
                Console.WriteLine(" ----- Remoção de tipo de plano por ID ----- ");
                Console.WriteLine();
                Console.WriteLine();
                Console.Write("Insira o id do Tipo de plano desajado: ");
                Console.WriteLine();
                Program.listTypes.RemoveType(Console.ReadLine());
                Console.WriteLine();
                Console.WriteLine("Tecle enter para continuar . . .");
                Console.ReadLine();
                break;

            case "3":
                Console.WriteLine(" ----- Editar tipo de plano por ID ----- ");
                Console.WriteLine();
                Console.WriteLine();
                Console.Write("Insira o id do Tipo de plano desajado: ");
                Program.listTypes.UpdateType(Program.listTypes.GetTypeById(Console.ReadLine()));
                Console.WriteLine();
                Console.WriteLine();
                Console.WriteLine("Tecle enter para continuar . . .");
                Console.ReadLine();
                break;

            case "4":
                Console.WriteLine(" ----- Exibição de tipos de plano ----- ");
                Console.WriteLine();
                Console.WriteLine();
                ShowData.ShowPlanTypesList();
                Console.WriteLine();
                Console.WriteLine("Tecle enter para continuar . . .");
                Console.Read();
                break;

            case "0":
                return(false);
            }

            return(true);
        }
コード例 #4
0
ファイル: HUDTextManager.cs プロジェクト: floatyears/Decrypt
 private void Show(ShowData data)
 {
     if (data == null || data.actor == null)
     {
         return;
     }
     switch (data.showType)
     {
     case EShowType.EST_Text:
         data.actor.UIText.AddText(data.text, data.type);
         break;
     case EShowType.EST_Damage:
         data.actor.UIText.AddDamage(data.value, data.type);
         break;
     case EShowType.EST_SkillDamage:
         data.actor.UIText.AddSkillDamage(data.value);
         break;
     case EShowType.EST_CriticalDamage:
         data.actor.UIText.AddCriticalDamage(data.value);
         break;
     case EShowType.EST_Heal:
         data.actor.UIText.AddHeal(data.value);
         break;
     }
 }
コード例 #5
0
        public async Task <ShowData> GetShow(string showId, string date)
        {
            var showInfo =
                State.ShowInformation.FirstOrDefault(si => si.BaseShowId == showId && si.Dates.Contains(date));

            if (showInfo == null)
            {
                return(null);
            }

            var id = $"{showId}:{date.Replace("/", "")}";

            var grain       = this.GrainFactory.GetGrain <ITicketsReserved>(id);
            var ticketCount = await grain.GetTicketCount();

            if (ticketCount == 0)
            {
                await grain.InitialiseTickets(showInfo.SeatingAllocation);
            }

            var tickets = await grain.GetAllTickets();

            var showData = new ShowData
            {
                ShowName       = showInfo.Name,
                ShowId         = id,
                Date           = date,
                SeatAllocation = showInfo.SeatingAllocation,
                Tickets        = tickets
            };


            return(showData);
        }
コード例 #6
0
    // Use this for initialization
    void Awake()
    {
        isDisplay = false;
        GameObject temp = GameObject.FindWithTag("DataManager");

        dataManager = temp.GetComponent <ShowData>();
    }
コード例 #7
0
        private void cboExtIPS_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (cboExtIPS.SelectedItem == null)
            {
                return;
            }

            ShowData showD = cboExtIPS.SelectedItem as ShowData;

            dtmIPS.SelectedDate = DateTime.Parse(showD.DataKey);


            ShowData portAndVoyage = ((ShowData)cboExtIPS.SelectedItem);

            string[] data = portAndVoyage.DataValue.Split(">>".ToCharArray());

            try
            {
                if (portAndVoyage != null)
                {
                    rPort.Text   = data[2].Trim();
                    rVoyage.Text = data[4].Trim();
                }
            }
            catch { }
        }
コード例 #8
0
ファイル: Customer.cs プロジェクト: timfeskens/Cinema
        public static string selectTime(Tuple <List <DateTime>, List <int>, List <int> > date)
        {
            string CustomerReserve;

            while (true)
            {
                ShowData SD = new ShowData();
                try
                {
                    Console.WriteLine("\nPlease enter the number or word that stands before the time you want to reserve or action you want to do");
                    CustomerReserve = Console.ReadLine();
                    if (CustomerReserve == "exit")
                    {
                        Console.Clear();
                        break;
                    }
                    else if (Convert.ToInt32(CustomerReserve) >= date.Item1.Count + 1 || Convert.ToInt32(CustomerReserve) < 1)
                    {
                        SD.ErrorMessage("\nPlease enter an option that exists");
                    }
                    else
                    {
                        break;
                    }
                }
                catch (FormatException)
                {
                    SD.ErrorMessage("\nPlease enter an option that exists");
                }
            }
            return(CustomerReserve);
        }
コード例 #9
0
        void DataCommand(object parameter)
        {
            String que = "SELECT * FROM " + SelectedTableName.Name;

            if (SelectedAttribute.Name.Length > 0 && TextSearch.Length > 0)
            {
                que += " WHERE " + SelectedAttribute.Name + " LIKE \'%" + TextSearch.Replace(",", ".") + "%\' ";
            }

            DatabaseModel DataModel = new DatabaseModel();

            try
            {
                if (SelectedTableName.Name == "BRON_W_MAGAZYNIE")
                {
                    IEnumerable <User_Bron> Table = DataModel.Query <User_Bron>(sql_query: que);
                    ShowData DataWindow           = new ShowData(Table, 0);
                    DataWindow.Show();
                }
                else
                {
                    IEnumerable <User_Ammo> Table = DataModel.Query <User_Ammo>(sql_query: que);
                    ShowData DataWindow           = new ShowData(Table, 0);
                    DataWindow.Show();
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
コード例 #10
0
        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            try
            {
                object value = objectProvider.GetObject();
                if (Type.GetTypeCode(value.GetType()) == TypeCode.String)
                {
                    string message = value as string;
                    MessageBox.Show(message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                DataTable dataTable = value as DataTable;
                if (dataTable == null)
                {
                    return;
                }

                using (ShowData dialog = new ShowData(dataTable))
                {
                    dialog.ShowDialog();
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
コード例 #11
0
        public virtual TData Add(TData buff)
        {
            if (!SelfBaseUnit.IsLive)
            {
                return(null);
            }
            TData     newBuff   = null;
            BuffGroup buffGroup = null;

            //有buff组的buff叠加
            if (!string.IsNullOrEmpty(buff.BuffGroupID))
            {
                if (!Data.ContainsKey(buff.BuffGroupID))
                {
                    var tempGroup = new BuffGroup();
                    Data.Add(buff.BuffGroupID, tempGroup);
                    ListData.Add(tempGroup);
                    //没有隐藏的buff加入显示队列
                    if (!buff.IsHide)
                    {
                        ShowData.Add(tempGroup);
                    }
                    //非永久buff加入 update队列
                    if (buff.IsHaveMaxTime)
                    {
                        UpdateData.Add(tempGroup);
                    }
                }
                buffGroup = Data[buff.BuffGroupID];
                newBuff   = buffGroup.Add(buff, SelfBaseUnit);
            }
            //没有buff组的buff合并
            else
            {
                if (!Data.ContainsKey(buff.TDID))
                {
                    var tempGroup = new BuffGroup();
                    Data.Add(buff.TDID, tempGroup);
                    ListData.Add(tempGroup);
                    //没有隐藏的buff加入显示队列
                    if (!buff.IsHide)
                    {
                        ShowData.Add(tempGroup);
                    }
                    //非永久buff加入 update队列
                    if (buff.IsHaveMaxTime)
                    {
                        UpdateData.Add(tempGroup);
                    }
                }
                buffGroup = Data[buff.TDID];
                newBuff   = buffGroup.Merge(buff, SelfBaseUnit);
            }
            if (BaseGlobal.IsUnReadData)
            {
                Callback_OnBuffChange?.Invoke();
            }
            return(newBuff);
        }
コード例 #12
0
        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.listView1.SelectedItems.Count > 0)
            {
                if (this.listView1.SelectedItems[0].Tag is SensorDeviceUnit)
                {
                    //this.txtId.Text = (this.listView1.SelectedItems[0].Tag as SensorDeviceUnit).ID.ToString();

                    this.txtName.Text            = this.listView1.SelectedItems[0].SubItems[1].Text;
                    collectDeviceId              = (this.listView1.SelectedItems[0].Tag as SensorDeviceUnit).ID;
                    this.cbModularDevice.Text    = this.listView1.SelectedItems[0].SubItems[2].Text;
                    this.cbSensor.Text           = this.listView1.SelectedItems[0].SubItems[3].Text;
                    this.txtFunction.Text        = this.listView1.SelectedItems[0].SubItems[4].Text;
                    this.txtOriginalValue.Text   = this.listView1.SelectedItems[0].SubItems[5].Text;
                    this.txtShowValue.Text       = this.listView1.SelectedItems[0].SubItems[6].Text;
                    this.txtProccessedValue.Text = this.listView1.SelectedItems[0].SubItems[7].Text;
                    //this.txtUpdateTime.Text = this.listView1.SelectedItems[0].SubItems[8].Text;
                    this.txtRegisterSize.Text    = this.listView1.SelectedItems[0].SubItems[9].Text;
                    this.txtRegisterAddress.Text = this.listView1.SelectedItems[0].SubItems[10].Text;
                    this.txtLocation.Text        = this.listView1.SelectedItems[0].SubItems[11].Text;
                    //this.txtRemark.Text = this.listView1.SelectedItems[0].SubItems[11].Text;

                    //显示数据列表的改变事件
                    List <ShowData> showDataLsit =
                        ShowData.FindAllBySensorDeviceUnitID(
                            (this.listView1.SelectedItems[0].Tag as SensorDeviceUnit).ID);

                    if (showDataLsit == null || showDataLsit.Count == 0)
                    {
                        foreach (ListViewItem item in this.lstShowData.Items)
                        {
                            item.Checked = false;
                        }

                        return;
                    }
                    else
                    {
                        foreach (ListViewItem item in this.lstShowData.Items)
                        {
                            var isExists = false;
                            foreach (var showData in showDataLsit)
                            {
                                var sD = item.Tag as ShowData;
                                if (sD != null)
                                {
                                    if (sD.ID == showData.ID)
                                    {
                                        isExists = true;
                                    }
                                }
                            }

                            item.Checked = isExists;
                        }
                    }
                }
            }
        }
コード例 #13
0
 public void SendMask(string strMask)
 {
     if (CurState == OptStatus.RUNNING_HAVEMASK)
     {
         ShowData.GetInstance().MaskCode = strMask;
         ResetEvent.Set();
     }
 }
コード例 #14
0
ファイル: Facade.cs プロジェクト: AlexandrBerbat/ex27.08
 public Facade(ShowData A, AddData E, EditData B, DeleteData C, DefaultInquiries D, SqlConnection conn)
 {
     ShowData1   = A;
     AddData1    = E;
     EditData1   = B;
     DeleteData1 = C;
     DefaultInq  = D;
     connection  = conn;
 }
コード例 #15
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            //if (this.txtPosition.Text.Trim().IsNullOrWhiteSpace())
            //{
            //    MessageBox.Show("位置不能为空,请输入");
            //    this.txtPosition.Focus();
            //    return;
            //}

            if (this.showDataId != 0)
            {
                try
                {
                    // 更新
                    var ShowData = new ShowData
                    {
                        ID = this.showDataId,
                        //ID =Convert.ToInt32( this.txtId.Text),
                        Position           = Convert.ToInt32(this.txtPosition.Text.Trim()),
                        ShowDeviceID       = Convert.ToInt32(this.cbShowDevice.SelectedValue),
                        SensorDeviceUnitID = Convert.ToInt32(this.cbSensorDeviceUnit.SelectedValue),
                        Remark             = this.txtRemark.Text.Trim()
                    };
                    ShowData.Update(ShowData);
                    MessageBox.Show("更新成功");
                }
                catch (Exception ex)
                {
                    XTrace.WriteException(ex);
                    MessageBox.Show("更新失败");
                }
            }
            else
            {
                try
                {
                    // 保存
                    var ShowData = new ShowData
                    {
                        //ID = Convert.ToInt32(this.txtId.Text),
                        Position           = Convert.ToInt32(this.txtPosition.Text.Trim()),
                        ShowDeviceID       = Convert.ToInt32(this.cbShowDevice.SelectedValue),
                        SensorDeviceUnitID = Convert.ToInt32(this.cbSensorDeviceUnit.SelectedValue),
                        Remark             = this.txtRemark.Text.Trim()
                    };
                    ShowData.Save(ShowData);
                    MessageBox.Show("保存成功");
                }
                catch (Exception ex)
                {
                    XTrace.WriteException(ex);
                    MessageBox.Show("保存失败");
                }
            }

            this.InitShowDataListView();
        }
コード例 #16
0
    protected void Button1_Click1(object sender, EventArgs e)
    {
        hostelop h  = new hostelop();
        DataSet  ds = h.dbselect(Places.Text);

        ShowData.DataSource = ds;
        ShowData.DataMember = "hostel";
        ShowData.DataBind();
    }
コード例 #17
0
 private void DeleteSelectedItem()
 {
     if (SelectedShowItem != null)
     {
         ShowData.DeleteItem(SelectedShowItem);
         listViewShowItems.Items.RemoveAt(listViewShowItems.SelectedIndices[0]);
     }
     CheckButtons();
 }
コード例 #18
0
        public static void Main(string[] args)
        {
            bool programOn = true;

            while (programOn)
            {
                programOn = ShowData.showMenu();
            }
        }
コード例 #19
0
        private void buttonAddItem_Click(object sender, EventArgs e)
        {
            ShowItem item = ShowData.AddItem(currentShowItemType, "New Item");

            item.ItemType = currentShowItemType;
            item.Action   = ActionType.Sequence;
            ListViewItem lvItem = AddItemToList(item);

            lvItem.Selected = true;
        }
コード例 #20
0
ファイル: HUDTextManager.cs プロジェクト: floatyears/Decrypt
 public void RequestShow(ActorController actor, EShowType showType, int value = 0, string text = null, int type = 0)
 {
     ShowData showData = new ShowData();
     showData.actor = actor;
     showData.showType = showType;
     showData.type = type;
     showData.value = value;
     showData.text = text;
     this.textLists.Add(showData);
 }
コード例 #21
0
        void ViewRepPack_ChangeSelector(object sender, DataEventArgs <ShowData> e)
        {
            if (e.Value == null)
            {
                return;
            }

            ReplenishSelector = e.Value;
            LoadRepPack(ViewRepPack.Model.CurLocation);
        }
コード例 #22
0
        private void LoadDocuments()
        {
            //Filtro del Date Time
            ShowData xDateTime = View.CboDate.SelectedItem as ShowData;
            DateTime?curDate   = null;

            if (xDateTime != null && xDateTime.DataKey != "")
            {
                curDate = (DateTime?)Convert.ToDateTime(xDateTime);
            }

            //if (curDate == null)
            //{
            //    Util.ShowError("La Fecha de Despacho es obligatoria en la consulta.");
            //    return;
            //}

            ShippingMethod curMethod = View.CboRoute.SelectedItem == null ? null : (ShippingMethod)View.CboRoute.SelectedItem;


            double TotWeight = 0, TotVolume = 0;


            View.Model.DocumentList = service.GetPendingDocument(
                new Document
            {
                DocType        = docType,
                ShippingMethod = curMethod,
                Company        = App.curCompany,
                Date2          = curDate,
                //Location = App.curLocation
                Location = (Location)View.CboLocation.SelectedItem
            }, 0, 0)
                                      .Where(f => f.QuoteNumber != "P" && f.QuoteNumber != "M")
                                      .ToList();


            foreach (Document dx in View.Model.DocumentList)
            {
                dx.AllowPartial = true;

                //TOTALES
                TotWeight += dx.DocWeight;
                TotVolume += dx.DocVolume;
            }


            View.Model.TotalList = new List <DocumentLine>()
            {
                new DocumentLine {
                    LineWeight = TotWeight,
                    LineVolume = TotVolume
                }
            };
        }
コード例 #23
0
        public void Menu()
        {
            ShowData SD         = new ShowData();
            bool     checkLogin = true;

            Console.Clear();
            SHA256 encrypter = SHA256.Create();

            while (checkLogin == true)
            {
                Console.WriteLine("\nGive your Username[CaseSenSiTive] or enter [exit] to return to the menu");
                string Username = Console.ReadLine();
                if (Username == "exit")
                {
                    break;
                }
                else if (Username.Contains(" "))
                {
                    Console.WriteLine("You are not using the right format!");
                }
                else
                {
                    Console.WriteLine("Fill in your Password[CaseSenSiTive] or enter [exit] to return to the menu");
                    string Password = Console.ReadLine();
                    if (Password == "exit")
                    {
                        break;
                    }
                    else if (Username.Contains(" "))
                    {
                        Console.WriteLine("You are not using the right format!");
                    }
                    else
                    {
                        ChangeData logincheck = new ChangeData();

                        string encryptedusername = sha256_hash(Username);
                        string encryptedpassword = sha256_hash(Password);

                        string checkeddata = logincheck.checkLoginAndFunction(encryptedusername, encryptedpassword);

                        if (checkeddata != "")
                        {
                            Function   = checkeddata;
                            checkLogin = false;
                        }
                        else
                        {
                            SD.ClearAndErrorMessage("\nWrong Username/Password");
                        }
                    }
                }
            }
        }
コード例 #24
0
 public ShowData(ShowData old)
 {
     I      = old.I;
     Start  = old.Start;
     End    = old.End;
     Action = old.Action;
     Title  = old.Title;
     //ID = old.ID;
     Color       = old.Color;
     IsCatchFish = old.IsCatchFish;
 }
コード例 #25
0
        public void SetRepPacking(IUC_IV_Replanish_PackingView view)
        {
            this.ViewRepPack = view;

            ViewRepPack.Model = this.container.Resolve <UC_IV_Model>();

            //DocType
            ViewRepPack.Model.DocType = service.GetDocumentType(new DocumentType {
                DocTypeID = SDocType.ReplenishPackTask
            }).FirstOrDefault();

            //Events
            ViewRepPack.ProcessReplenish  += new EventHandler <EventArgs>(this.OnProcessReplenish);
            ViewRepPack.LoadReplenishment += new EventHandler <EventArgs>(this.OnLoadReplenish);
            ViewRepPack.SelectAll         += new EventHandler <EventArgs>(ViewRepPack_SelectAll);
            ViewRepPack.UnSelectAll       += new EventHandler <EventArgs>(ViewRepPack_UnSelectAll);


            ViewRepPack.FilterByBin     += new EventHandler <DataEventArgs <String> >(ViewRepPack_FilterByBin);
            ViewRepPack.FilterByProduct += new EventHandler <DataEventArgs <String> >(ViewRepPack_FilterByProduct);

            ViewRepPack.ChangeSelector += new EventHandler <DataEventArgs <ShowData> >(ViewRepPack_ChangeSelector);
            ViewRepPack.ClearRecords   += new EventHandler <DataEventArgs <bool> >(ViewRepPack_ClearRecords);

            ViewRepPack.Model.ShowProcess = false;

            ViewRepPack.Model.CurLocation = App.curLocation;

            //Setting Selector
            try {
                if (Util.GetConfigOption("STOCKSEL").Equals("1"))
                {
                    ReplenishSelector = ViewRepPack.Model.SelectorList[0];
                    ViewRepPack.CboSelector.SelectedIndex = 0;
                }
                else
                {
                    ReplenishSelector = ViewRepPack.Model.SelectorList[1];
                    ViewRepPack.CboSelector.SelectedIndex = 1;
                }
            }
            catch {
                ReplenishSelector = ViewRepPack.Model.SelectorList[0];
                ViewRepPack.CboSelector.SelectedIndex = 0;
            }


            //loading Last Document List
            ViewRepPack.UCDocList.CurDocumentType = ViewRepPack.Model.DocType;
            ViewRepPack.UCDocList.LoadDocuments("");

            //LoadRepPack(App.curLocation);
            //FilterData();
        }
コード例 #26
0
        public string[] datashow(string username)
        {
            ShowData sd = new ShowData(username);

            String[] result = new String[20];


            result = sd.showingName();

            return(result);
        }
コード例 #27
0
    void Start()
    {
        DB      = GameObject.Find("DatabaseHandler").GetComponent <DatabaseHandler>();
        Display = GameObject.Find("Canvas").GetComponent <ShowData>();

        AmountWaiting  = DB.GetListForArea(int.Parse(this.transform.name));
        PostalAreaName = DB.GetNameForArea(int.Parse(this.transform.name));
        //AmountWaiting = int.Parse(this.transform.name);
        //PostalAreaName = this.transform.name;

        SetInitScale(AmountWaiting);
    }
コード例 #28
0
ファイル: UC_IV_Presenter.cs プロジェクト: erwin-hamid/LogPro
        public void SetRepPacking(IUC_IV_Replanish_PackingView view)
        {

            this.ViewRepPack = view;

            ViewRepPack.Model = this.container.Resolve<UC_IV_Model>();

            //DocType
            ViewRepPack.Model.DocType = service.GetDocumentType(new DocumentType { DocTypeID = SDocType.ReplenishPackTask }).FirstOrDefault();

            //Events
            ViewRepPack.ProcessReplenish += new EventHandler<EventArgs>(this.OnProcessReplenish);
            ViewRepPack.LoadReplenishment += new EventHandler<EventArgs>(this.OnLoadReplenish);
            ViewRepPack.SelectAll += new EventHandler<EventArgs>(ViewRepPack_SelectAll);
            ViewRepPack.UnSelectAll += new EventHandler<EventArgs>(ViewRepPack_UnSelectAll);

            
            ViewRepPack.FilterByBin += new EventHandler<DataEventArgs<String>>(ViewRepPack_FilterByBin);
            ViewRepPack.FilterByProduct += new EventHandler<DataEventArgs<String>>(ViewRepPack_FilterByProduct);

            ViewRepPack.ChangeSelector += new EventHandler<DataEventArgs<ShowData>>(ViewRepPack_ChangeSelector);
            ViewRepPack.ClearRecords += new EventHandler<DataEventArgs<bool>>(ViewRepPack_ClearRecords);

            ViewRepPack.Model.ShowProcess = false;

            ViewRepPack.Model.CurLocation = App.curLocation;

            //Setting Selector
            try {
                if (Util.GetConfigOption("STOCKSEL").Equals("1"))
                {
                    ReplenishSelector = ViewRepPack.Model.SelectorList[0];
                    ViewRepPack.CboSelector.SelectedIndex = 0;
                }
                else
                {
                    ReplenishSelector = ViewRepPack.Model.SelectorList[1];
                    ViewRepPack.CboSelector.SelectedIndex = 1;
                }
            }
            catch { 
                ReplenishSelector = ViewRepPack.Model.SelectorList[0];
                ViewRepPack.CboSelector.SelectedIndex = 0;
            }


            //loading Last Document List
            ViewRepPack.UCDocList.CurDocumentType = ViewRepPack.Model.DocType;
            ViewRepPack.UCDocList.LoadDocuments("");

            //LoadRepPack(App.curLocation);
            //FilterData();
        }
コード例 #29
0
        private void cboParam_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ShowData param = ((ComboBox)sender).SelectedItem as ShowData;

            if (param == null)
            {
                return;
            }

            txtParam.Text       = param.DataValue;
            cboParam.Visibility = Visibility.Collapsed;
        }
コード例 #30
0
ファイル: Restaurant.cs プロジェクト: Sybrendj2001/Cinema
        /// <summary>
        /// Add a product
        /// </summary>
        public static void AddProduct()
        {
            ChangeData CD = new ChangeData();
            ShowData   SD = new ShowData();

            while (true)
            {
                Console.Clear();
                try
                {
                    //Requests the name of the product to be added.
                    Console.WriteLine("Please fill in the name of the product or write [exit] to go back to the menu.");
                    string inputName = Console.ReadLine();
                    if (inputName == "exit")
                    {
                        Console.Clear();
                        break;
                    }
                    else
                    {
                        string name = inputName.First().ToString().ToUpper() + inputName.Substring(1);
                        Console.WriteLine(" ");
                        double example = 5.50;

                        //Requests the price of the product to be added.
                        Console.WriteLine("Please fill in the price of the product in euro's (e.g. " + example.ToString("0.00", System.Globalization.CultureInfo.InvariantCulture) + ") or write [exit] to go back to the menu.");
                        string inputPrice = Console.ReadLine();
                        if (inputPrice == "exit")
                        {
                            Console.Clear();
                            break;
                        }
                        else
                        {
                            string temp  = inputPrice.Replace(',', '.');
                            double price = double.Parse(temp, System.Globalization.CultureInfo.InvariantCulture);
                            Console.WriteLine(" ");

                            CD.CreateProduct(name, price);
                            break;
                        }
                    }
                }
                catch (FormatException f)
                {
                    SD.ClearAndErrorMessage("Invalid Input. Please try again.");
                    Console.WriteLine("Press [enter] to continue.");
                    Console.ReadLine();
                    Console.Clear();
                }
            }
        }
コード例 #31
0
        private void listView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.listView1.SelectedItems.Count > 0)
            {
                if (this.listView1.SelectedItems[0].Tag is ShowDevice)
                {
                    //this.txtId.Text = (this.listView1.SelectedItems[0].Tag as ShowDevice).ID.ToString();
                    this.showDeviceId             = (this.listView1.SelectedItems[0].Tag as ShowDevice).ID;
                    this.txtName.Text             = this.listView1.SelectedItems[0].SubItems[1].Text;
                    this.cbShowDeviceType.Text    = this.listView1.SelectedItems[0].SubItems[2].Text;
                    this.cbCommunicateDevice.Text = this.listView1.SelectedItems[0].SubItems[3].Text;
                    this.txtAddress.Text          = this.listView1.SelectedItems[0].SubItems[4].Text;
                    this.txtRemark.Text           = this.listView1.SelectedItems[0].SubItems[5].Text;

                    //显示数据列表的改变事件
                    List <ShowData> showDataLsit =
                        ShowData.FindAllByShowDeviceID((this.listView1.SelectedItems[0].Tag as ShowDevice).ID);
                    foreach (var sd in showDataLsit)
                    {
                        if (showDataLsit == null || showDataLsit.Count == 0)
                        {
                            foreach (ListViewItem item in this.lstShowData.Items)
                            {
                                item.Checked = false;
                            }

                            return;
                        }
                        else
                        {
                            foreach (ListViewItem item in this.lstShowData.Items)
                            {
                                var isExists = false;
                                foreach (var showData in showDataLsit)
                                {
                                    var sD = item.Tag as ShowData;
                                    if (sD != null)
                                    {
                                        if (sD.ID == showData.ID)
                                        {
                                            isExists = true;
                                        }
                                    }
                                }

                                item.Checked = isExists;
                            }
                        }
                    }
                }
            }
        }
コード例 #32
0
 public virtual void Remove(TData buff)
 {
     if (buff == null)
     {
         return;
     }
     //buff叠加
     if (!string.IsNullOrEmpty(buff.BuffGroupID))
     {
         if (Data.ContainsKey(buff.BuffGroupID))
         {
             var tempGroup = Data[buff.BuffGroupID];
             tempGroup.Remove(buff);
             if (tempGroup.Layer <= 0)
             {
                 Data.Remove(buff.BuffGroupID);
                 ListData.Remove(tempGroup);
                 if (!buff.IsHide)
                 {
                     ShowData.Remove(tempGroup);
                 }
                 if (buff.IsHaveRTMaxTime)
                 {
                     UpdateData.Remove(tempGroup);
                 }
             }
         }
     }
     //buff合并
     else
     {
         if (Data.ContainsKey(buff.TDID))
         {
             var tempGroup = Data[buff.TDID];
             tempGroup.Remove(buff);
             if (tempGroup.Layer <= 0)
             {
                 Data.Remove(buff.TDID);
                 ListData.Remove(tempGroup);
                 if (!buff.IsHide)
                 {
                     ShowData.Remove(tempGroup);
                 }
                 if (buff.IsHaveRTMaxTime)
                 {
                     UpdateData.Remove(tempGroup);
                 }
             }
         }
     }
     Callback_OnBuffChange?.Invoke();
 }
コード例 #33
0
ファイル: Customer.cs プロジェクト: timfeskens/Cinema
        public static List <int> display()
        {
            Console.WriteLine("\nMovies:");

            ShowData   showMovieInfo = new ShowData();
            List <int> IDList        = showMovieInfo.ShowMovies();

            // check if user wants to go back
            Console.WriteLine("\n[menu] Restaurant Menu");
            Console.WriteLine("\n[exit] Back to the menu.");

            return(IDList);
        }
コード例 #34
0
 private void LoadDanhSach()
 {
     IQueryable<Data.NHANVIEN> lsMayIn = Data.BONhanVien.GetAllNoTracking(mTransit);
     IQueryable<Data.BOQuyenNhanVien> lsQuyenNhanVien = BOQuyenNhanVien.GetAll(mQuyen.MaQuyen, mTransit);
     List<ShowData> lsShowData = new List<ShowData>();
     foreach (Data.NHANVIEN mi in lsMayIn)
     {
         ShowData item = null;
         if (lsQuyenNhanVien.Where(s => s.NhanVien.NhanVienID == mi.NhanVienID).Count() > 0)
         {
             item = new ShowData(lsQuyenNhanVien.Where(s => s.NhanVien.NhanVienID == mi.NhanVienID).FirstOrDefault(), true);
         }
         else
         {
             item = new ShowData();
             item.QuyenNhanVien.NhanVien = mi;
         }
         lsShowData.Add(item);
     }
     lvData.ItemsSource = lsShowData;
 }
コード例 #35
0
        private void OnSaveDetails(object sender, EventArgs e)
        {
            //Validacion si no existen datos para guardar
            if (View.Model.ListRecords.Rows.Count == 0)
                return;

            //Variables Auxiliares
            DataInformation DataInformationSerial;
            DataDefinitionByBin DataDefinitionControlIsRequired;
            Object ChildrenValue, ChildrenLabel;
            ShowData DetailDataSave;
            string XmlData;
            bool ControlIsRequired;

            try
            {
                try
                {
                    foreach (DataRow DataRow in View.Model.ListRecords.Rows)
                    {
                        //Inicializo la lista de los datos a convertir en Xml
                        View.Model.ListDetailsDataSave = new List<ShowData>();
                        //Obtengo los datos de cada campo con su nombre
                        foreach (DataColumn c in View.Model.ListRecords.Columns)
                        {
                            //Obtengo el label y el valor digitado
                            ChildrenLabel = c.ColumnName;
                            ChildrenValue = DataRow[c.ColumnName].ToString();

                            //Evaluo si el campo es obligatorio
                            ControlIsRequired = true;
                            DataDefinitionControlIsRequired = (View.Model.CamposDetails.Where(f => f.DataDefinition.Code == ChildrenLabel).Count() > 0) ? View.Model.CamposDetails.Where(f => f.DataDefinition.Code == ChildrenLabel).First() : null;
                            if (DataDefinitionControlIsRequired != null)
                            {
                                if (DataDefinitionControlIsRequired.DataDefinition.IsRequired == true && String.IsNullOrEmpty(ChildrenValue.ToString()))
                                    ControlIsRequired = false;
                                else
                                    ControlIsRequired = true;
                            }
                            //Evaluo si puedo continuar dependiendo de si el dato era requerido y fue digitado o no
                            if (ControlIsRequired)
                            {
                                //Creo el ShowData con los datos de ChildrenLabel y ChildrenValue
                                DetailDataSave = new ShowData
                                {
                                    DataKey = ChildrenLabel.ToString(),
                                    DataValue = ChildrenValue.ToString()
                                };
                                //Adiciono cada dato a la lista
                                View.Model.ListDetailsDataSave.Add(DetailDataSave);
                            }
                            else
                            {
                                Util.ShowError("El campo " + ChildrenLabel.ToString() + " no puede ser vacio.");
                                return;
                            }

                            //Cargo el dato para la variable de ultimos procesados
                            View.Model.UltimosProcesados = View.Model.UltimosProcesados + ChildrenValue.ToString() + " \t ";

                        }
                        //Convierto el listado de datos a un Xml
                        XmlData = Util.XmlSerializerWF(View.Model.ListDetailsDataSave);
                        //Creo el DataInformation del Serial para el Xml
                        DataInformationSerial = new DataInformation
                        {
                            Entity = new ClassEntity { ClassEntityID = 20 },
                            EntityRowID = Int32.Parse(DataRow[0].ToString()),
                            XmlData = XmlData,
                            CreationDate = DateTime.Now,
                            CreatedBy = App.curUser.UserName,
                            ModDate = DateTime.Now
                        };
                        //Guardo el Xml en la tabla DataInformation
                        DataInformationSerial = service.SaveDataInformation(DataInformationSerial);

                        //Ejecuto el proceso para cargar los datos a las tablas
                        CargarDatosXML(DataInformationSerial);

                        View.Model.UltimosProcesados = View.Model.UltimosProcesados + "\n";
                    }
                }
                catch (Exception ex)
                { Util.ShowError(ex.Message); }


                //COMPLETAR DOCUMENTO
                service.CreatePurchaseReceipt(View.Model.HeaderDocument);

                WindowInfo confirm = new WindowInfo();
                confirm.Txt_Mensaje.Text = View.Model.UltimosProcesados;
                confirm.ShowDialog();

                //Mensaje de confirmacion
                Util.ShowMessage("Datos Guardados exitosamente.");

                #region Nuevo Codigo

                DocumentoConsultado = service.GetDocument(new Document { DocNumber = View.NumeroDelDocumento.Text }).Where(f => f.DocNumber == View.NumeroDelDocumento.Text).ToList().First();
                View.Model.ListaSerialesNoCargados = service.GetLabel(new WMSBusinessService.Label
                {
                    Node = new Node { NodeID = NodeType.PreLabeled },
                    CreTerminal = View.Model.RecordCliente.LocationID.ToString(),
                    ReceivingDocument = DocumentoConsultado
                }).Where(f => f.Node.NodeID == 1 && f.ReceivingDocument == DocumentoConsultado).ToList();

                Util.ShowMessage("Los equipos cargados fueron guardados satisfactoriamente. \n"
                    + "Equipos cargados: " + View.Model.ListRecords.Rows.Count + " \n"
                    + "Equipos No cargador por error en la comunicacion con el servidor principal: " + View.Model.ListaSerialesNoCargados.Count);

                #endregion
                //Inicializo los campos de ingreso
                LimpiarDatosIngresoSeriales();
            }
            catch (Exception Ex) { Util.ShowError("Hubo un error guardando los datos, por favor vuelva a intentarlo: " + Ex.Message); }
        }
コード例 #36
0
ファイル: UC_IV_Presenter.cs プロジェクト: erwin-hamid/LogPro
        void ViewRepPack_ChangeSelector(object sender, DataEventArgs<ShowData> e)
        {
            if (e.Value == null)
                return;

            ReplenishSelector = e.Value;
            LoadRepPack(ViewRepPack.Model.CurLocation);
        }
コード例 #37
0
        private void OnSaveDetails(object sender, EventArgs e)
        {
            //Validacion si no existen datos para guardar
            if (View.Model.ListRecords.Rows.Count == 0)
                return;

            //Variables Auxiliares
            DataInformation DataInformationSerial;
            Object ChildrenValue, ChildrenLabel;
            ShowData DetailDataSave;
            IList<ShowData> DetailDataList;
            string XmlData;
            WpfFront.WMSBusinessService.Label LabelAux;
            DataDefinitionByBin DataDefinitionControlIsRequired;
            bool ControlIsRequired;

            try
            {
                //Recorro los registros de la lista para obtener los datos y hacer un join con los anteriores y guardarlos
                foreach (DataRow DataRow in View.Model.ListRecords.Rows)
                {
                    //Obtengo el DataInformation asociado al registro
                    DataInformationSerial = View.Model.ListDataInformation.Where
                        (f => f.Entity.ClassEntityID == EntityID.Label &&
                              f.EntityRowID == Int32.Parse(DataRow[0].ToString())).ToList().First();

                    //Deserializo el Xml para obtener el Showdata
                    DetailDataList = Util.DeserializeMetaDataWF(DataInformationSerial.XmlData);

                    //Inicializo la lista de los datos a convertir en Xml
                    View.Model.ListDetailsDataSave = new List<ShowData>();

                    //Obtengo los datos de cada campo con su nombre
                    foreach (DataColumn c in View.Model.ListRecords.Columns)
                    {
                        //Obtengo el label y el valor digitado
                        ChildrenLabel = c.ColumnName;
                        ChildrenValue = DataRow[c.ColumnName].ToString();

                        //Evaluo si el campo es obligatorio
                        ControlIsRequired = true;
                        DataDefinitionControlIsRequired = (View.Model.CamposDetails.Where(f => f.DataDefinition.Code == ChildrenLabel).Count() > 0) ? View.Model.CamposDetails.Where(f => f.DataDefinition.Code == ChildrenLabel).First() : null;
                        if (DataDefinitionControlIsRequired != null)
                        {
                            if (DataDefinitionControlIsRequired.DataDefinition.IsRequired == true && String.IsNullOrEmpty(ChildrenValue.ToString()))
                                ControlIsRequired = false;
                            else
                                ControlIsRequired = true;
                        }

                        //Evaluo si puedo continuar dependiendo de si el dato era requerido y fue digitado o no
                        if (ControlIsRequired)
                        {
                            //Evaluo si existe el dato que estoy leyendo para quitarlo del listado anterior
                            try
                            {
                                DetailDataSave = DetailDataList.Where(f => f.DataKey == c.ColumnName).First();
                                DetailDataList.Remove(DetailDataSave);
                            }
                            //En caso de no existir no quito nada
                            catch { }

                            //Creo el ShowData con el dato
                            DetailDataSave = new ShowData
                            {
                                DataKey = ChildrenLabel.ToString(),
                                DataValue = ChildrenValue.ToString()
                            };

                            //Adiciono cada dato a la lista
                            View.Model.ListDetailsDataSave.Add(DetailDataSave);
                        }
                        else
                        {
                            Util.ShowError("El campo " + ChildrenLabel.ToString() + " no puede ser vacio.");
                            return;
                        }
                    }

                    //Concateno las listas de ShowData, la que estaba guardada y la nueva
                    View.Model.ListDetailsDataSave = View.Model.ListDetailsDataSave.Concat(DetailDataList).ToList();

                    //Convierto el listado de datos a un Xml
                    XmlData = Util.XmlSerializerWF(View.Model.ListDetailsDataSave);

                    //Modifico el DataInformation con el nuevo Xml
                    DataInformationSerial.XmlData = XmlData;
                    DataInformationSerial.ModDate = DateTime.Now;
                    DataInformationSerial.ModifiedBy = App.curUser.UserName;

                    //Actualizo el DataInformation
                    service.UpdateDataInformation(DataInformationSerial);
                }

                LabelAux = service.GetLabel(new WpfFront.WMSBusinessService.Label
                {
                    Bin = new Bin { BinCode = "MAIN", Location = LocationDespachos },
                    LabelType = new DocumentType { DocTypeID = LabelType.BinLocation }
                }).First();

                //Recorro el listado de Labels para actualizar sus datos
                foreach (WpfFront.WMSBusinessService.Label Label in View.Model.ListLabelScann)
                {
                    Label.Notes += (View.Model.IsCheckedCommentsSerial) ? (" " + View.Model.HeaderDocument.Comment) : "";
                    try { service.ChangeLabelLocationV2(Label, LabelAux, View.Model.HeaderDocument); }
                    catch { }
                }

                //Reinicio las variables
                View.Model.ListRecords.Rows.Clear();
                View.Model.ListLabelScann = new List<WpfFront.WMSBusinessService.Label>();
                View.Model.ListDataInformation = new List<DataInformation>();

                //Muestro el mensaje de guardado
                Util.ShowMessage("Datos Guardados exitosamente.");
            }
            catch (Exception Ex) { Util.ShowError("Hubo un error guardando los datos, por favor vuelva a intentarlo: " + Ex.Message); }
        }
コード例 #38
0
 private void OnConfirmBasicData(object sender, EventArgs e)
 {
     Object ChildrenValue, ChildrenLabel;
     ShowData HeaderDataSave;
     string XmlData;
     string CodigoCampo;
     DataDefinition IsRequiredField;
     bool ControlIsRequired;
     //Inicializo la lista de los datos a convertir en Xml
     View.Model.ListHeaderDataSave = new List<ShowData>();
     //Obtengo los datos de los campos
     foreach (UIElement UIElement in View.GetStackPanelHeader.Children)
     {
         try
         {
             //Obtengo el label y el valor digitado
             ChildrenLabel = UIElement.GetType().GetProperty("UcLabel").GetValue(UIElement, null);
             ChildrenValue = UIElement.GetType().GetProperty("UcValue").GetValue(UIElement, null);
             //Obtengo el codigo del campo
             CodigoCampo = UIElement.GetType().GetProperty("Name").GetValue(UIElement, null).ToString();
             CodigoCampo = CodigoCampo.Replace("f_", "");
             //Traigo sus datos de creacion
             IsRequiredField = service.GetDataDefinition(new DataDefinition { Code = CodigoCampo }).First();
             //Evaluo si el campo es obligatorio
             if (IsRequiredField.IsRequired == true && String.IsNullOrEmpty(ChildrenValue == null ? "" : ChildrenValue.ToString()))
                 ControlIsRequired = false;
             else
                 ControlIsRequired = true;
             //Evaluo si puedo continuar dependiendo de si el dato era requerido y fue digitado o no
             if (ControlIsRequired)
             {
                 //Creo el ShowData con los datos de CodigoCampo y ChildrenValue
                 HeaderDataSave = new ShowData
                 {
                     DataKey = CodigoCampo.ToString(),
                     DataValue = ChildrenValue == null ? "" : ChildrenValue.ToString()
                 };
                 //Adiciono el ShowData al listado para crear el Xml
                 View.Model.ListHeaderDataSave.Add(HeaderDataSave);
             }
             else
             {
                 Util.ShowError("El campo " + ChildrenLabel.ToString() + " no puede ser vacio.");
                 return;
             }
         }
         catch { continue; }
     }
     try
     {
         //Convierto el listado de datos a un Xml
         XmlData = Util.XmlSerializerWF(View.Model.ListHeaderDataSave);
         //Asigno los datos del documento para guardar
         View.Model.HeaderDocument.Location = LocationDespachos;
         View.Model.HeaderDocument.DocType = new DocumentType { DocTypeID = SDocType.SalesOrder };
         View.Model.HeaderDocument.IsFromErp = false;
         View.Model.HeaderDocument.CrossDocking = false;
         View.Model.HeaderDocument.Vendor = service.GetAccount(new Account { AccountCode = WmsSetupValues.DEFAULT }).First();
         View.Model.HeaderDocument.Customer = service.GetAccount(new Account { AccountCode = WmsSetupValues.DEFAULT }).First();
         View.Model.HeaderDocument.Date1 = DateTime.Now;
         View.Model.HeaderDocument.CreatedBy = App.curUser.UserName;
         View.Model.HeaderDocument.Company = new Company { CompanyID = App.curCompany.CompanyID };
         //Guardo el Documento
         View.Model.HeaderDocument = service.CreateNewDocument(View.Model.HeaderDocument, true);
         //Creo el DataInformation del Header para el Xml
         View.Model.DataInformationHeader = new DataInformation
         {
             Entity = new ClassEntity { ClassEntityID = 6 },
             EntityRowID = View.Model.HeaderDocument.DocID,
             XmlData = XmlData,
             CreationDate = DateTime.Now,
             CreatedBy = App.curUser.UserName
         };
         //Guardo el Xml en la tabla DataInformation
         View.Model.DataInformationHeader = service.SaveDataInformation(View.Model.DataInformationHeader);
         //Inhabilito el boton de Guardar, muestro Cancelar y oculto Nuevo
         View.GetButtonConfirmar.IsEnabled = false;
         View.GetButtonNuevo.Visibility = Visibility.Collapsed;
         View.GetButtonCancelar.Visibility = Visibility.Visible;
         //Inhabilito el combobox de bin de ingreso
         View.GetListBinInicio.IsEnabled = false;
         //Muestro el boton para mostrar los datos del header y oculto header
         View.GetTextHideShowHeader.Visibility = Visibility.Visible;
         View.GetBorderHeader.Visibility = Visibility.Collapsed;
         //Cargo los datos para el detalle, los seriales y muestro
         CargarSeriales();
         CargarDatosDetails();
         View.BorderDetails.Visibility = Visibility.Visible;
         //Muestro el mensaje de confirmacion
         Util.ShowMessage("El documento se guardo satisfactoriamente");
     }
     catch (Exception Ex) { Util.ShowError("Hubo un error durante el proceso: " + Ex.Message); }
 }
コード例 #39
0
 private void OnUpdateData(object sender, EventArgs e)
 {
     Object ChildrenValue, ChildrenLabel;
     ShowData HeaderDataSave;
     string XmlData;
     string CodigoCampo;
     DataDefinition IsRequiredField;
     bool ControlIsRequired;
     IList<ShowData> DetailDataList;
     //Deserializo el Xml para obtener el Showdata
     DetailDataList = Util.DeserializeMetaDataWF(View.Model.DataInformationSearch.XmlData);
     //Inicializo la lista de los datos a convertir en Xml
     View.Model.ListDataSave = new List<ShowData>();
     //Obtengo los datos de los campos
     foreach (UIElement UIElement in View.GetStackPanelDinamicos.Children)
     {
         try
         {
             //Obtengo el label y el valor digitado
             ChildrenLabel = UIElement.GetType().GetProperty("UcLabel").GetValue(UIElement, null);
             ChildrenValue = UIElement.GetType().GetProperty("UcValue").GetValue(UIElement, null);
             //Obtengo el codigo del campo
             CodigoCampo = UIElement.GetType().GetProperty("Name").GetValue(UIElement, null).ToString();
             CodigoCampo = CodigoCampo.Replace("f_", "");
             //Traigo sus datos de creacion
             IsRequiredField = service.GetDataDefinition(new DataDefinition { Code = CodigoCampo }).First();
             //Evaluo si el campo es obligatorio
             /*if (IsRequiredField.IsRequired == true && String.IsNullOrEmpty(ChildrenValue == null ? "" : ChildrenValue.ToString()))
                 ControlIsRequired = false;
             else*/
             ControlIsRequired = true;
             //Evaluo si puedo continuar dependiendo de si el dato era requerido y fue digitado o no
             if (ControlIsRequired)
             {
                 //Evaluo si existe el dato que estoy leyendo para quitarlo del listado anterior
                 try
                 {
                     HeaderDataSave = DetailDataList.Where(f => f.DataKey == CodigoCampo.ToString()).First();
                     DetailDataList.Remove(HeaderDataSave);
                 }
                 //En caso de no existir no quito nada
                 catch { }
                 //Creo el ShowData con los datos de ChildrenLabel y ChildrenValue
                 HeaderDataSave = new ShowData
                 {
                     DataKey = CodigoCampo.ToString(),
                     DataValue = ChildrenValue == null ? "" : ChildrenValue.ToString()
                 };
                 //Adiciono el ShowData al listado para crear el Xml
                 View.Model.ListDataSave.Add(HeaderDataSave);
             }
             else
             {
                 Util.ShowError("El campo " + ChildrenLabel.ToString() + " no puede ser vacio.");
                 return;
             }
         }
         catch { continue; }
     }
     try
     {
         //Concateno las listas de ShowData, la que estaba guardada y la nueva
         View.Model.ListDataSave = View.Model.ListDataSave.Concat(DetailDataList).ToList();
         //Convierto el listado de datos a un Xml
         XmlData = Util.XmlSerializerWF(View.Model.ListDataSave);
         //Evaluo el tipo de dato a editar(Document o Label)
         if (View.Model.DataInformationSearch.Entity.ClassEntityID == EntityID.Document)
             //Guardo los datos para el documento
             UpdateDocumentData(XmlData);
         if (View.Model.DataInformationSearch.Entity.ClassEntityID == EntityID.Label)
             //Guardo los datos para el label
             UpdateLabelData(XmlData);
         //Muestro el mensaje de confirmacion
         Util.ShowMessage("Los datos fueron editados correctamente");
     }
     catch (Exception Ex) { Util.ShowError("Hubo un error durante el proceso: " + Ex.Message); }
 }
コード例 #40
0
 private void LoadDanhSach()
 {
     IQueryable<Data.MAYIN> lsMayIn = Data.BOMayIn.GetAllNoTracking(mTransit, false);
     IQueryable<Data.BOMenuItemMayIn> lsMonMayIn = BOMenuItemMayIn.GetAll(_Mon.MenuMon.MonID, mTransit);
     List<ShowData> lsShowData = new List<ShowData>();
     foreach (Data.MAYIN mi in lsMayIn)
     {
         ShowData item = null;
         if (lsMonMayIn.Where(s => s.MayIn.MayInID == mi.MayInID).Count() > 0)
         {
             item = new ShowData(lsMonMayIn.Where(s => s.MayIn.MayInID == mi.MayInID).FirstOrDefault(), true);
         }
         else
         {
             item = new ShowData();
             item.MenuItemMayIn.MayIn = mi;
         }
         lsShowData.Add(item);
     }
     lvData.ItemsSource = lsShowData;
 }