Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
0
        protected void btnNext_Click(object sender, EventArgs e)
        {
            ComLibrary com = new ComLibrary();

            if (com.StringToInt(ddlMonth.Text) == 12)
            {
                if (com.StringToInt(ddlYear.Text) == 2037)
                {
                    return;
                }
                ddlMonth.Text = "01";
                ddlYear.Text  = (com.StringToInt(ddlYear.Text) + 1).ToString();
            }
            else
            {
                ddlMonth.Text = (com.StringToInt(ddlMonth.Text) + 1).ToString("0#");
            }
            ddlMonth_SelectedIndexChanged(null, null);
        }
Ejemplo n.º 3
0
        protected void cmdSave_Click(object sender, EventArgs e)
        {
            ComDB      db    = new ComDB();
            ComLibrary comlb = new ComLibrary();
            Message    msg   = new Message(g_user_id, g_lang);
            ComLibrary com   = new ComLibrary();
            DataSet    ds    = new DataSet();
            Rcv        rc1   = new Rcv(g_user_id, g_lang);
            int        rtn   = 0;

            if (txtITEM_NO.Text == "")
            {
                lblMsg.Text      = msg.GetMessage("ITEM_NOT_EXIST_ERR");
                lblMsg.ForeColor = Color.Red;
                return;
            }
            ds = rc1.GetPartNo(txtITEM_NO.Text);
            if (ds == null || ds.Tables[0].Rows.Count == 0)
            {
                lblMsg.Text      = msg.GetMessage("ITEM_NOT_EXIST_ERR");
                lblMsg.ForeColor = Color.Red;
                return;
            }
            if (!comlb.IsNumeric(txtRCV_QTY.Text.ToString()))
            {
                lblMsg.Text      = "Receive Qty Error";
                lblMsg.ForeColor = Color.Red;
                return;
            }

            rc1.part_no     = txtITEM_NO.Text;
            rc1.receive_qty = com.StringToInt(txtRCV_QTY.Text);
            rc1.optmethod   = "PC";
            rtn             = rc1.Insert();
            if (rtn == ComConst.FAILED)
            {
                lblMsg.Text      = rc1.strErr;
                lblMsg.ForeColor = Color.Red;
                return;
            }
            lblMsg.Text      = msg.GetMessage("NORMAL_UPDATE");
            lblMsg.ForeColor = Color.Blue;
            txtITEM_NO.Text  = "";
            txtRCV_QTY.Text  = "";
        }
        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;
        }
        protected void Edit_Grid()
        {
            int        j;
            ComLibrary com = new ComLibrary();
            DataTable  dt  = (DataTable)ViewState["gdvDetail"];

            if (dt.Columns["SELECT"] == null)
            {
                dt.Columns.Add("SELECT");
            }
            gdvDetail.DataSource = dt;
            gdvDetail.DataBind();
            for (int i = 0; i < gdvDetail.Rows.Count; i++)
            {
                j = gdvDetail.Rows[i].DataItemIndex;
                if (dt.Rows[j]["SELECT"].ToString() != "")
                {
                    ((CheckBox)gdvDetail.Rows[i].FindControl("chkSEL")).Checked = com.IntToBool(com.StringToInt(dt.Rows[j]["SELECT"].ToString()));
                }
            }
        }
