Exemplo n.º 1
0
        protected bool Check_Bom(string Parent, string Child)
        {
            Message msg = new Message(g_user_id, g_lang);
            MfgBom  bom = new MfgBom(g_user_id, g_lang);
            DataSet ds  = new DataSet();

            if (Parent == Child)
            {
                lblMsg.Text      = msg.GetMessage("PARENT_AND_CHILD_SAME");
                lblMsg.ForeColor = Color.Red;
                return(false);
            }

            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 明細削除ボタン
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDET_DEL_Click(object sender, EventArgs e)
        {
            ComLibrary com = new ComLibrary();
            Message    msg = new Message(g_user_id, g_lang);
            //Location loc = new Location(g_user_id, g_lang);
            MfgBom Mfb = new MfgBom(g_user_id, g_lang);

            if (txtSequent.Text.Trim() == "")
            {
                lblMsg.Text      = msg.GetMessage("INPUT_MANDATORY_ERR") + "(" + flblSequent.Text + ")";
                lblMsg.ForeColor = Color.Red;
                return;
            }

            // 削除
            //loc.whs_cd = hdnITEM_NO.Value;
            //loc.location = hdnSequent.Value;
            //loc.chg_pgm = "MstLocationMnt";
            Mfb.data_char1     = txtBOM_No.Text;
            Mfb.data_num1      = com.StringToInt(txtBOM_Level.Text);
            Mfb.data_num2      = com.StringToInt(txtBOM_Sub_Level.Text);
            Mfb.parent_item_no = hdnITEM_NO.Value;
            Mfb.part_seq       = com.StringToInt(hdnSequent.Value);
            Mfb.child_item_no  = hdnChild_Item.Value;

            /*int rtn = loc.Delete();
             * if (rtn != ComConst.SUCCEED)
             * {
             *  lblMsg.Text = loc.strErr;
             *  lblMsg.ForeColor = Color.Red;
             *  return;
             * }*/
            int rtn = Mfb.Delete();

            if (rtn == ComConst.FAILED)
            {
                lblMsg.Text      = Mfb.strErr;
                lblMsg.ForeColor = Color.Red;
                return;
            }
            if (dgvDetail.Rows.Count <= 1)
            {
                dgvDetail.PageIndex = 0;
            }

            Edit_Screen();
        }
 private static UserBomTableRow Convert(MfgBom.Bom.Part part)
 {
     return new UserBomTableRow() {
         Description = part.Description,
         Manufacturer = part.Manufacturer,
         ManufacturerPartNumber = part.ManufacturerPartNumber,
         Notes = part.Notes,
         Package = part.Package,
         Quantity = part.quantity,
         ReferenceDesignators = String.Join(", " + Environment.NewLine, 
                                            part.instances_in_design
                                                .Select(ci => ci.path)),
         Supplier1 = part.SelectedSupplierName,
         Supplier1PartNumber = part.SelectedSupplierSku,
         Supplier1UnitPrice = part.SelectedSupplierPartCostPerUnit
     };
 }
        protected void cmdPrint_Click(object sender, EventArgs e)
        {
            //
            // 製造指示表リスト発行
            //
            ComLibrary com  = new ComLibrary();
            Message    msg  = new Message(g_user_id, g_lang);
            MfgBom     mbom = new MfgBom(g_user_id, g_lang);

            DataTable dt = (DataTable)(ViewState["gdvDetail"]);

            if (dt == null)
            {
                return;
            }
            bool print_flag = false;
            //int seqno = 0;
            //Print Data
            DataTable prtDt = new DataTable();

            //SubReport Data
            //DataTable prtDtTotal = new DataTable();

            // 対象の行を探す
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (com.IntToBool(com.StringToInt(dt.Rows[i]["SELECT"].ToString())))
                {
                    //印刷マーク
                    print_flag = true;
                    //seqno++;

                    // Testing
                    prtDt.Columns.Add(new DataColumn("FE_CRANK_ONLINE_NO"));
                    prtDt.Columns.Add(new DataColumn("PRODUCTION_DATE"));
                    prtDt.Columns.Add(new DataColumn("SHIFT"));
                    prtDt.Columns.Add(new DataColumn("MODEL"));
                    prtDt.Columns.Add(new DataColumn("LOTNO_ZOZAI"));
                    prtDt.Columns.Add(new DataColumn("DIE_NO"));
                    prtDt.Columns.Add(new DataColumn("ONLINE_DATE"));
                    prtDt.Columns.Add(new DataColumn("ONLINE_STAMPING"));
                    prtDt.Columns.Add(new DataColumn("REMARK"));

                    DataRow dr = prtDt.NewRow();
                    dr["FE_CRANK_ONLINE_NO"] = "CRON-20180101-0001";
                    dr["PRODUCTION_DATE"]    = "2018-04-23 00:00:00.000";
                    dr["SHIFT"]           = "X";
                    dr["MODEL"]           = "55A";
                    dr["LOTNO_ZOZAI"]     = "P50203N7";
                    dr["DIE_NO"]          = "99";
                    dr["ONLINE_DATE"]     = "100";
                    dr["ONLINE_STAMPING"] = "H-0746";
                    dr["REMARK"]          = "";

                    prtDt.Rows.Add(dr);
                    // Actual Codes
                    // データ検索
                    //WIPJo jo = new WIPJo(g_user_id, g_lang);
                    //jo.job_order_no = dt.Rows[i]["Online_No"].ToString();
                    //jo.item_no = dt.Rows[i]["Part_No"].ToString();
                    //DataSet ds = jo.Get_OnRptDetail();
                    //if (ds == null)
                    //{
                    //    lblMsg.Text = jo.strErr;
                    //    lblMsg.ForeColor = Color.Red;
                    //    return;
                    //}
                    //prtDt = ds.Tables[0];
                }
            }
            if (print_flag == false)
            {
                lblMsg.Text      = msg.GetMessage("PRINT_DATA_NOT_EXIST_ERR");
                lblMsg.ForeColor = Color.Red;
                return;
            }

            ReportClass Rpt = null;

            Rpt = new HondaTraceabilitySystem.Common.Report.FeOnline();
            string ReportName = "MfgJOList";

            try
            {
                //Rpt.Subreports["SubReport"].SetDataSource(prtDtTotal);
                Rpt.SetDataSource(prtDt);
                Rpt.SetParameterValue("H_TITLE", "INSPECTION SHEET(SEMICONDUCTOR");

                PdfRtfWordFormatOptions    pdfFormatOpts = new PdfRtfWordFormatOptions();
                DiskFileDestinationOptions diskOpts      = new DiskFileDestinationOptions();

                // exportOpts;
                ExportOptions exportOpts = Rpt.ExportOptions;
                exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;
                exportOpts.ExportFormatType      = ExportFormatType.PortableDocFormat;
                exportOpts.FormatOptions         = pdfFormatOpts;
                string tmpFilenm = ReportName + "_" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".pdf";

                diskOpts.DiskFileName = Server.MapPath(WebConfigurationManager.ConnectionStrings["ReportOutDir"].ConnectionString + tmpFilenm);

                exportOpts.DestinationOptions = diskOpts;
                //print
                Rpt.Export();
                Type cstype = this.GetType();
                this.Page.ClientScript.RegisterClientScriptBlock(cstype, "a", @"<script>window.open('" + WebConfigurationManager.ConnectionStrings["ReportOutDir"].ConnectionString + tmpFilenm + "', '" + ReportName + "', 'status,resizable=yes');</script>");
            }
            catch (Exception ex)
            {
                string strErr = ex.ToString();
                lblMsg.Text = ex.ToString();
                return;
            }
            lblMsg.Text      = msg.GetMessage("NORMAL_PRINT");
            lblMsg.ForeColor = Color.Blue;
        }
