private void dgvItem_DoubleClick(object sender, EventArgs e) { DataGridViewRow row = this.dgvItem.SelectedRows[0]; ddlType.SelectedIndex = APConfig.getSelectIndex(ddlType, row.Cells["dgvItem_Type"].Value.ToString()); txtItemInfo.Text = row.Cells["dgvItem_Item"].Value.ToString(); txtAmount.Text = row.Cells["dgvItem_Amount"].Value.ToString(); }
private void dgvItem_DoubleClick(object sender, EventArgs e) { DataGridViewRow row = this.dgvItem.SelectedRows[0]; ddlDealer.SelectedIndex = APConfig.getSelectIndex(ddlDealer, row.Cells["dgvItem_Dealer"].Value.ToString()); txtExportAmount.Text = row.Cells["dgvItem_Amount"].Value.ToString(); dpkExportDTTM.Value = Convert.ToDateTime(row.Cells["dgvItem_ImportDTTM"].Value); txtExportComment.Text = row.Cells["dgvItem_Comment"].Value.ToString(); }
private void initView() { if (mode == mode.Add) { btnOK.ButtonText = "新增"; btnOK.IdleFillColor = Color.FromArgb(33, 166, 117); btnOK.IdleLineColor = Color.FromArgb(33, 166, 117); btnOK.ActiveFillColor = Color.FromArgb(33, 166, 117); btnOK.ActiveLineColor = Color.FromArgb(33, 166, 117); } else if (mode == mode.Edit) { btnOK.ButtonText = "修改"; btnOK.IdleFillColor = Color.FromArgb(255, 161, 0); btnOK.IdleLineColor = Color.FromArgb(255, 161, 0); btnOK.ActiveFillColor = Color.FromArgb(255, 161, 0); btnOK.ActiveLineColor = Color.FromArgb(255, 161, 0); ddlCategory.Enabled = false; PhraseInfo view = new PhraseInfo(APConfig.Conn); view.Conditions = " 1=1 "; view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.serno.ToString(), serno); if (view.load()) { txtName.Text = view.PHS_NAME; txtIndex.Text = view.PHS_INDEX; txtType.Text = view.PHS_TYPE; APConfig.getSelectIndex(ddlCategory, view.PHS_CATEGORY); } } else if (mode == mode.View) { DisableControls(); btnOK.ButtonText = "確認"; PhraseInfo view = new PhraseInfo(APConfig.Conn); view.Conditions = " 1=1 "; view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.serno.ToString(), serno); if (view.load()) { txtName.Text = view.PHS_NAME; txtIndex.Text = view.PHS_INDEX; txtType.Text = view.PHS_TYPE; APConfig.getSelectIndex(ddlCategory, view.PHS_CATEGORY); } } }
private void initView() { if (mode == mode.Add) { btnOK.ButtonText = "新增"; btnOK.IdleFillColor = Color.FromArgb(33, 166, 117); btnOK.IdleLineColor = Color.FromArgb(33, 166, 117); btnOK.ActiveFillColor = Color.FromArgb(33, 166, 117); btnOK.ActiveLineColor = Color.FromArgb(33, 166, 117); dpkExportDTTM.Value = DateTime.Today; ddlDealer.SelectedIndex = 0; } else if (mode == mode.Edit) { btnOK.ButtonText = "修改"; btnOK.IdleFillColor = Color.FromArgb(255, 161, 0); btnOK.IdleLineColor = Color.FromArgb(255, 161, 0); btnOK.ActiveFillColor = Color.FromArgb(255, 161, 0); btnOK.ActiveLineColor = Color.FromArgb(255, 161, 0); btnAvg.Visible = false; btnItemAdd.Visible = false; btnItemDel.Visible = false; btnClear.Visible = false; lblTotalAmt.Visible = false; txtCode.Enabled = false; InventoryInfo view = new InventoryInfo(APConfig.Conn); view.Conditions = " 1=1 "; view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.serno.ToString(), serno); view.load(); if (view.load()) { txtCode.Text = view.INV_CODE; txtName.Text = view.INV_NAME; txtImportAmount.Text = view.INV_INAMT.ToString(); txtImportComment.Text = view.INV_INCOMMENT; dpkImportDTTM.Value = view.INV_INDTTM; ddlDealer.SelectedIndex = APConfig.getSelectIndex(ddlDealer, view.INV_OUTDEALER); txtExportAmount.Text = view.INV_OUTAMT.ToString(); dpkExportDTTM.Value = view.INV_OUTDTTM; txtExportComment.Text = view.INV_OUTCOMMENT; } } else if (mode == mode.View) { DisableControls(); btnOK.ButtonText = "確認"; btnItemAdd.Visible = false; btnItemDel.Visible = false; btnClear.Visible = false; lblTotalAmt.Visible = false; InventoryInfo view = new InventoryInfo(APConfig.Conn); view.Conditions = " 1=1 "; view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.serno.ToString(), serno); view.load(); if (view.load()) { txtCode.Text = view.INV_CODE; txtName.Text = view.INV_NAME; txtImportAmount.Text = view.INV_INAMT.ToString(); txtImportComment.Text = view.INV_INCOMMENT; dpkImportDTTM.Value = view.INV_INDTTM; ddlDealer.SelectedIndex = APConfig.getSelectIndex(ddlDealer, view.INV_OUTDEALER); txtExportAmount.Text = view.INV_OUTAMT.ToString(); dpkExportDTTM.Value = view.INV_OUTDTTM; txtExportComment.Text = view.INV_OUTCOMMENT; } } }
private void initView() { if (mode == mode.Add) { btnOK.ButtonText = "新增"; btnOK.IdleFillColor = Color.FromArgb(33, 166, 117); btnOK.IdleLineColor = Color.FromArgb(33, 166, 117); btnOK.ActiveFillColor = Color.FromArgb(33, 166, 117); btnOK.ActiveLineColor = Color.FromArgb(33, 166, 117); panelInfo.Visible = false; txtName.Text = mRosterInfo.RST_NAME; txtMobile.Text = mRosterInfo.RST_MAIN; txtAddr.Text = mRosterInfo.RST_ADDR; dpkDealDTTM.Value = DateTime.Today; ddlStatus.SelectedIndex = 3; ddlType.SelectedIndex = 0; ddlDealer.SelectedIndex = APConfig.getSelectIndex(ddlDealer, mRosterInfo.RST_PRINCIPAL) == -1 ? 0 : APConfig.getSelectIndex(ddlDealer, mRosterInfo.RST_PRINCIPAL); ddlY.SelectedIndex = 0; ddlM.SelectedIndex = 0; } else if (mode == mode.Edit) { btnOK.ButtonText = "修改"; btnOK.IdleFillColor = Color.FromArgb(255, 161, 0); btnOK.IdleLineColor = Color.FromArgb(255, 161, 0); btnOK.ActiveFillColor = Color.FromArgb(255, 161, 0); btnOK.ActiveLineColor = Color.FromArgb(255, 161, 0); btnItemAdd.Visible = false; btnItemDel.Visible = false; btnItemPick.Visible = false; btnClear.Visible = false; btnDone.Visible = false; lblTotalAmt.Visible = false; panelInfo.Visible = true; RosterDial_RInfo view = new RosterDial_RInfo(APConfig.Conn); view.Conditions = " 1=1 "; view.Conditions += " AND " + view.getCondition(RosterDial_RInfo.ncConditions.rsdserno.ToString(), serno); if (view.load()) { txtName.Text = view.RST_NAME; txtMobile.Text = view.RST_MAIN; txtAddr.Text = view.RST_ADDR; ddlDealer.SelectedIndex = APConfig.getSelectIndex(ddlDealer, view.RSD_DEALER); ddlStatus.SelectedIndex = APConfig.getSelectIndex(ddlStatus, view.RSD_STATUS); ddlType.SelectedIndex = APConfig.getSelectIndex(ddlType, view.RSD_ITEMTYPE); txtItemInfo.Text = view.RSD_ITEM; txtAmount.Text = view.RSD_AMOUNT; txtComment.Text = view.RSD_COMMENT; lblInsertBy.Text = view.RSD_INSERTBY; lblInsertDTTM.Text = view.RSD_INSERTDTTM.ToString(); lblModifyBy.Text = view.RSD_MODIFIEDBY; lblModifyDTTM.Text = view.RSD_MODIFIEDDTTM.ToString(); dpkDealDTTM.Value = view.RSD_DEALDDTTM; } } else if (mode == mode.View) { DisableControls(); btnOK.ButtonText = "確認"; btnItemAdd.Visible = false; btnItemDel.Visible = false; btnClear.Visible = false; btnItemPick.Visible = false; btnDone.Visible = false; panelInfo.Visible = true; lblTotalAmt.Visible = false; RosterDial_RInfo view = new RosterDial_RInfo(APConfig.Conn); view.Conditions = " 1=1 "; view.Conditions += " AND " + view.getCondition(RosterDial_RInfo.ncConditions.rsdserno.ToString(), serno); if (view.load()) { txtName.Text = view.RST_NAME; txtMobile.Text = view.RST_MAIN; txtAddr.Text = view.RST_ADDR; ddlDealer.SelectedIndex = APConfig.getSelectIndex(ddlDealer, view.RSD_DEALER); ddlStatus.SelectedIndex = APConfig.getSelectIndex(ddlStatus, view.RSD_STATUS); ddlType.SelectedIndex = APConfig.getSelectIndex(ddlType, view.RSD_ITEMTYPE); txtItemInfo.Text = view.RSD_ITEM; txtAmount.Text = view.RSD_AMOUNT; txtComment.Text = view.RSD_COMMENT; lblInsertBy.Text = view.RSD_INSERTBY; lblInsertDTTM.Text = view.RSD_INSERTDTTM.ToString(); lblModifyBy.Text = view.RSD_MODIFIEDBY; lblModifyDTTM.Text = view.RSD_MODIFIEDDTTM.ToString(); dpkDealDTTM.Value = view.RSD_DEALDDTTM; } } }
private void initView() { if (mode == mode.Add) { btnOK.ButtonText = "新增"; btnOK.IdleFillColor = Color.FromArgb(33, 166, 117); btnOK.IdleLineColor = Color.FromArgb(33, 166, 117); btnOK.ActiveFillColor = Color.FromArgb(33, 166, 117); btnOK.ActiveLineColor = Color.FromArgb(33, 166, 117); panelInfo.Visible = false; ddlPrinciple.SelectedIndex = 0; ddlSex.SelectedIndex = 0; } else if (mode == mode.Edit) { btnOK.ButtonText = "修改"; btnOK.IdleFillColor = Color.FromArgb(255, 161, 0); btnOK.IdleLineColor = Color.FromArgb(255, 161, 0); btnOK.ActiveFillColor = Color.FromArgb(255, 161, 0); btnOK.ActiveLineColor = Color.FromArgb(255, 161, 0); txtMain.Enabled = false; panelInfo.Visible = true; RosterInfo vRoster = new RosterInfo(APConfig.Conn); vRoster.Conditions = " 1=1 "; vRoster.Conditions += " AND " + vRoster.getCondition(RosterInfo.ncConditions.serno.ToString(), serno); if (vRoster.load()) { txtName.Text = vRoster.RST_NAME; txtMain.Text = vRoster.RST_MAIN; txtPhone1.Text = vRoster.RST_PHONE1; txtPhone2.Text = vRoster.RST_PHONE2; txtMobile.Text = vRoster.RST_MOBILE; txtFax.Text = vRoster.RST_FAX; txtAddr.Text = vRoster.RST_ADDR; txtComment.Text = vRoster.RST_COMMENT; ddlSex.SelectedIndex = APConfig.getSelectIndex(ddlSex, vRoster.RST_SEX); ddlPrinciple.SelectedIndex = APConfig.getSelectIndex(ddlPrinciple, vRoster.RST_PRINCIPAL); lblInsertBy.Text = vRoster.RST_INSERTBY; lblInsertDTTM.Text = vRoster.RST_INSERTDTTM.ToString(); lblModifyBy.Text = vRoster.RST_MODIFIEDBY; lblModifyDTTM.Text = vRoster.RST_MODIFIEDDTTM.ToString(); } } else if (mode == mode.View) { DisableControls(); btnOK.ButtonText = "確認"; txtMobile.Enabled = false; btnGetAddress.Visible = false; panelInfo.Visible = true; RosterInfo vRoster = new RosterInfo(APConfig.Conn); vRoster.Conditions = " 1=1 "; vRoster.Conditions += " AND " + vRoster.getCondition(RosterInfo.ncConditions.serno.ToString(), serno); vRoster.load(); txtName.Text = vRoster.RST_NAME; txtMain.Text = vRoster.RST_MAIN; txtPhone1.Text = vRoster.RST_PHONE1; txtPhone2.Text = vRoster.RST_PHONE2; txtMobile.Text = vRoster.RST_MOBILE; txtFax.Text = vRoster.RST_FAX; txtAddr.Text = vRoster.RST_ADDR; txtComment.Text = vRoster.RST_COMMENT; ddlSex.SelectedIndex = APConfig.getSelectIndex(ddlSex, vRoster.RST_SEX); ddlPrinciple.SelectedIndex = APConfig.getSelectIndex(ddlPrinciple, vRoster.RST_PRINCIPAL); lblInsertBy.Text = vRoster.RST_INSERTBY; lblInsertDTTM.Text = vRoster.RST_INSERTDTTM.ToString(); lblModifyBy.Text = vRoster.RST_MODIFIEDBY; lblModifyDTTM.Text = vRoster.RST_MODIFIEDDTTM.ToString(); } }