public FormPopupNotify(Form _parent) { InitializeComponent(); this.Owner = _parent; KnUtil.setDlgLocationParentCenter(_parent, this); }
private void gridView_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e) { if (0 > e.RowHandle && sender.GetType() != typeof(GridView)) { return; } DataRow dr = gridView.GetDataRow(e.RowHandle); if (null != dr && dr.Table.Columns.Contains("state_cd")) { try { int state_cd = KnUtil.parseInt32(dr["state_cd"].ToString()); Color row_color = ObjOrder.getStateColor(state_cd); // 색상 적용 if (row_color != Color.Empty) { e.Appearance.BackColor = row_color; } } catch (Exception ex) { TsLog.writeLog(ex.Message); } } }
private void gridView_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e) { if (0 > e.RowHandle && sender.GetType() != typeof(GridView)) { return; } DataRow dr = gridView.GetDataRow(e.RowHandle); if (null != dr && dr.Table.Columns.Contains("display_index")) { try { // 색상 적용 int display_index = KnUtil.parseInt32(dr["display_index"].ToString()); if (0 == (display_index % 2)) { e.Appearance.BackColor = Color.FromArgb(253, 253, 253); } } catch (Exception ex) { TsLog.writeLog(ex.Message); } } }
public bool setObj(DataRow _dr) { if (null == _dr) { return(false); } try { m_config_id = KnUtil.parseInt32(KnUtil.getDataRowString(_dr, "config_id")); m_is_use = KnUtil.parseInt32(KnUtil.getDataRowString(_dr, "is_use")); m_is_install = KnUtil.parseInt32(KnUtil.getDataRowString(_dr, "is_install")); m_input_type = KnUtil.getDataRowString(_dr, "input_type"); m_input_port_num = KnUtil.getDataRowString(_dr, "input_port_num"); m_input_port_baud = KnUtil.parseInt32(KnUtil.getDataRowString(_dr, "input_port_baud")); m_listen_port_num = KnUtil.getDataRowString(_dr, "listen_port_num"); m_listen_port_baud = KnUtil.parseInt32(KnUtil.getDataRowString(_dr, "listen_port_baud")); m_conn_print_port_num = KnUtil.getDataRowString(_dr, "conn_print_port_num"); } catch (Exception ex) { TsLog.writeLog(ex.Message); Debug.Assert(false); return(false); } return(true); }
public bool setObj(DataRow _dr) { if (null == _dr) { return(false); } try { // Order m_order_num = _dr["order_num"].ToString(); m_order_biz_date = KnUtil.parseInt32(_dr["order_biz_date"].ToString()); m_order_type = KnUtil.parseInt32(_dr["order_type"].ToString()); m_state_cd = KnUtil.parseInt32(_dr["state_cd"].ToString()); m_call_num = _dr["call_num"].ToString(); m_call_datetime = KnUtil.parseDateTime(_dr["call_datetime"].ToString()); m_date_1 = KnUtil.parseDateTime(KnUtil.getDataRowString(_dr, "date_1")); m_date_2 = KnUtil.parseDateTime(KnUtil.getDataRowString(_dr, "date_2")); m_date_3 = KnUtil.parseDateTime(KnUtil.getDataRowString(_dr, "date_3")); m_date_4 = KnUtil.parseDateTime(KnUtil.getDataRowString(_dr, "date_4")); m_date_5 = KnUtil.parseDateTime(KnUtil.getDataRowString(_dr, "date_5")); m_date_6 = KnUtil.parseDateTime(KnUtil.getDataRowString(_dr, "date_6")); m_date_7 = KnUtil.parseDateTime(KnUtil.getDataRowString(_dr, "date_7")); // Shop m_shop_name = KnUtil.getDataRowString(_dr, "shop_name"); m_shop_request_time = KnUtil.parseInt32(KnUtil.getDataRowString(_dr, "shop_request_time")); m_shop_request_option = KnUtil.parseInt32(KnUtil.getDataRowString(_dr, "shop_request_option")); m_shop_cost = KnUtil.parseInt32(KnUtil.getDataRowString(_dr, "shop_cost")); // Customer m_customer_name = KnUtil.getDataRowString(_dr, "customer_name"); m_customer_cost = KnUtil.parseInt32(KnUtil.getDataRowString(_dr, "customer_cost")); m_customer_additional_cost = KnUtil.parseInt32(KnUtil.getDataRowString(_dr, "customer_additional_cost")); m_customer_additional_cost_memo = KnUtil.getDataRowString(_dr, "customer_additional_cost_memo"); m_customer_pay_type_cd = KnUtil.parseInt32(KnUtil.getDataRowString(_dr, "customer_pay_type_cd")); m_customer_pay_type_memo = KnUtil.getDataRowString(_dr, "customer_pay_type_memo"); m_customer_request_option = KnUtil.parseInt32(KnUtil.getDataRowString(_dr, "customer_request_option")); m_customer_request_time = KnUtil.parseInt32(KnUtil.getDataRowString(_dr, "customer_request_time")); m_customer_request_memo = KnUtil.getDataRowString(_dr, "customer_request_memo"); // Locate Arv m_arv_locate_name = KnUtil.getDataRowString(_dr, "arv_locate_name"); m_arv_locate_address = KnUtil.getDataRowString(_dr, "arv_locate_address"); m_arv_locate_alternative_address = KnUtil.getDataRowString(_dr, "arv_locate_alternative_address"); m_arv_locate_memo = KnUtil.getDataRowString(_dr, "arv_locate_memo"); m_arv_person_tel_num = KnUtil.getDataRowString(_dr, "arv_person_tel_num"); m_arv_person_memo = KnUtil.getDataRowString(_dr, "arv_person_memo"); } catch (Exception ex) { TsLog.writeLog(ex.Message); return(false); } return(true); }
private OpenApiBase getSelOpenApiManager() { int sel_delivery_open_api_type = KnUtil.formatInt32(KnDevexpressFunc.ComboBoxGetSelectedItemKey(ctr_cbx_open_api_type)); if (-1 != sel_delivery_open_api_type) { return(OpenApiBase.getOpenApiManager((OpenApiBase.OPEN_API_TYPE)sel_delivery_open_api_type)); } return(null); }
private void changeOrderState(int _new_state_cd, int _extra_data_int = 0, String _extra_data_var = "") { if (null == gridView.GetFocusedRowCellValue("order_num")) { KnDevexpressFunc.showMessage("선택된 주문이 없습니다.", MessageBoxIcon.Information); return; } String order_num = gridView.GetFocusedRowCellValue("order_num").ToString(); Int32 old_state_cd = KnUtil.parseInt32(gridView.GetFocusedRowCellValue("state_cd").ToString()); }
public FormDlgUpdate(Form _parent, string _url, string _key, int _version, bool _skip_possible) { setBaseFormData(null, null, DLG_TYPE.TYPE_NORMAL); InitializeComponent(); m_url = _url; m_key = _key; m_version = _version; m_skip_possible = _skip_possible; KnUtil.setDlgLocationParentCenter(_parent, this); }
static public void makeTableSchema(ref DataTable _des_table) { if (null == _des_table) { return; } // Order KnUtil.insureTableColumn(ref _des_table, "order_num", typeof(string)); KnUtil.insureTableColumn(ref _des_table, "order_biz_date", typeof(Int32)); KnUtil.insureTableColumn(ref _des_table, "order_type", typeof(Int32)); KnUtil.insureTableColumn(ref _des_table, "state_cd", typeof(Int32)); KnUtil.insureTableColumn(ref _des_table, "call_num", typeof(string)); KnUtil.insureTableColumn(ref _des_table, "call_datetime", typeof(DateTime)); KnUtil.insureTableColumn(ref _des_table, "date_1", typeof(DateTime)); KnUtil.insureTableColumn(ref _des_table, "date_2", typeof(DateTime)); KnUtil.insureTableColumn(ref _des_table, "date_3", typeof(DateTime)); KnUtil.insureTableColumn(ref _des_table, "date_4", typeof(DateTime)); KnUtil.insureTableColumn(ref _des_table, "date_5", typeof(DateTime)); KnUtil.insureTableColumn(ref _des_table, "date_6", typeof(DateTime)); KnUtil.insureTableColumn(ref _des_table, "date_7", typeof(DateTime)); // Shop KnUtil.insureTableColumn(ref _des_table, "shop_name", typeof(String)); KnUtil.insureTableColumn(ref _des_table, "shop_request_time", typeof(Int32)); KnUtil.insureTableColumn(ref _des_table, "shop_request_option", typeof(Int32)); KnUtil.insureTableColumn(ref _des_table, "shop_cost", typeof(Int32)); // Customer KnUtil.insureTableColumn(ref _des_table, "customer_name", typeof(String)); KnUtil.insureTableColumn(ref _des_table, "customer_cost", typeof(Int32)); KnUtil.insureTableColumn(ref _des_table, "customer_additional_cost", typeof(Int32)); KnUtil.insureTableColumn(ref _des_table, "customer_additional_cost_memo", typeof(String)); KnUtil.insureTableColumn(ref _des_table, "customer_pay_type_cd", typeof(Int32)); KnUtil.insureTableColumn(ref _des_table, "customer_pay_type_memo", typeof(String)); KnUtil.insureTableColumn(ref _des_table, "customer_request_option", typeof(Int32)); KnUtil.insureTableColumn(ref _des_table, "customer_request_time", typeof(Int32)); KnUtil.insureTableColumn(ref _des_table, "customer_request_memo", typeof(String)); // Locate Arv KnUtil.insureTableColumn(ref _des_table, "arv_locate_name", typeof(string)); KnUtil.insureTableColumn(ref _des_table, "arv_locate_address", typeof(string)); KnUtil.insureTableColumn(ref _des_table, "arv_locate_alternative_address", typeof(string)); KnUtil.insureTableColumn(ref _des_table, "arv_locate_memo", typeof(string)); KnUtil.insureTableColumn(ref _des_table, "arv_person_tel_num", typeof(string)); KnUtil.insureTableColumn(ref _des_table, "arv_person_memo", typeof(string)); }
// control -> object override protected void setDlgControlDataToObjects() { for (int i = 0; i < m_controls_config_unit_list.Length; i++) { Controls_ConfigUnit sel_ctr = m_controls_config_unit_list[i]; if (null != sel_ctr) { ObjConfigPrintOutput sel_obj = m_config_list.getObject(i); if (null != sel_ctr) { sel_obj.m_is_use = (sel_ctr.chk_is_use.Checked ? 1 : 0); sel_obj.m_print_connect_type = KnDevexpressFunc.ComboBoxGetSelectedItemKey(sel_ctr.cbx_print_connect_type); sel_obj.m_print_port_num = KnDevexpressFunc.ComboBoxGetSelectedItemKey(sel_ctr.cbx_print_port_num); sel_obj.m_print_port_baud = KnUtil.parseInt32(KnDevexpressFunc.ComboBoxGetSelectedItemKey(sel_ctr.cbx_print_port_baud)); } else { sel_obj.m_is_use = 0; } } } }
private void printPrintPortReceivedData(String _message) { String print_msg = COMPORT_PRINT + ": " + _message; KnUtil.insertListBoxAtFirst(lbx_print_port, 1000, print_msg); }
private void printListenPortReceivedData(String _message) { String print_msg = COMPORT_LISTEN + ": " + _message; KnUtil.insertListBoxAtFirst(lbx_listen_port, 1000, print_msg); }
private void gridView_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) { if (gridView.FocusedRowHandle < 0 && sender.GetType() != typeof(GridView)) { return; } try { if (gridView.IsRowSelected(e.RowHandle) || gridView.FocusedRowHandle == e.RowHandle) { Rectangle bounds = e.Bounds; // rowInfo.Bounds; bounds.X -= 1; bounds.Width += 2; if (null == m_focus_pen) { m_focus_pen = new Pen(Brushes.OrangeRed, 2); } e.Graphics.DrawLine(m_focus_pen, new Point(bounds.X, bounds.Y), new Point(bounds.X + bounds.Width, bounds.Y)); e.Graphics.DrawLine(m_focus_pen, new Point(bounds.X, bounds.Y + bounds.Height), new Point(bounds.X + bounds.Width, bounds.Y + bounds.Height)); } switch (e.Column.FieldName) { case "display_index": { e.DisplayText = (gridControl.FocusedView.RowCount - e.RowHandle).ToString(); } break; case "state_cd": { //Debug.WriteLine("e.Column.FieldName : " + e.Column.FieldName); //Debug.WriteLine("ObjOrder.getStateString(state_cd) : " + ObjOrder.getStateString(state_cd)); int state_cd = (int)e.CellValue; string text = ObjOrder.getStateString(state_cd); Bitmap img = ObjOrder.getStateImage(state_cd); if (img != null) { Point pos = new Point(); pos.X = e.Bounds.Location.X + 2; pos.Y = e.Bounds.Location.Y + ((e.Bounds.Height - img.Height) / 2); e.Graphics.DrawImage(img, pos.X, pos.Y, img.Width, img.Height); int margin_x = img.Width + 4; Rectangle rect = new Rectangle(e.Bounds.X + margin_x, e.Bounds.Y, e.Bounds.Width - margin_x, e.Bounds.Height); e.Appearance.DrawString(e.Cache, text, rect); e.Handled = true; } } break; case "call_num": { e.DisplayText = ((null == e.CellValue || 8 > e.CellValue.ToString().Length) ? e.CellValue.ToString() : KnUtil.formatTelNumber(e.CellValue.ToString())); } break; } } catch (Exception ex) { String erro_msg = (null == ex.Message ? "error - OrderList_gridView_CustomDrawCell" : ex.Message); TsLog.writeLog(erro_msg); //Debug.Assert(false, erro_msg); } }
private void gridView_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e) { // row handle & sender check if (gridView.FocusedRowHandle < 0 && sender.GetType() != typeof(GridView)) { return; } try { switch (e.Column.FieldName) { case "order_type": { int order_type = ((null == e.Value || 0 == e.Value.ToString().Length) ? 0 : (int)e.Value); e.DisplayText = ObjOrder.getOrderTypeString(order_type); } break; case "call_datetime": { DateTime datetime = ((null == e.Value || 8 > e.Value.ToString().Length) ? DateTime.MinValue : (DateTime)e.Value); e.DisplayText = (DateTime.MinValue == datetime ? "" : datetime.ToString("MM-dd HH:mm")); } break; case "date_1": { DateTime datetime = ((null == e.Value || 8 > e.Value.ToString().Length) ? DateTime.MinValue : (DateTime)e.Value); e.DisplayText = (DateTime.MinValue == datetime ? "" : datetime.ToString("HH:mm")); } break; case "date_2": { DateTime datetime = ((null == e.Value || 8 > e.Value.ToString().Length) ? DateTime.MinValue : (DateTime)e.Value); e.DisplayText = (DateTime.MinValue == datetime ? "" : datetime.ToString("HH:mm")); } break; case "date_3": { DateTime datetime = ((null == e.Value || 8 > e.Value.ToString().Length) ? DateTime.MinValue : (DateTime)e.Value); e.DisplayText = (DateTime.MinValue == datetime ? "" : datetime.ToString("HH:mm")); } break; case "date_4": { DateTime datetime = ((null == e.Value || 8 > e.Value.ToString().Length) ? DateTime.MinValue : (DateTime)e.Value); e.DisplayText = (DateTime.MinValue == datetime ? "" : datetime.ToString("HH:mm")); } break; case "date_5": { DateTime datetime = ((null == e.Value || 8 > e.Value.ToString().Length) ? DateTime.MinValue : (DateTime)e.Value); e.DisplayText = (DateTime.MinValue == datetime ? "" : datetime.ToString("HH:mm")); } break; case "date_6": { DateTime datetime = ((null == e.Value || 8 > e.Value.ToString().Length) ? DateTime.MinValue : (DateTime)e.Value); e.DisplayText = (DateTime.MinValue == datetime ? "" : datetime.ToString("HH:mm")); } break; case "date_7": { DateTime datetime = ((null == e.Value || 8 > e.Value.ToString().Length) ? DateTime.MinValue : (DateTime)e.Value); e.DisplayText = (DateTime.MinValue == datetime ? "" : datetime.ToString("HH:mm")); } break; case "customer_pay_type_cd": { int customer_pay_type_cd = ((null == e.Value || 0 == e.Value.ToString().Length) ? 0 : (int)e.Value); e.DisplayText = ObjOrder.getCustPayTypeString(customer_pay_type_cd); } break; case "shop_cost": { e.DisplayText = ((null == e.Value || 0 == e.Value.ToString().Length) ? "" : KnUtil.formatMoney((int)e.Value)); } break; case "customer_cost": { e.DisplayText = ((null == e.Value || 0 == e.Value.ToString().Length) ? "" : KnUtil.formatMoney((int)e.Value)); } break; } } catch (Exception ex) { String erro_msg = (null == ex.Message ? "error - OrderList_gridView_CustomColumnDisplayText" : ex.Message); TsLog.writeLog(erro_msg); Debug.Assert(false, erro_msg); } }
public void onChangeObj(ObjOrder _obj, bool _is_change_state = false) { Utility.Utility.LogWrite("onChangeObj인자2개짜리"); try { // save Kons.ShopCallpass.AppMain.AppCore.Instance.getAppDoc().setObjOrder(_obj); // check visible if (!isShowOrder(_obj)) { return; } // control DataTable view_table = getGridViewDataSource(); if (null != view_table) { // 기존 객체 얻기 DataRow[] sel_rows = null; try { sel_rows = view_table.Select(String.Format("order_num = '{0}'", _obj.m_order_num)); } catch (Exception err) { TsLog.writeLog(err.Message); } // 기존 없으면 생성 if (null == sel_rows || 0 == sel_rows.Length) { sel_rows = new DataRow[1]; if (null != sel_rows) { sel_rows[0] = view_table.NewRow(); } view_table.Rows.InsertAt(sel_rows[0], 0); } else { if (!_is_change_state) { // 상태변경을 해야하는 경우(배달요청후)가 아니면 기존 상태를 안바뀌게 하기위해 아래 채우기전에 이전값으로 넣음 // 중복으로 연계 눌렀을경우 상태가 변경되는것을 막기위해 기본적으로 이전 상태를 유지한다. _obj.m_state_cd = KnUtil.parseInt32(sel_rows[0]["state_cd"].ToString()); } } // 새로 받은 내용 채우기 if (null != sel_rows[0]) { ObjOrder.setTableData(ref sel_rows[0], ref _obj); // obj -> data row } // 다시 그리기 redrawListControl(); } } catch (Exception ex) { Kons.ShopCallpass.AppMain.AppCore.detectException(ex.Message); } }
private void gridView_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) { if (gridView.FocusedRowHandle < 0 && sender.GetType() != typeof(GridView)) { return; } try { switch (e.Column.FieldName) { case "display_index": { e.DisplayText = (gridControl.FocusedView.RowCount - e.RowHandle).ToString(); } break; case "store_tel": { e.DisplayText = ((null == e.CellValue || 8 > e.CellValue.ToString().Length) ? e.CellValue.ToString() : KnUtil.formatTelNumber(e.CellValue.ToString())); } break; } } catch (Exception) { } }