Exemplo n.º 1
0
        private void InitBindings(SFITrackNum track, CBXAgent agent)
        {
            mvvmContext1.ViewModelType = typeof(CheckPointLogViewModel);
            var fluentAPI = mvvmContext1.OfType <CheckPointLogViewModel>();

            fluentAPI.ViewModel.SFITrackNum = track;
            fluentAPI.ViewModel.CBXAgent    = agent;

            fluentAPI.SetBinding(lblMapId, lbl => lbl.Text, x => x.SFITrackNum.int_Mappingid, x => { return($"数据编号:{x}"); });
            fluentAPI.SetBinding(lblOrderNo, lbl => lbl.Text, x => x.SFITrackNum.vchar_SFInum, x => { return($"SFI单号:{x}"); });
            fluentAPI.SetBinding(lblAgentNo, lbl => lbl.Text, x => x.SFITrackNum.vchar_AGnum, x => { return($"供应商单号:{x}"); });
            fluentAPI.SetBinding(lblAgentName, lbl => lbl.Text, x => x.CBXAgent.Agname, x => { return($"供应商:{x}"); });
            fluentAPI.SetBinding(txtRecordStr, x => x.EditValue, x => x.RecordStr);

            fluentAPI.SetBinding(gridControl1, gv => gv.DataSource, x => x.TrackRecords);
            fluentAPI.SetBinding(gridControl2, gv => gv.DataSource, x => x.TrackRecordLogs);

            fluentAPI.WithEvent <ColumnView, FocusedRowObjectChangedEventArgs>(gridView1, "FocusedRowObjectChanged")
            .SetBinding(x => x.SelectedTrackRecord,
                        args => args.Row as TrackRecord,
                        (gView, entity) => gView.FocusedRowHandle = gView.FindRow(entity));

            fluentAPI.BindCommand(btnDelete, x => x.DeleteTrackRecord());
            fluentAPI.BindCommand(btnSubmit, x => x.AddTrackRecord());
            fluentAPI.BindCommand(btnRefresh, x => x.RefreshLogs(null), x => splashScreenManager1);
        }
Exemplo n.º 2
0
 public CheckPointLog(SFITrackNum track, CBXAgent agent)
 {
     InitializeComponent();
     if (!DesignMode)
     {
         splashScreenManager1.ShowWaitForm();
         InitBindings(track, agent);
         splashScreenManager1.CloseWaitForm();
     }
 }
Exemplo n.º 3
0
        private string WriteServerLog(SFITrackNum track, string result, string error)
        {
            DynamicParameters p = new DynamicParameters();

            p.Add("@type", "G", DbType.String);
            p.Add("@MappingID", track.int_Mappingid, DbType.Int32);
            p.Add("@result", result, DbType.String);
            if (!string.IsNullOrWhiteSpace(error))
            {
                p.Add("@error", error, DbType.String);
            }
            p.Add("@message", null, DbType.String, ParameterDirection.ReturnValue);
            return(SQLHelper.ExecuteStoredProcedure <string>(Constants.sp_Logupdate, p, "@message"));
        }
Exemplo n.º 4
0
        private string UpdateTrackRecord(SFITrackNum track, TrackRecord record)
        {
            DynamicParameters p = new DynamicParameters();

            p.Add("@MappingID", track.int_Mappingid, DbType.Int32);
            p.Add("@AGid", track.int_AGid, DbType.Int32);
            p.Add("@SFInumber", track.vchar_SFInum, DbType.String);
            p.Add("@AGnumber", track.vchar_AGnum, DbType.String);
            p.Add("@dttm", record.dttm_Record_Dttm, DbType.DateTime);
            p.Add("@Description", record.nvchar_Description, DbType.String);
            p.Add("@DescriptionLocal", record.nvchar_Description_Local, DbType.String);
            p.Add("@city", record.nvchar_City, DbType.String);
            p.Add("@code", $"{record.dttm_Record_Dttm.ToString("yyyyMMddhhmmss")}_{track.int_Mappingid}", DbType.String);
            p.Add("@message", null, DbType.String, ParameterDirection.ReturnValue);
            return(SQLHelper.ExecuteStoredProcedure <string>(Constants.sp_RecordUpdate, p, "@message"));
        }