Ejemplo n.º 6
0
        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);
            String h_period_from = "PERIOD FROM : ";
            String h_period_to   = "       TO : ";

            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();

            prtDt.Columns.Add(new DataColumn("FE_CRANK_OFFLINE"));
            prtDt.Columns.Add(new DataColumn("PRODUCT_DATE"));
            prtDt.Columns.Add(new DataColumn("MODEL"));
            prtDt.Columns.Add(new DataColumn("PROD_LOTNO"));
            prtDt.Columns.Add(new DataColumn("ONLINE_LOTNO"));
            prtDt.Columns.Add(new DataColumn("P1"));
            prtDt.Columns.Add(new DataColumn("P2"));
            prtDt.Columns.Add(new DataColumn("P3"));
            prtDt.Columns.Add(new DataColumn("P4"));
            prtDt.Columns.Add(new DataColumn("P5"));
            prtDt.Columns.Add(new DataColumn("P6"));
            prtDt.Columns.Add(new DataColumn("P7"));
            prtDt.Columns.Add(new DataColumn("P8"));
            prtDt.Columns.Add(new DataColumn("P9"));

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

                    DataRow dr = prtDt.NewRow();
                    dr["FE_CRANK_OFFLINE"] = dt.Rows[i]["OFFLINE_NO"].ToString();
                    dr["PRODUCT_DATE"]     = dt.Rows[i]["PRODUCT_DATE"];
                    dr["MODEL"]            = dt.Rows[i]["MODEL"].ToString();
                    dr["PROD_LOTNO"]       = dt.Rows[i]["LOTNO"].ToString();
                    dr["ONLINE_LOTNO"]     = dt.Rows[i]["ONLINE_LOTNO"].ToString();
                    dr["P1"] = dt.Rows[i]["RESULT1"];
                    dr["P2"] = dt.Rows[i]["RESULT2"];
                    dr["P3"] = dt.Rows[i]["RESULT3"];
                    dr["P4"] = dt.Rows[i]["RESULT4"];
                    dr["P5"] = dt.Rows[i]["RESULT5"];
                    dr["P6"] = dt.Rows[i]["RESULT_4P"];
                    dr["P7"] = dt.Rows[i]["RESULT_3P"];
                    dr["P8"] = dt.Rows[i]["RESULT_2P"];
                    dr["P9"] = dt.Rows[i]["RESULT_1P"];

                    prtDt.Rows.Add(dr);

                    h_period_to = "           TO : " + dt.Rows[i]["PRODUCT_DATE"].ToString();
                }
            }
            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.FeOffline();
            string ReportName = "FeOffProd";

            try
            {
                //Rpt.Subreports["SubReport"].SetDataSource(prtDtTotal);
                Rpt.SetDataSource(prtDt);
                Rpt.SetParameterValue("H_TITLE", "HATC-M P-EGD   Production Sheet Control");
                Rpt.SetParameterValue("H_DATA_TYPE", "DATA TYPE : OFF LINE");
                Rpt.SetParameterValue("H_TYPE", "TYPE :");
                Rpt.SetParameterValue("H_DEPT", "DEPT. : FE-P");
                if (ddlPROCESS.SelectedValue == "Crank Shaft")
                {
                    Rpt.SetParameterValue("H_PART_NAME", "PART NAME : CRANK F/G");
                    Rpt.SetParameterValue("H_LINE", "LINE : CRANK LINE");
                    Rpt.SetParameterValue("H_PLC", "BEARING CODE");
                }
                else
                {
                    Rpt.SetParameterValue("H_PART_NAME", "PART NAME : CONNROD F/G");
                    Rpt.SetParameterValue("H_LINE", "LINE : CONNROD LINE");
                    Rpt.SetParameterValue("H_PLC", "DIE WEIGHT");
                }
                Rpt.SetParameterValue("H_PERIOD_FROM", h_period_from);
                Rpt.SetParameterValue("H_PERIOD_TO", h_period_to);

                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;
        }
