protected void cmdSave_Click(object sender, EventArgs e) { Transfer tran = new Transfer(g_user_id, g_lang); Message msg = new Message(g_user_id, g_lang); ComLibrary com = new ComLibrary(); tran.item_no = txtITEM_NO.Text; tran.lot_no = txtLOT_NO.Text; tran.act_qty = com.StringToDouble("1"); tran.die_no = txtDIE_NO.Text; tran.shift = txtSHIFT_NO.Text; //tran.Data_1 = "0"; //tran.Data_2 = "0"; //tran.Data_3 = "0"; //tran.Data_4 = "0"; //tran.Data_5 = "0"; if (tran.FEReceiveHT() == ComConst.FAILED) { lblMsg.Text = tran.strErr; lblMsg.ForeColor = Color.Red; return; } lblMsg.Text = msg.GetMessage("NORMAL_UPDATE"); lblMsg.ForeColor = Color.Blue; }
protected void cmdSave_Click(object sender, EventArgs e) { Transfer tran = new Transfer(g_user_id, g_lang); Message msg = new Message(g_user_id, g_lang); ComLibrary com = new ComLibrary(); tran.item_no = txtITEM_NO.Text; tran.lot_no = txtLOT_NO.Text; tran.act_qty = com.StringToDouble(txtRCV_QTY.Text); tran.die_no = txtDIE_NO.Text; tran.shift = txtSHIFT_NO.Text; if (ddlPROCESS.SelectedValue == "Crank Shaft") { if (tran.FEReceivePC() == ComConst.FAILED) { lblMsg.Text = tran.strErr; lblMsg.ForeColor = Color.Red; return; } } if (ddlPROCESS.SelectedValue == "Conn Rod") { if (tran.FEReceivePCA() == ComConst.FAILED) { lblMsg.Text = tran.strErr; lblMsg.ForeColor = Color.Red; return; } } lblMsg.Text = msg.GetMessage("NORMAL_UPDATE"); lblMsg.ForeColor = Color.Blue; txtITEM_NO.Text = ""; txtLOT_NO.Text = ""; txtRCV_QTY.Text = ""; txtDIE_NO.Text = ""; txtSHIFT_NO.Text = ""; }
// // 初期画面編集 // 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; } }
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; }
/// <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(); }