Exemplo n.º 5
0
        private static int ParseArgs(string[] args, out MfgBom.CostEstimation.CostEstimationRequest Request, out AVM.DDP.MetaTBManifest Manifest, out String pathResultsFolder)
        {
            Request = null;
            Manifest = null;
            pathResultsFolder = "";

            var pathManifest = args[0];
            if (false == File.Exists(pathManifest))
            {
                Console.Error.WriteLine("No file found at location: {0}",
                                        pathManifest);
                return -2;
            }

            pathResultsFolder = Path.GetDirectoryName(pathManifest);
            Manifest = AVM.DDP.MetaTBManifest.OpenForUpdate(pathResultsFolder);
            if (null == Manifest)
            {
                Console.Error.WriteLine("Manifest is empty or didn't load correctly: {0}",
                                        pathManifest);
                return -3;
            }

            var artifactRequest = Manifest.Artifacts.FirstOrDefault(a => a.Tag == "CyPhy2MfgBom::CostEstimationRequest");
            if (null == artifactRequest)
            {
                Console.Error.WriteLine("Didn't find any artifacts in the manifest with the tag \"CyPhy2MfgBom::CostEstimationRequest\": {0}",
                                        pathManifest);
                return -4;
            }

            var pathRequest = Path.Combine(pathResultsFolder,
                                           artifactRequest.Location);
            if (false == File.Exists(pathRequest))
            {
                Console.Error.WriteLine("Couldn't find the file tagged with \"CyPhy2MfgBom::CostEstimationRequest\" at given path: {0}",
                                        pathRequest);
                return -5;
            }

            String jsonRequest;

            try
            {
                jsonRequest = File.ReadAllText(pathRequest);
                Request = MfgBom.CostEstimation.CostEstimationRequest.Deserialize(jsonRequest);
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine("Exception loading the cost estimation request at \"{0}\": {1}",
                                        pathRequest,
                                        ex);
                return -6;
            }
            return 0;
        }