Ejemplo n.º 7
0
        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            Message msg = new Message(g_user_id, g_lang);

            IMClass.Calendar cal = new IMClass.Calendar(g_user_id, g_lang);

            ComLibrary com = new ComLibrary();
            // Calendarマスタを更新
            // 画面から項目を編集

            //First Year's Firstday
            DateTime mDatetime         = new DateTime(Convert.ToInt16(ddlYear.Text), 1, 1); //yea
            int      firstweekfirstday = Convert.ToInt32(mDatetime.DayOfWeek);              //First Year's Firstday
            int      days = (int)(7 - firstweekfirstday) + 1;

            cal.calendar_id = "00";//默认00
            cal.lang        = g_lang;
            for (int i = 0; i < 15; i++)
            {
                cal.calendar_date = Convert.ToInt32(ddlYear.Text + ddlMonth.Text + (Convert.ToInt16(dgvCalendarF.Rows[i].Cells[0].Text)).ToString("0#"));
                //cal.calendar_cym = Convert.ToInt32(ddlYear.Text + ddlMonth.Text);
                DateTime datecal = new DateTime(Convert.ToInt32(ddlYear.Text), Convert.ToInt16(ddlMonth.Text), Convert.ToInt16(dgvCalendarF.Rows[i].Cells[0].Text));
                //if (datecal.DayOfYear <= days)//first week
                //{
                //    cal.week_no = Convert.ToInt32(ddlYear.Text + "01");
                //}
                //else
                //{
                //    cal.week_no = Convert.ToInt32(ddlYear.Text + (((datecal.DayOfYear - days - 1) / 7) + 2).ToString("0#"));
                //}

                //switch (datecal.DayOfWeek.ToString())//Convert.ToInt32(mDatetime.DayOfWeek) to int
                //{
                //    case "Monday": cal.day_of_week = 1; break;
                //    case "Tuesday": cal.day_of_week = 2; break;
                //    case "Wednesday": cal.day_of_week = 3; break;
                //    case "Thursday": cal.day_of_week = 4; break;
                //    case "Friday": cal.day_of_week = 5; break;
                //    case "Saturday": cal.day_of_week = 6; break;
                //    case "Sunday": cal.day_of_week = 7; break;
                //}
                //cal.day_of_week = Convert.ToInt16(datecal.DayOfWeek());

                if (((CheckBox)dgvCalendarF.Rows[i].FindControl("ckbh1")).Checked)
                {
                    cal.holiday_flag = 1;
                }
                else
                {
                    cal.holiday_flag = 0;
                }

                if (((CheckBox)dgvCalendarF.Rows[i].FindControl("ckbp1")).Checked)
                {
                    cal.po_rls_flag = 1;
                }
                else
                {
                    cal.po_rls_flag = 0;
                }

                if (((TextBox)dgvCalendarF.Rows[i].FindControl("txtWHour1")).Text == "")//|| cal.holiday_flag == 1)
                {
                    cal.std_working_hour = 0;
                }
                else
                {
                    cal.std_working_hour = com.StringToDouble(((TextBox)dgvCalendarF.Rows[i].FindControl("txtWHour1")).Text.ToString());
                }
                //cal.user_group = "";
                //cal.chg_pgm = "MstCalendarMnt";
                cal.chg_user_id = g_user_id;

                int rtn = 0;
                rtn = cal.Update();
                if (rtn == ComConst.FAILED)
                {
                    lblMsg.Text      = cal.strErr;
                    lblMsg.ForeColor = Color.Red;
                    return;
                }
            }
            for (int i = 0; i < DateTime.DaysInMonth(Convert.ToInt16(ddlYear.Text), Convert.ToInt16(ddlMonth.Text)) - 15; i++)
            {
                cal.calendar_date = Convert.ToInt32(ddlYear.Text + ddlMonth.Text + Convert.ToInt32(dgvCalendarA.Rows[i].Cells[0].Text).ToString("0#"));
                //cal.calendar_cym = Convert.ToInt32(ddlYear.Text + ddlMonth.Text);
                //DateTime datecal = new DateTime(Convert.ToInt32(ddlYear.Text), Convert.ToInt16(ddlMonth.Text), Convert.ToInt16(dgvCalendarA.Rows[i].Cells[0].Text));

                //cal.week_no = Convert.ToInt32(ddlYear.Text + (((datecal.DayOfYear - days - 1) / 7) + 2).ToString("0#"));
                //switch (datecal.DayOfWeek.ToString())
                //{
                //    case "Monday": cal.day_of_week = 1; break;
                //    case "Tuesday": cal.day_of_week = 2; break;
                //    case "Wednesday": cal.day_of_week = 3; break;
                //    case "Thursday": cal.day_of_week = 4; break;
                //    case "Friday": cal.day_of_week = 5; break;
                //    case "Saturday": cal.day_of_week = 6; break;
                //    case "Sunday": cal.day_of_week = 7; break;
                //}

                if (((CheckBox)dgvCalendarA.Rows[i].FindControl("ckbh2")).Checked)
                {
                    cal.holiday_flag = 1;
                }
                else
                {
                    cal.holiday_flag = 0;
                }

                if (((CheckBox)dgvCalendarA.Rows[i].FindControl("ckbp2")).Checked)
                {
                    cal.po_rls_flag = 1;
                }
                else
                {
                    cal.po_rls_flag = 0;
                }

                if (((TextBox)dgvCalendarA.Rows[i].FindControl("txtWHour2")).Text == "")//|| cal.holiday_flag == 1)
                {
                    cal.std_working_hour = 0;
                }
                else
                {
                    cal.std_working_hour = com.StringToDouble(((TextBox)dgvCalendarA.Rows[i].FindControl("txtWHour2")).Text.ToString());
                }
                //cal.user_group = "";
                //cal.chg_pgm = "MstCalendarMnt";
                cal.chg_user_id = g_user_id;

                int rtn = 0;

                rtn = cal.Update();
                if (rtn == ComConst.FAILED)
                {
                    lblMsg.Text      = cal.strErr;
                    lblMsg.ForeColor = Color.Red;
                    return;
                }
            }
            cal.calendar_id   = "00";
            cal.lang          = g_lang;
            cal.calendar_date = com.StringToInt(ddlYear.Text + ddlMonth.Text + "01");
            int rtn2 = 0;

            rtn2 = cal.Work_Days_Update();
            if (rtn2 == ComConst.FAILED)
            {
                lblMsg.Text      = cal.strErr;
                lblMsg.ForeColor = Color.Red;
                return;
            }
            lblMsg.Text = msg.GetMessage("NORMAL_UPDATE");

            lblMsg.ForeColor = Color.Blue;
        }
