Exemple #1
0
 protected void ButtonConfirmar_Click(object sender, EventArgs e)
 {
     TextBoxCaracteristicas.Text = "";
     TextBoxNumSerie.Text        = "";
     MostrarTablaMateriales();
     GridMaterial.DataBind();
 }
        protected void GridCuttingReservation_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridViewRow gv               = GridCuttingReservation.SelectedRow;
            int         ReservedID       = Convert.ToInt32(gv.Cells[1].Text.ToString());
            var         ReservedMaterial = db.ReservedCuttingMaterials.Where(x => x.ID == ReservedID).FirstOrDefault();
            decimal     QTY              = Convert.ToDecimal(ReservedMaterial.Quantity);
            string      ReservationNote  = ReservedMaterial.Note;
            decimal     PaidAmount       = Convert.ToDecimal(ReservedMaterial.PaidAmount);
            int         cuttingListID    = Convert.ToInt32(ReservedMaterial.CuttingMaterialID);

            ReservedMaterial.IsDeleted = true;
            var CMaterial = db.CuttingListsMaterials.Where(x => x.ID == cuttingListID).FirstOrDefault();

            CMaterial.ReservedQTY -= QTY;
            CMaterial.IsActive     = true;
            if (PaidAmount != 0)
            {
                CMaterial.Quantity += QTY;
            }

            Logger log = new Logger();

            log.Action     = "Cancel Reservation of CuttingList Material ( " + CMaterial.Material.MaterialName.ToString() + " ) in Store ( " + CMaterial.Store.StoreName.ToString() + " ) with Quantity " + QTY.ToString() + " is cancelled ";
            log.ActionDate = DateTime.Now;
            log.UserName   = User.Identity.Name;
            log.ActionType = "Cancel Reservation";
            db.Loggers.Add(log);
            db.SaveChanges();

            GridCuttingReservation.DataBind();
            GridCuttingReservation.Visible = true;
            GridMaterial.DataBind();
            GridMaterial.Visible = true;
        }
        /// <summary>
        /// Shonwイベント
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SilhouetteForm_Shown(object sender, EventArgs e)
        {
            // 現在のPMXデータを複製取得
            PEPlugin.Pmx.IPXPmx pe = Args.Host.Connector.Pmx.GetCurrentState();

            // 材質数チェック
            if (pe.Material.Count == 0)
            {
                MessageBox.Show("モデルが読み込まれていないか、材質がありません。"
                                , "エラー"
                                , MessageBoxButtons.OK
                                , MessageBoxIcon.Error);
                this.Close();
                return;
            }

            // Grid初期化
            GridMaterial.Rows.Clear();

            // GridMaterialの表示
            foreach (var Material in pe.Material)
            {
                // 行追加
                // 色はデフォルトで黒とする
                GridMaterial.Rows.Add(Material.Name, "");
                GridMaterial.Rows[GridMaterial.Rows.Count - 1].Cells[1].Style.BackColor          = Color.Black;
                GridMaterial.Rows[GridMaterial.Rows.Count - 1].Cells[1].Style.SelectionBackColor = Color.FromArgb(0xFF0000);
                GridMaterial.Rows[GridMaterial.Rows.Count - 1].Resizable = DataGridViewTriState.False;
            }
            GridMaterial.Refresh();
        }
    private void GetMaterials()
    {
        MaterialBusiness        MB = new MaterialBusiness();
        List <WorkShopMaterial> Ls = MB.GetMaterials();

        GridMaterial.DataSource = Ls;
        GridMaterial.DataBind();
    }
 public void NetworkConquestMap(string json)
 {
     if (UseGrid)
     {
         Logo.DOColor(new Color(1, 1, 1, 1), 0.4f).Play();
         MapMaterial.DOColor(ConquestColor, 0.4f).Play();
         GridMaterial.DOColor(new Color(1, 1, 1, 0), 0.4f).Play();
     }
 }
        //protected void btnGetMaterialData_Click(object sender, EventArgs e)
        //{
        //    //var materialid = Convert.ToInt32(dsMaterials.SelectedValue);
        //    //var storeid = Convert.ToInt32(dsStores.SelectedValue);
        //    //var Ms = db.MaterialInStocks.Where(x => x.MaterialID == materialid && x.StoreID == storeid).FirstOrDefault();
        //    //itemname.Value = Ms.Material.MaterialName;
        //    //txtstock.Value = Ms.StockOnHand.ToString();
        //    //txtReservedStock.Value = "";
        //    //SafetyStock.Value = Ms.SafetyStock.ToString();
        //    //materialimg.Src = Ms.Material.imagepath;
        //    //pnlMaterialData.Visible = true;

        //    pnlAvailableMaterial.Visible = true;
        //    GridMaterial.DataBind();
        //}

        protected void btnReserveStock_Click(object sender, EventArgs e)
        {
            var mt = Convert.ToInt32(dsMaterials.SelectedValue);
            var s  = Convert.ToInt16(dsStores.SelectedValue);

            if (txtNotes.Value == "")
            {
                lblError.Text = "Please insert your Notes";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "EnterText", "SetNoteError();", true);
                lblError.ForeColor      = Color.Red;
                lblError.Visible        = true;
                pnlMaterialData.Visible = true;
            }
            else
            {
                if (txtReservedStock.Value == "")
                {
                    lblError.Text           = "Please Quantity you want to Reserve";
                    lblError.ForeColor      = Color.Red;
                    lblError.Visible        = true;
                    pnlMaterialData.Visible = true;
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "EnterText", "SetQuantityError();", true);
                }
                else
                {
                    decimal stock    = Convert.ToDecimal(txtstock.Value.ToString());
                    decimal reserved = Convert.ToDecimal(txtReservedStock.Value);
                    var     material = db.MaterialInStocks.Where(x => x.MaterialID == mt && x.StoreID == s).FirstOrDefault();


                    if (stock < reserved)
                    {
                        lblError.ForeColor      = Color.Red;
                        lblError.Text           = " The Stock <  The Requested Quantity";
                        lblError.Visible        = true;
                        pnlMaterialData.Visible = true;
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "EnterText", "SetQuantityError();", true);
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "EnterText", "SetStockError();", true);
                    }
                    else
                    {
                        if (itemtype.Value.ToLower() == "material")
                        {
                            ReserveStock();
                        }
                        else if (itemtype.Value.ToLower() == "cuttinglist")
                        {
                            ReserveCuttingList();
                        }

                        pnlMaterialData.Visible = false;
                        GridMaterial.DataBind();
                    }
                }
            }
        }
 /// <summary>
 /// 色を変更ボタン押下
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnChangeCollar_Click(object sender, EventArgs e)
 {
     if (colorDialog.ShowDialog() == DialogResult.OK)
     {
         // 選択行のカラー列を変更
         foreach (DataGridViewRow SelRow in GridMaterial.SelectedRows)
         {
             SelRow.Cells[1].Style.BackColor = colorDialog.Color;
         }
         GridMaterial.Refresh();
     }
 }
Exemple #8
0
    private void drawGrid()
    {
        if (Grid == null)
        {
            return;
        }

        GL.PushMatrix();
        GL.MultMatrix(transform.localToWorldMatrix);

        GridMaterial.SetPass(0);
        GridUtils.DrawGridLines(Grid.GridLines);
        GL.PopMatrix();
    }
 protected void dsMaterials_SelectedIndexChanged(object sender, EventArgs e)
 {
     pnlAvailableMaterial.Visible = true;
     GridMaterial.DataBind();
 }