Exemplo n.º 6
0
        /// <summary>
        /// 明細変更ボタン
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDET_CHANGE_Click(object sender, EventArgs e)
        {
            ComLibrary com = new ComLibrary();
            Message    msg = new Message(g_user_id, g_lang);
            //Location loc = new Location(g_user_id, g_lang);
            MfgBom Mfb = new MfgBom(g_user_id, g_lang);

            if (txtSequent.Text.Trim() == "")
            {
                lblMsg.Text      = msg.GetMessage("INPUT_MANDATORY_ERR") + "(" + flblSequent.Text + ")";
                lblMsg.ForeColor = Color.Red;
                return;
            }
            if (txtUsg_Qty.Text.Trim() == "")
            {
                lblMsg.Text      = msg.GetMessage("INPUT_MANDATORY_ERR") + "(" + flblUsg_Qty.Text + ")";
                lblMsg.ForeColor = Color.Red;
                return;
            }

            Mfb.data_char1     = txtBOM_No.Text.ToUpper();
            Mfb.data_num1      = com.StringToInt(txtBOM_Level.Text);
            Mfb.data_num2      = com.StringToInt(txtBOM_Sub_Level.Text);
            Mfb.parent_item_no = txtITEM_NO.Text.ToUpper();
            Mfb.part_seq       = com.StringToInt(txtSequent.Text);
            Mfb.child_item_no  = txtChild_Item.Text.ToUpper();
            Mfb.usage_dec      = com.StringToDouble(txtUsg_Qty.Text);
            Mfb.chg_user_id    = g_user_id;
            Mfb.chg_pgm        = "MstMfgBOMMnt";

            int rtn = Mfb.Update();

            if (rtn == ComConst.FAILED)
            {
                lblMsg.Text      = Mfb.strErr;
                lblMsg.ForeColor = Color.Red;
                return;
            }

            // ここでは削除して登録
            //loc.whs_cd = hdnITEM_NO.Value;
            //loc.location = hdnSequent.Value;
            //loc.chg_pgm = "MstLocationMnt";

            //int rtn = loc.Delete();
            //if (rtn != ComConst.SUCCEED)
            //{
            //    lblMsg.Text = loc.strErr;
            //    lblMsg.ForeColor = Color.Red;
            //    return;
            //}

            //loc.whs_cd = txtITEM_NO.Text.Trim().ToUpper();
            //loc.location = txtSequent.Text.Trim().ToUpper();
            //loc.location_desc = txtChild_Item.Text.Trim();
            //loc.chg_pgm = "MstLocationMnt";

            //rtn = loc.Insert();
            //if (rtn != ComConst.SUCCEED)
            //{
            //    lblMsg.Text = loc.strErr;
            //    lblMsg.ForeColor = Color.Red;
            //    return;
            //}

            Edit_Screen();
        }