Ejemplo n.º 8
0
        //
        // 初期画面編集
        //
        protected void Init_Proc()
        {
            //Auth_Proc();//ADD BY UBIQ-LIU 2010/8/4
            //dt用于扩充gridview行列
            DataTable dt  = new DataTable();
            Message   msg = new Message(g_user_id, g_lang);

            for (int i = 0; i < 16; i++)
            {
                if (dt.Columns.Count == 0)
                {
                    dt.Columns.Add("co1");
                    dt.Columns.Add("co2");
                    dt.Columns.Add("co3");
                    dt.Columns.Add("co4");
                    dt.Columns.Add("co5");
                }
                if (dt.Rows.Count < 16)
                {
                    dt.Rows.Add();
                }
            }
            dgvCalendarF.DataSource = dt;
            dgvCalendarF.DataBind();
            dgvCalendarA.DataSource = dt;
            dgvCalendarA.DataBind();
            ComLibrary com = new ComLibrary();

            // Calendarマスタを検索
            IMClass.Calendar cal = new IMClass.Calendar(g_user_id, g_lang);
            cal.calendar_id  = "00";
            cal.calendar_cym = Convert.ToInt32(ddlYear.Text + ddlMonth.Text);

            DataSet ds = cal.GetCalendarMonthlyDetail();

            if (ds == null)
            {
                lblMsg.Text      = cal.strErr;
                lblMsg.ForeColor = Color.Red;
                return;
            }
            if (ds.Tables[0].Rows.Count != 0)
            {
                //前半月
                for (int i = 0; i < dgvCalendarF.Rows.Count; i++)
                {
                    dgvCalendarF.Rows[i].Cells[0].Text = ds.Tables[0].Rows[i]["Calendar_date"].ToString().Substring(6, 2);
                    switch (ds.Tables[0].Rows[i]["Day_of_week"].ToString())
                    {
                    case "1": dgvCalendarF.Rows[i].Cells[1].Text = ViewState["weekday1"].ToString(); break;

                    case "2": dgvCalendarF.Rows[i].Cells[1].Text = ViewState["weekday2"].ToString(); break;

                    case "3": dgvCalendarF.Rows[i].Cells[1].Text = ViewState["weekday3"].ToString(); break;

                    case "4": dgvCalendarF.Rows[i].Cells[1].Text = ViewState["weekday4"].ToString(); break;

                    case "5": dgvCalendarF.Rows[i].Cells[1].Text = ViewState["weekday5"].ToString(); break;

                    case "6": dgvCalendarF.Rows[i].Cells[1].Text = ViewState["weekday6"].ToString(); break;

                    case "7": dgvCalendarF.Rows[i].Cells[1].Text = ViewState["weekday7"].ToString(); break;
                    }
                    ((CheckBox)dgvCalendarF.Rows[i].FindControl("ckbh1")).Checked = com.IntToBool(com.StringToInt(ds.Tables[0].Rows[i]["HOLIDAY_FLAG"].ToString()));

                    //((CheckBox)dgvCalendarF.Rows[i].FindControl("ckbp1")).Checked = com.IntToBool(com.StringToInt(ds.Tables[0].Rows[i]["PO_RLS_FLAG"].ToString()));
                    ((CheckBox)dgvCalendarF.Rows[i].FindControl("ckbp1")).Checked = com.IntToBool(com.StringToInt(ds.Tables[0].Rows[i]["PROCESS_FLAG"].ToString()));

                    //if (com.StringToDouble(ds.Tables[0].Rows[i]["STD_WORKING_HOUR"].ToString()) != 0)
                    //{
                    //    ((TextBox)dgvCalendarF.Rows[i].FindControl("txtWHour1")).Text = ds.Tables[0].Rows[i]["STD_WORKING_HOUR"].ToString();
                    //}
                    if (com.StringToDouble(ds.Tables[0].Rows[i]["STD_WORKING"].ToString()) != 0)
                    {
                        ((TextBox)dgvCalendarF.Rows[i].FindControl("txtWHour1")).Text = ds.Tables[0].Rows[i]["STD_WORKING"].ToString();
                    }
                    //else
                    //{
                    //    ((TextBox)dgvCalendarF.Rows[i].FindControl("txtWHour1")).Text = "";
                    //}
                }
                dgvCalendarF.Rows[15].Visible = false;
                //后半月
                for (int i = 0; i < dgvCalendarA.Rows.Count; i++)
                {
                    if (i < DateTime.DaysInMonth(Convert.ToInt16(ddlYear.Text), Convert.ToInt16(ddlMonth.Text)) - 15)
                    {
                        dgvCalendarA.Rows[i].Cells[0].Text = ds.Tables[0].Rows[i + 15]["Calendar_date"].ToString().Substring(6, 2);
                        switch (ds.Tables[0].Rows[i + 15]["Day_of_week"].ToString())
                        {
                        case "1": dgvCalendarA.Rows[i].Cells[1].Text = ViewState["weekday1"].ToString(); break;

                        case "2": dgvCalendarA.Rows[i].Cells[1].Text = ViewState["weekday2"].ToString(); break;

                        case "3": dgvCalendarA.Rows[i].Cells[1].Text = ViewState["weekday3"].ToString(); break;

                        case "4": dgvCalendarA.Rows[i].Cells[1].Text = ViewState["weekday4"].ToString(); break;

                        case "5": dgvCalendarA.Rows[i].Cells[1].Text = ViewState["weekday5"].ToString(); break;

                        case "6": dgvCalendarA.Rows[i].Cells[1].Text = ViewState["weekday6"].ToString(); break;

                        case "7": dgvCalendarA.Rows[i].Cells[1].Text = ViewState["weekday7"].ToString(); break;
                        }
                        ((CheckBox)dgvCalendarA.Rows[i].FindControl("ckbh2")).Checked = com.IntToBool(com.StringToInt(ds.Tables[0].Rows[i + 15]["HOLIDAY_FLAG"].ToString()));
                        //((CheckBox)dgvCalendarA.Rows[i].FindControl("ckbp2")).Checked = com.IntToBool(com.StringToInt(ds.Tables[0].Rows[i + 15]["PO_RLS_FLAG"].ToString()));
                        ((CheckBox)dgvCalendarA.Rows[i].FindControl("ckbp2")).Checked = com.IntToBool(com.StringToInt(ds.Tables[0].Rows[i + 15]["PROCESS_FLAG"].ToString()));

                        //if (com.StringToDouble(ds.Tables[0].Rows[i + 15]["STD_WORKING_HOUR"].ToString()) != 0)
                        //{
                        //    ((TextBox)dgvCalendarA.Rows[i].FindControl("txtWHour2")).Text = ds.Tables[0].Rows[i + 15]["STD_WORKING_HOUR"].ToString();
                        //}
                        if (com.StringToDouble(ds.Tables[0].Rows[i + 15]["STD_WORKING"].ToString()) != 0)
                        {
                            ((TextBox)dgvCalendarA.Rows[i].FindControl("txtWHour2")).Text = ds.Tables[0].Rows[i + 15]["STD_WORKING"].ToString();
                        }
                        //else //set text = "" then the text well change to 0.00
                        //{
                        //    ((TextBox)dgvCalendarA.Rows[i].FindControl("txtWHour2")).Text = "";
                        //}
                    }
                    else
                    {
                        dgvCalendarA.Rows[i].Visible = false;
                    }
                }
                //cmdUpdate.Enabled = true;//DEL BY UBIQ-LIU 2010/8/4
                //switch (g_lang)
                //{
                //    case 1:
                //        //cmdDisp.ImageUrl = "../../Contents/Image/BackGround/btn-ind1-1.jpg";
                //        cmdUpdate.ImageUrl = "../../Contents/Image/BackGround/btn-update1-1.jpg";
                //        break;
                //    case 2:
                //        //cmdDisp.ImageUrl = "../../Contents/Image/BackGround/btn-ind1-2.jpg";
                //        cmdUpdate.ImageUrl = "../../Contents/Image/BackGround/btn-update1-2.jpg";
                //        break;
                //    case 3:
                //        //cmdDisp.ImageUrl = "../../Contents/Image/BackGround/btn-ind1-3.jpg";
                //        cmdUpdate.ImageUrl = "../../Contents/Image/BackGround/btn-update1-3.jpg";
                //        break;
                //    case 4:
                //        //cmdDisp.ImageUrl = "../../Contents/Image/BackGround/btn-ind1-4.jpg";
                //        cmdUpdate.ImageUrl = "../../Contents/Image/BackGround/btn-update1-4.jpg";
                //        break;
                //}
            }
            else
            {
                lblMsg.Text      = msg.GetMessage("NOT_EXIST_ERR");
                lblMsg.ForeColor = Color.Red;
                return;
            }
        }
Ejemplo n.º 9
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();
        }