Exemplo n.º 7
0
        /// <summary>
        /// 画面編集
        /// </summary>
        protected void Edit_Screen()
        {
            ComLibrary com  = new ComLibrary();
            Message    msg  = new Message(g_user_id, g_lang);
            Item       item = new Item(g_user_id, g_lang);
            MfgBom     Mfb  = new MfgBom(g_user_id, g_lang);

            if (txtITEM_NO.Text.Trim() == "")
            {
                lblMsg.Text      = msg.GetMessage("INPUT_MANDATORY_ERR") + "(" + flblITEM_NO.Text + ")";
                lblMsg.ForeColor = Color.Red;

                return;
            }
            else
            {
                item.item_no = txtITEM_NO.Text.ToUpper().Trim();
                if (item.GetItemDetail() == ComConst.SUCCEED)
                {
                    txtITEM_DESC.Text    = item.item_desc;
                    txtITEM_DESC.ToolTip = item.item_desc;
                }
                else
                {
                    lblMsg.Text          = msg.GetMessage("ITEM_NOT_EXIST_ERR");
                    lblMsg.ForeColor     = Color.Red;
                    dgvDetail.DataSource = null;
                    dgvDetail.DataBind();
                    txtBOM_No.Text        = "";
                    txtBOM_Level.Text     = "";
                    txtBOM_Sub_Level.Text = "";
                    txtSequent.Text       = "";
                    txtChild_Item.Text    = "";
                    //txtChild_ItemDesc.Text = "";
                    txtUsg_Qty.Text   = "";
                    txtITEM_DESC.Text = "";
                    return;
                }
            }

            //Warehouse whs = new Warehouse(g_user_id, g_lang);
            //whs.whs_cd = txtITEM_NO.Text.ToUpper();
            //txtITEM_NO.Text = whs.whs_cd;
            //int rtn = whs.GetWarehouseDetail();
            //if (rtn == ComConst.FAILED)
            //{
            //    txtITEM_DESC.Text = "";
            //    lblMsg.Text = msg.GetMessage("WAREHOUSE_NOT_EXIST_ERR");
            //    lblMsg.ForeColor = Color.Red;
            //    return;
            //}
            //txtITEM_DESC.Text = whs.whs_desc;

            // マスタを検索
            //Location loc = new Location(g_user_id, g_lang);
            //loc.whs_cd = txtITEM_NO.Text.ToUpper().Trim();

            //DataSet ds = loc.GetLocationList();
            Mfb.parent_item_no = txtITEM_NO.Text.ToUpper();
            txtITEM_NO.Text    = Mfb.parent_item_no;
            DataSet ds = Mfb.GetMfgBomList();

            if (ds == null)
            {
                //lblMsg.Text = loc.strErr;
                lblMsg.Text          = Mfb.strErr;
                lblMsg.ForeColor     = Color.Red;
                dgvDetail.DataSource = null;
                dgvDetail.DataBind();
                txtBOM_No.Text        = "";
                txtBOM_Level.Text     = "";
                txtBOM_Sub_Level.Text = "";
                txtSequent.Text       = "";
                txtChild_Item.Text    = "";
                //txtChild_ItemDesc.Text = "";
                txtUsg_Qty.Text = "";
                return;
            }
            if (ds.Tables[0].Rows.Count == 0)
            {
                //Clear DataGridView
                dgvDetail.DataSource = null;
                dgvDetail.DataBind();
                lblMsg.Text           = msg.GetMessage("DATA_NOT_EXIST_ERR");
                lblMsg.ForeColor      = Color.Red;
                txtBOM_No.Text        = "";
                txtBOM_Level.Text     = "";
                txtBOM_Sub_Level.Text = "";
                txtSequent.Text       = "";
                txtChild_Item.Text    = "";
                //txtChild_ItemDesc.Text = "";
                txtUsg_Qty.Text = "";
                return;
            }
            txtBOM_No.Text         = "";
            txtBOM_Level.Text      = "";
            txtBOM_Sub_Level.Text  = "";
            txtSequent.Text        = "";
            txtChild_Item.Text     = "";
            txtChild_ItemDesc.Text = "";
            txtUsg_Qty.Text        = "";
            hdnITEM_NO.Value       = "";
            hdnSequent.Value       = "";
            hdnChild_Item.Value    = "";

            Edit_grid(ds.Tables[0]);
            ViewState["dgvSearch"] = ds.Tables[0];

            dgvDetail.SelectedIndex = -1;
        }