示例#1
0
 public OperateObject(
     OperateType operateType, Color color, object data)
 {
     _operateType = operateType;
     _color = color;
     _data = data;
 }
        public void DeviceGatherStart(OperateType type)
        {
            if (!_connConnected)
            {
                return;
            }

            PresetInfo.CurrentOperateType = type;
            switch (type)
            {
            case OperateType.Handshake:
                if (CheckTable())
                {
                    _commucationFacade.SendDataFrame(new FrameData(FrameType.HandshakeSwitchDevice));
                }
                else
                {
                    _view.ControlMessageShow("数据库初始化检查出错");
                }
                break;

            case OperateType.Gather:

                if (CheckTable())
                {
                    StartWork();
                }
                else
                {
                    _view.ControlMessageShow("数据库初始化检查出错");
                }
                break;

            case OperateType.Detect:
                _poleDetectPresenter.Init();
                _sqlPresenter.ElectrodDetectInit();
                CheckTable();
                StartWork();
                break;

            case OperateType.HvRelayOpen:
                _commucationFacade.SendDataFrame(new FrameData(FrameType.HvRelayOpen));
                break;

            case OperateType.DeviceReset:
                _commucationFacade.SendDataFrame(new FrameData(FrameType.DeviceReset));

                break;

//                case OperateType.Debug:
//                    _commucationFacade.SendDataFrame(_currentFrameData);
//                    break;
            default:
                _view.CommunicateMessageShow("设备运行时启动了无法识别的帧");
                break;
            }
        }
示例#3
0
 public DataChangeEventArgs(IDbConnection connection, OperateType Type, string tableName, string Sql, IDataParameter[] parameters, BoolResult <int> result)
 {
     this.Connection = connection;
     this.TableName  = tableName;
     this.Type       = Type;
     this.Sql        = Sql;
     this.Parameters = parameters;
     this.Result     = result;
 }
示例#4
0
 public FrmBasicData(string strCaption, OperateType operateType, DataTable dt)
 {
     InitializeComponent( );
     this.lblCaption.ForeColor = Color.DarkSlateBlue;
     this.lblCaption.Text      = strCaption;
     InitDataGridView( );
     DataBandingDgv(dt);
     this.lblRemark.Text = "记录总数:" + dt.Rows.Count + "条";
 }
    void OnGUI()
    {
        EditorGUILayout.Space();
        EditorGUI.BeginDisabledGroup(isLocking);

        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Source Root Path", GUILayout.Width(116)))
        {
            sourceRootPath = EditorUtility.OpenFolderPanel("Select Path", Application.dataPath, "");
            needRefresh    = true;
        }
        sourceRootPath = EditorGUILayout.TextField(sourceRootPath);
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("TargetType :", GUILayout.Width(80));
        targetType = (TargetType)EditorGUILayout.EnumPopup(targetType, GUILayout.Width(60));

        EditorGUILayout.LabelField("OperateType :", GUILayout.Width(90));
        operateType = (OperateType)EditorGUILayout.EnumPopup(operateType, GUILayout.Width(70));

        EditorGUILayout.LabelField("KeyWord :", GUILayout.Width(64));
        keyWord = EditorGUILayout.TextField(keyWord, GUILayout.Width(150));

        EditorGUI.BeginDisabledGroup(targetType != TargetType.File);
        EditorGUILayout.LabelField("Extension :", GUILayout.Width(70));
        extension = EditorGUILayout.TextField(extension, GUILayout.Width(150));
        EditorGUI.EndDisabledGroup();
        EditorGUILayout.EndHorizontal();

        EditorGUI.EndDisabledGroup();

        if (isLocking)
        {
            if (GUILayout.Button("Return To Main Page"))
            {
                isLocking = false;
            }
            DrawToDoList();
        }
        else
        {
            if (GUILayout.Button("Search And Show List"))
            {
                isLocking      = true;
                _scrollViewPos = Vector2.zero;
                CreateToDoList();
            }
        }


        if (needRefresh)
        {
            needRefresh = false;
            OnGUI();
        }
    }
示例#6
0
 // 编辑绘制图层
 private void EditVertexMenuItem_Click(object sender, RoutedEventArgs e)
 {
     if (curSelGraphic != null)//检查当前是否有选择图形
     {
         operation = OperateType.EditVertex;
         if (curSelGraphic.Geometry.GeometryType == GeometryType.Point) //所选图形为点
         {
             selVertexLayer.Graphics.Clear();                           //清空顶点图层
             MapPoint pt = (MapPoint)curSelGraphic.Geometry;
             Graphic  pg = new Graphic(pt, vertexSymbol);               //创建新的点图形
             selVertexLayer.Graphics.Add(pg);
         }
         else if (curSelGraphic.Geometry.GeometryType == GeometryType.Polyline)//所选图形为线
         {
             if (pointCollection != null)
             {
                 pointCollection.Clear();//清空点集
             }
             else
             {
                 pointCollection = new Esri.ArcGISRuntime.Geometry.PointCollection(myMapView.Map.SpatialReference);
             }
             Esri.ArcGISRuntime.Geometry.Polyline ln = (Esri.ArcGISRuntime.Geometry.Polyline)curSelGraphic.Geometry;
             pointCollection.AddPoints(ln.Parts[0].Points);  //将线的所有顶点加入点集
             selVertexLayer.Graphics.Clear();
             for (int i = 0; i < pointCollection.Count; i++) //将所有点以顶点图形样式显示
             {
                 MapPoint pt = pointCollection[i];
                 Graphic  pg = new Graphic(pt, vertexSymbol);
                 selVertexLayer.Graphics.Add(pg);
             }
         }
         else if (curSelGraphic.Geometry.GeometryType == GeometryType.Polygon)//所选图形为多边形
         {
             if (pointCollection != null)
             {
                 pointCollection.Clear();
             }
             else
             {
                 pointCollection = new Esri.ArcGISRuntime.Geometry.PointCollection(myMapView.Map.SpatialReference);
             }
             Esri.ArcGISRuntime.Geometry.Polygon pg = (Esri.ArcGISRuntime.Geometry.Polygon)curSelGraphic.Geometry;
             pointCollection.AddPoints(pg.Parts[0].Points);
             selVertexLayer.Graphics.Clear();
             for (int i = 0; i < pointCollection.Count; i++)
             {
                 MapPoint pt = pointCollection[i];
                 Graphic  gg = new Graphic(pt, vertexSymbol);
                 selVertexLayer.Graphics.Add(gg);
             }
         }
         EditVertexMenuItem.IsEnabled   = false;
         UneditVertexMenuItem.IsEnabled = true;
     }
 }
示例#7
0
    /// <summary>
    /// 开始界面
    /// </summary>
    private void WelcomePage()
    {
        InitGUIStyle();
        GUILayout.Space(position.height * 0.2f);
        GUILayout.Label("欢迎使用中国商飞3D虚拟培训课件开发平台", titleLabelStyle);
        GUILayout.Space(20);
        GUILayout.Label("请选择新建课件设计类型", subtitleLabelStyle);
        GUILayout.Space(100);

        //操作方式设定未来可能被移除
        opType =
            (OperateType)
            GUITools.EnumPopup(new GUIContent("操作方式"), opType, position.width * 0.33f, position.width * 0.33f,
                               GUILayout.Height(20));
        GUILayout.Space(10);

        sjType =
            (SubjectType)
            GUITools.EnumPopup(new GUIContent("课件类型"), sjType, position.width * 0.33f, position.width * 0.33f,
                               GUILayout.Height(20));
        GUILayout.Space(100);

        if (GUITools.Button("新建课件", position.width * 0.4f, position.width * 0.4f, GUILayout.Height(20)))
        {
            GameObject go = GameObject.FindGameObjectWithTag("GameManager");
            if (go)
            {
                if (EditorUtility.DisplayDialog("提示", "存在已编辑的场景,确定要新建课件吗?", "确定", "取消"))
                {
                    //新建
                    EditorApplication.delayCall += NewScene;
                }
            }
            else
            {
                if (EditorUtility.DisplayDialog("提示", "确定要新建课件吗?", "确定", "取消"))
                {
                    //新建
                    EditorApplication.delayCall += NewScene;
                }
            }
        }

        GUILayout.Space(20);

        if (GUITools.Button("打开已编辑场景", position.width * 0.4f, position.width * 0.4f, GUILayout.Height(20)))
        {
            string openPath = EditorUtility.OpenFilePanel("打开场景", "", "unity");
            if (openPath != "")
            {
                EditorSceneManager.OpenScene(openPath);
                //载入信息,跳转界面
                CheckScenePath();
            }
        }
    }
示例#8
0
 private bool CheckInputCacheChange()
 {
     if (Input.GetKey("w")) InputCache = OperateType.Up;
     else if (Input.GetKey("s")) InputCache = OperateType.Down;
     else if (Input.GetKey("a")) InputCache = OperateType.Left;
     else if (Input.GetKey("d")) InputCache = OperateType.Right;
     else if (Input.GetKeyUp("w") || Input.GetKeyUp("s") || Input.GetKeyUp("a") || Input.GetKeyUp("d")) InputCache = OperateType.Default;
     else return false;
     return true;
 }
示例#9
0
        /// <summary>
        /// 根据手机号获取门店实体
        /// </summary>
        /// <param name="mobile"></param>
        /// <returns></returns>
        public ShopEntity GetShopByMobile(string mobile, OperateType operateType)
        {
            var shop = service.GetEntityByMobile(mobile);

            if (shop != null)
            {
                CheckShopStatus(shop, operateType);
            }
            return(shop);
        }
示例#10
0
 private void UneditVertexMenuItem_Click(object sender, RoutedEventArgs e)
 {
     operation = OperateType.None;
     selVertexLayer.Graphics.Clear();//清空顶点图层
     UneditVertexMenuItem.IsEnabled = false;
     if (curSelGraphic != null)
     {
         EditVertexMenuItem.IsEnabled = true;
     }
 }
示例#11
0
        /// <summary>
        /// Aggregate function query
        /// </summary>
        /// <typeparam name="TValue">Value type</typeparam>
        /// <param name="query">Query object</param>
        /// <returns>Return the value</returns>
        async Task <TValue> AggregateFunctionAsync <TValue>(OperateType funcType, IQuery query)
        {
            ICommand cmd = RdbCommand.CreateNewCommand <TEntity>(funcType);

            SetCommand(cmd, null);
            cmd.Query = query;
            TValue data = await WorkManager.AggregateValueAsync <TValue>(cmd).ConfigureAwait(false);

            return(data);
        }
示例#12
0
 void RegisterEnhanceHandle(OperateType ot)
 {
     if (ot == OperateType.ENCHANCE)
     {
         if (gameObject.active)
         {
             CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_TOGGLE_EQUIP_ENHANCE);
         }
     }
 }
示例#13
0
        /// <summary>
        /// aggregate function query
        /// </summary>
        /// <typeparam name="DT">data type</typeparam>
        /// <param name="query">query object</param>
        /// <returns>data</returns>
        async Task <DT> AggregateFunctionAsync <DT>(OperateType funcType, IQuery query)
        {
            ICommand cmd = RdbCommand.CreateNewCommand <T>(funcType);

            SetCommand(cmd, null);
            cmd.Query = query;
            DT obj = await WorkFactory.QuerySingleAsync <DT>(cmd).ConfigureAwait(false);

            return(obj);
        }
        public Stack <OperateData> GetOperateDatas(OperateType operateType)
        {
            if (this.AllOperates.TryGetValue(operateType, out var operateStack))
            {
                return(operateStack);
            }

            Log.Error($"未找到类型为{operateType}的栈数据");
            return(null);
        }
示例#15
0
文件: FrmUnit.cs 项目: windygu/SGWMS
 public void DoMEdit()
 {
     this.optMain = OperateType.optEdit;
     ((DataRowView)this.bdsMain.Current).BeginEdit();
     this.CtrlOptButtons(this.tlbMain, this.pnlEdit, this.optMain, base.DBDataSet.Tables[this.strTbNameMain]);
     this.txt_cCName.Focus();
     this.DisplayState(this.stbState, this.optMain);
     this.CtrlControlReadOnly(this.pnlEdit, true);
     this.txt_cUnitId.ReadOnly = true;
 }
示例#16
0
        /// <summary>
        /// 添加一个操作命令.
        /// </summary>
        /// <param name="operateType"></param>
        /// <param name="color"></param>
        /// <param name="data"></param>
        public void AddOperate(OperateType operateType, Color color, object data)
        {
            OperateObject obj = new OperateObject(operateType, color, data);

            if (OperateList.Count > MaxOperateCount)
            {
                OperateList.RemoveAt(0);
            }
            OperateList.Add(obj);
        }
示例#17
0
        public void DoMDelete()
        {
            int iX = -1;

            iX = (int)optMain;
            DataRowView drv = (DataRowView)bdsMain.Current;

            if (drv == null)
            {
                MessageBox.Show("对不起,无数据可删除!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            //if (drv.IsNew || drv.IsEdit)
            if ((0 < iX) && (iX < 3))
            {
                MessageBox.Show("对不起,当前正处于编辑/新建状态,请先保存或取消操作!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (MessageBox.Show("系统将永久删除此数据,不能恢复,您确定要删除此数据吗?", "WMS", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
            {
                return;
            }
            DBCommInfo.DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo();                                                       //执行命令的对象
            cmdInfo.SqlText       = "delete " + strTbNameMain + " where " + strKeyFld + "='" + drv[strKeyFld].ToString() + "'"; //SQL语句  或 存储过程名 若有参数,另外在参数集里增加
            cmdInfo.SqlType       = SqlCommandType.sctSql;                                                                      //SQL命令类型  SqlCommandType.sctSql  SQL 语句 SqlCommandType.sctProcedure 表存储过程
            cmdInfo.PageIndex     = 0;                                                                                          //需要分页时的页号
            cmdInfo.PageSize      = 0;                                                                                          //需要分页时的每页记录条数
            cmdInfo.FromSysType   = "dotnet";                                                                                   //采用处理结果数据的方式:php 表按照<tr><td></td></tr> xml 否则 直接采用ado 的记录集方式
            cmdInfo.DataTableName = strTbNameMain;                                                                              //指定结果数据记录集表名 默认为 "data"
            SunEast.SeDBClient sdcX = new SeDBClient();                                                                         //获取服务器数据的类型对象
            //sdcX.DBSTServer = DBSocketServerType.dbsstNormal;  //自动根据配置文件读
            string  sErr = "";
            DataSet dsX  = null;

            dsX = sdcX.GetDataSet(cmdInfo, out sErr);                //通过获取服务器数据对象的GetDataSet方法获取数据
            bool bX = dsX != null;

            //DataMainToObjInfo(drv);
            //bX = BI.BasicPubInfo.BasicPubInfoBI.DoCompanyInfo(AppInformation.dbtApp, AppInformation.AppConn, UserInformation, drv, true);
            if (bX)
            {
                optMain = OperateType.optDelete;
                OpenMainDataSet(sbConndition.ToString());
                //控制录入问题
                CtrlOptButtons(this.tlbMain, pnlEdit, optMain, DBDataSet.Tables[strTbNameMain]);
                optMain = OperateType.optNone;
                DisplayState(stbState, optMain);
                CtrlControlReadOnly(pnlEdit, false);
            }
            else
            {
                MessageBox.Show("对不起,删除操作失败!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
        }
示例#18
0
        public void DoMDelete()
        {
            if (UserInformation.UType == UserType.utNormal)
            {
                MessageBox.Show("对不起,您无权限删除用户信息!");
                return;
            }
            int iX = -1;

            iX = (int)optMain;
            DataRowView drv = (DataRowView)bdsMain.Current;

            if (drv == null)
            {
                MessageBox.Show("对不起,无数据可删除!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            //if (drv.IsNew || drv.IsEdit)
            if ((0 < iX) && (iX < 3))
            {
                MessageBox.Show("对不起,当前正处于编辑/新建状态,请先保存或取消操作!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (MessageBox.Show("系统将永久删除此数据,不能恢复,您确定要删除此数据吗?", "WMS", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
            {
                return;
            }
            bool    bX   = false;
            string  sErr = "";
            string  sSql = "delete " + strTbNameMain + " where " + strKeyFld + "='" + drv[strKeyFld].ToString() + "'";
            DataSet dsX  = null;

            //执行语句
            dsX = SunEast.App.PubDBCommFuns.GetDataBySql(sSql, out sErr);
            bX  = dsX != null;
            bX  = dsX.Tables[0].Rows[0][0].ToString() == "0";
            if (bX)
            {
                MessageBox.Show("删除成功!");
                optMain = OperateType.optDelete;
                OpenMainDataSet(sbConndition.ToString());
                //控制录入问题
                CtrlOptButtons(this.tlbMain, pnlEdit, optMain, DBDataSet.Tables[strTbNameMain]);
                optMain = OperateType.optNone;
                DisplayState(stbState, optMain);
                CtrlControlReadOnly(pnlEdit, false);
                btn_SetPwd.Visible = false;
                btn_SetPwd.Enabled = false;
            }
            else
            {
                MessageBox.Show("对不起,删除操作失败!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
        }
示例#19
0
        /// <summary>
        /// 新增调拨单
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public ReturnInfo AddAssTransferOrder(TOInputDto entity, OperateType type)
        {
            ReturnInfo RInfo = new ReturnInfo();

            if (String.IsNullOrEmpty(entity.MANAGER))
            {
                throw new Exception("调入管理员不能为空");
            }
            if (String.IsNullOrEmpty(entity.HANDLEMAN))
            {
                throw new Exception("处理人不能为空");
            }
            if (String.IsNullOrEmpty(entity.TRANSFERDATE.ToString()))
            {
                throw new Exception("业务日期不能为空");
            }
            if (String.IsNullOrEmpty(entity.DESSLID))
            {
                throw new Exception("调入区域不能为空");
            }
            String MaxID = _AssTransferOrderRepository.GetMaxID();        //获取当前最大报修单编号
            String NowID = Helper.GeneratePRID("T", MaxID);               //生成最新的报修单编号

            entity.TOID = NowID;
            try
            {
                AssTransferOrder OrderData = new AssTransferOrder();
                OrderData.TOID         = NowID;
                OrderData.MANAGER      = entity.MANAGER;
                OrderData.HANDLEMAN    = entity.HANDLEMAN;
                OrderData.TRANSFERDATE = entity.TRANSFERDATE;
                OrderData.WAREID       = entity.WAREID;
                OrderData.STID         = entity.STID;
                OrderData.DESSLID      = entity.DESSLID;
                OrderData.NOTE         = entity.NOTE;
                OrderData.TYPE         = (int)type;
                OrderData.STATUS       = 0;
                OrderData.CREATEDATE   = entity.CREATEDATE;
                OrderData.CREATEUSER   = entity.CREATEUSER;
                _unitOfWork.RegisterNew(OrderData);
                AddAssTransferOrderRow(entity, type);

                bool result = _unitOfWork.Commit();
                RInfo.IsSuccess = result;
                RInfo.ErrorInfo = "创建成功!";
                return(RInfo);
            }
            catch (Exception ex)
            {
                _unitOfWork.Rollback();
                RInfo.IsSuccess = false;
                RInfo.ErrorInfo = ex.Message;
                return(RInfo);
            }
        }
        /// <summary>
        /// aggregate function query
        /// </summary>
        /// <typeparam name="DT">data type</typeparam>
        /// <param name="query">query object</param>
        /// <returns>data</returns>
        DT AggregateFunction <DT>(OperateType funcType, IQuery query)
        {
            ICommand cmd = RdbCommand.CreateNewCommand(funcType);

            SetCommand(cmd, null);
            cmd.Query  = query;
            cmd.Fields = GetQueryObjectFields(query);
            DT obj = UnitOfWork.UnitOfWork.QuerySingle <DT>(cmd);

            return(obj);
        }
示例#21
0
        /// <summary>
        /// aggregate function query
        /// </summary>
        /// <typeparam name="DT">data type</typeparam>
        /// <param name="query">query object</param>
        /// <returns>data</returns>
        async Task <DT> AggregateFunctionAsync <DT>(OperateType funcType, IQuery query)
        {
            ICommand cmd = RdbCommand.CreateNewCommand(funcType);

            SetCommand(cmd, null);
            cmd.Query  = query;
            cmd.Fields = GetQueryObjectFields(query);
            DT obj = await UnitOfWork.UnitOfWork.QuerySingleAsync <DT>(cmd).ConfigureAwait(false);

            return(obj);
        }
示例#22
0
        /// <summary>
        /// 写入日志
        /// </summary>
        /// <param name="operateType"></param>
        /// <param name="tableName">表名</param>
        /// <param name="current"></param>
        /// <returns></returns>
        private static async Task WriteDataLog(OperateType operateType, string tableName, object current = null)
        {
            string operateAfterData = string.Empty;

            if (operateType == OperateType.编辑)
            {
                //operateAfterData = JsonConvert.SerializeObject(Task.Run(async () => await GetByIdFromDataBase(current)).Result);
            }
            _dataLoginHandler = new DataLogHandler((byte)operateType, tableName, JsonConvert.SerializeObject(current), operateAfterData);
            _dataLoginHandler.WriteLog();
        }
示例#23
0
        public static void AddOperateLog <T>(T t, OperateType operateType)
        {
            StackTrace trace     = new StackTrace();
            StackFrame frame     = trace.GetFrame(1);
            MethodBase method    = frame.GetMethod();
            String     className = method.ReflectedType.Name;

            string remark = ObjectHelper.getProperties <T>(t);

            AddOperateLog(className, method.Name, operateType, remark);
        }
示例#24
0
        public bool OpenMainDataSet(string sCon)
        {
            bool   bIsOK = false;
            string strX  = "";
            string sSql  = "";
            string sErr  = "";

            bDSIsOpenForMain            = false;
            grdList.AutoGenerateColumns = false;
            grdList.SelectionMode       = DataGridViewSelectionMode.FullRowSelect;
            DBDataSet.Clear();
            sSql      = "select * from " + strTbNameMain + sCon;        //SQL语句  或 存储过程名 若有参数,另外在参数集里增加
            DBDataSet = SunEast.App.PubDBCommFuns.GetDataBySql(sSql, strTbNameMain, 0, 0, out sErr);
            bIsOK     = DBDataSet != null;
            if (bIsOK)
            {
                bIsOK = DBDataSet.Tables[0].Rows[0][0].ToString().Trim() == "0";
            }
            //if (bIsOK)
            //{
            //    DBDataSet.Clear();
            //    tbX  = new DataTable(strTbNameMain);
            //    tbX = dsX.Tables["data"].Copy();
            //    DBDataSet.Tables.Add(tbX);
            //}
            if (!bIsOK)
            {
                MessageBox.Show(sErr);
            }
            else
            {
                try
                {
                    bDSIsOpenForMain        = true;
                    this.bdsMain.DataSource = DBDataSet.Tables[strTbNameMain];
                    BindDataSetToCtrls();
                    ClearUIValues(pnlEdit);
                    if (bdsMain.Count > 0)
                    {
                        DataRowViewToUI((DataRowView)bdsMain.Current, pnlEdit);
                    }
                    bIsOK              = true;
                    optMain            = OperateType.optNone;
                    btn_SetPwd.Visible = false;
                    btn_SetPwd.Enabled = false;
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    bIsOK = false;
                }
            }
            return(bIsOK);
        }
示例#25
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     _TYPE = OperateType.Delete;
     if (dataGridView1.CurrentRow != null)
     {
     }
     else
     {
         MessageBox.Show("没有选择要删除的记录!");
     }
 }
示例#26
0
        public bool DoNew()
        {
            this.OptMain = OperateType.optNew;
            DataRowView view = (DataRowView)this.bindingSource_Main.AddNew();

            this.CtrlOptButtons(this.tlbMain, this.panel_Edit, this.OptMain, base.DBDataSet.Tables[this.strTbNameMain]);
            this.DisplayState(this.stbState, this.OptMain);
            this.CtrlControlReadOnly(this.panel_Edit, true);
            this.textBox_cBoxId.ReadOnly = true;
            return(false);
        }
示例#27
0
 private void btnModify_Click(object sender, EventArgs e)
 {
     _TYPE = OperateType.Edit;
     if (dataGridView1.CurrentRow != null)
     {
     }
     else
     {
         MessageBox.Show("没有选择要修改的记录!");
     }
 }
示例#28
0
 private void comboBoxOperate_SelectedIndexChanged(object sender, EventArgs e)
 {
     // 设置焦点到条件输入框
     this.textBoxPatientCondition.Focus();
     // 全选内容
     this.textBoxPatientCondition.SelectAll();
     // 设置查询操作方式
     this.enumOperate = (OperateType)this.comboBoxOperate.SelectedIndex;
     // 清空查询条件输入框
     this.textBoxPatientCondition.Text = "";
 }
示例#29
0
 private void MyMapView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (operation != OperateType.EditVertex) //当非处于顶点编辑状态时,鼠标双击表示结束 图形绘制
     {
         operation = OperateType.None;
         if (pointCollection != null)
         {
             pointCollection.Clear();
         }
     }
 }
示例#30
0
 public void init(List <T> list, String sheetName, OperateType type)
 {
     if (list == null)
     {
         list = new List <T>();
     }
     this.list      = list;
     this.sheetName = sheetName;
     this.type      = type;
     createExcelField();
     createWorkbook();
 }
示例#31
0
文件: FrmUnit.cs 项目: windygu/SGWMS
        public void DoMSave()
        {
            string str = "";

            this.txt_cUnitId.Focus();
            DataRowView current = (DataRowView)this.bdsMain.Current;

            if (current.IsEdit || current.IsNew)
            {
                this.UIToDataRowView(current, this.pnlEdit);
                if ((current[this.strKeyFld].ToString() == "") || (current[this.strKeyFld].ToString() == "-1"))
                {
                    current[this.strKeyFld] = PubDBCommFuns.GetNewId(this.strTbNameMain, this.strKeyFld, base.UserInformation.UnitId.Trim().Length + 4, base.UserInformation.UnitId.Trim());
                    str = DBSQLCommandInfo.GetSQLByDataRow(current, this.strTbNameMain, this.strKeyFld, true);
                }
                else
                {
                    str = DBSQLCommandInfo.GetSQLByDataRow(current, this.strTbNameMain, this.strKeyFld, false);
                }
                if (current.IsEdit)
                {
                    current.EndEdit();
                }
                DBSQLCommandInfo cmdInfo = new DBSQLCommandInfo {
                    SqlText     = str,
                    FldsData    = DBSQLCommandInfo.GetFieldsForDate(current),
                    SqlType     = SqlCommandType.sctSql,
                    PageIndex   = 0,
                    PageSize    = 0,
                    FromSysType = "dotnet"
                };
                SeDBClient client = new SeDBClient();
                string     sErr   = "";
                if (client.GetDataSet(cmdInfo, out sErr).Tables[0].Rows[0][0].ToString() == "0")
                {
                    this.optMain = OperateType.optSave;
                    MessageBox.Show("保存数据成功!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    this.OpenMainDataSet();
                    this.CtrlOptButtons(this.tlbMain, this.pnlEdit, this.optMain, base.DBDataSet.Tables[this.strTbNameMain]);
                    this.optMain = OperateType.optNone;
                    this.DisplayState(this.stbState, this.optMain);
                    this.CtrlControlReadOnly(this.pnlEdit, false);
                }
                else
                {
                    MessageBox.Show("保存数据失败!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
            }
            else
            {
                MessageBox.Show("对不起,当前没有处于编辑状态!", "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }
示例#32
0
        /// <summary>
        /// Publish aggregate function event
        /// </summary>
        /// <typeparam name="T">Entity type</typeparam>
        /// <param name="operateType">Operate type</param>
        /// <param name="value">Value</param>
        /// <param name="query">Query</param>
        /// <returns></returns>
        public static void PublishAggregateFunctionEvent <T>(OperateType operateType, dynamic value, IQuery query)
        {
            var funcEvent = new AggregateFunctionEvent()
            {
                EntityType  = typeof(T),
                OperateType = operateType,
                Query       = query,
                Value       = value
            };

            Publish(funcEvent);
        }
示例#33
0
 public void AddOperate(
     OperateType operateType,
     Color color,
     object data)
 {
     OperateObject obj = new OperateObject(
         operateType, color, data);
     if (OperateList.Count > MaxOperateCount)
     {
         OperateList.RemoveAt(0);
     }
     OperateList.Add(obj);
 }
示例#34
0
        /// <summary> 获取添加类别的上传数据 
        /// </summary>
        /// <param name="tableName">表名</param>
        /// <param name="preTableName">关联表</param>        
        /// <param name="dbName">帐套名</param>
        /// <param name="lastTime">最后一次上传时间</param>
        /// <param name="time">下一次开始上传时间</param>
        /// <returns></returns>
        public static DataTable GetAddData(string tableName, string realTableName, string preTableName, string dbName, string lastTime, string time, OperateType type)
        {
            if (preTableName.Length == 0)
            {
                preTableName = tableName;
            }
            string where = string.Empty;
            if (type == OperateType.AUD)
            {
                where = string.Format("(create_time = update_time or update_time is null) and {3}.enable_flag='{0}' and {3}.create_time>='{1}' and {3}.create_time<'{2}'",
                     DataSources.EnumStatus.Start.ToString("d"), lastTime, time, preTableName);
            }
            else if (type == OperateType.AU)
            {
                where = string.Format("(create_time = update_time or update_time is null) and {2}.create_time>='{0}' and {2}.create_time<'{1}'",
                    lastTime, time, preTableName);
            }
            else if (type == OperateType.A)
            {
                where = string.Format("{2}.create_time>='{0}' and {2}.create_time<'{1}'", lastTime, time, preTableName);
            }

            DataTable dt = null;
            try
            {
                if (where.Length > 0)
                {
                    dt = DBHelper.GetTable("获取新增上传表[" + tableName + "]数据", dbName, tableName, realTableName + ".*", where, "", "");
                }
            }
            catch (Exception ex)
            {
                Log.writeCloudLog(string.Format("获取[{0}]失败,Bug:{1}", tableName, ex.Message));
                dt = null;
            }

            if (dt != null)
            {
                dt.TableName = realTableName;
            }
            return dt;
        }
示例#35
0
 public static ResultBase SaveUser(this Weixin weixin, UserDetail user, OperateType operate = OperateType.Create)
 {
     string source = string.Empty;
       switch (operate)
       {
     case OperateType.Create:
       source = Resources.CreateUserUrl;
       break;
     case OperateType.Update:
       source = Resources.UpdateUserUrl;
       break;
     case OperateType.Delete:
       source = Resources.DeleteUserUrl;
       break;
       }
       string url = operate == OperateType.Delete ? string.Format(source, weixin.Token.access_token, user.userid) : string.Format(source, weixin.Token.access_token);
       if (operate == OperateType.Delete)
     return weixin.Get<ResultBase>(url);
       return weixin.Post<ResultBase>(url, user.ToString());
 }
示例#36
0
        /// <summary>
        /// 添加或修改文章
        /// </summary>
        /// <param name="blogID"></param>
        /// <param name="postID"></param>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <param name="sentPost"></param>
        /// <param name="publish"></param>
        /// <param name="operate"></param>
        /// <returns></returns>
        private int NewOrUpdatePost(string blogID, string postID, string userName, string password, MWAPost sentPost, bool publish, OperateType operate)
        {
            ValidateRequest(userName, password);

            PostInfo post = new PostInfo();

            if (operate == OperateType.Update)
            {
                post = PostManager.GetPost(StringHelper.StrToInt(postID, 0));

            }
            else
            {
                post.CommentCount = 0;
                post.ViewCount = 0;
                post.CreateDate = DateTime.Now;

                UserInfo user = UserManager.GetUser(userName);
                if (user != null)
                {
                    post.UserId = user.UserId;
                }
            }

            post.Title = StringHelper.HtmlEncode(sentPost.title);
            post.Content = sentPost.description;
            post.Status = publish == true ? 1 : 0;
            post.Slug = PageUtils.FilterSlug(sentPost.slug, "post", true);
            post.Summary = sentPost.excerpt;

            post.UrlFormat = (int)PostUrlFormat.Default;
            post.Template = string.Empty;
            post.Recommend = 0;
            post.TopStatus = 0;
            post.HideStatus = 0;
            post.UpdateDate = DateTime.Now;

            if (sentPost.commentPolicy != "")
            {
                if (sentPost.commentPolicy == "1")
                    post.CommentStatus = 1;
                else
                    post.CommentStatus = 0;
            }

            foreach (string item in sentPost.categories)
            {
                CategoryInfo cat;
                if (LookupCategoryGuidByName(item, out cat))
                {
                    post.CategoryId = cat.CategoryId;
                }
                else
                {
                    CategoryInfo newcat = new CategoryInfo();
                    newcat.Count = 0;
                    newcat.CreateDate = DateTime.Now;
                    newcat.Description = "由离线工具创建";
                    newcat.Displayorder = 1000;
                    newcat.Name = StringHelper.HtmlEncode(item);
                    newcat.Slug = PageUtils.FilterSlug(item, "cate", false);

                    newcat.CategoryId = CategoryManager.InsertCategory(newcat);
                    post.CategoryId = newcat.CategoryId;
                }
            }
            post.Tag = GetTagIdList(sentPost.tags);

            if (operate == OperateType.Update)
            {
                PostManager.UpdatePost(post);
            }
            else
            {
                post.PostId = PostManager.InsertPost(post);

                //    SendEmail(p);
            }

            return post.PostId;
        }
示例#37
0
文件: B_User.cs 项目: suizhikuo/KYCMS
 public void SetFriend(int Id, OperateType type)
 {
     this.iu.SetFriend(Id, type);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="rep"></param>
 /// <param name="op"></param>
 /// <param name="entity"></param>
 public OperateArgs(IRepository rep, OperateType op, IEntity entity)
 {
     this.Repository = rep;
     this.OperateType = op;
     this.Entity = entity;
 }
 CommandStatus ICommandHandler.Operate(AnalogOutputDouble64 command, ushort index, OperateType opType)
 {
     lock (mutex)
     {
         return GetOrElseAndLogAnalog(command.value, index, analogMap, () => proxy.Operate(command, index, opType));
     }
 }
        private bool IsInColumns(OperateType type, string columnName, bool inWhere)
        {
            if (columnName == "RowNumber")
                return false;

            switch (type)
            {
                case OperateType.Insert:
                    {
                        return m_insertColumns == null || m_insertColumns.ContainsKey(columnName);
                    }
                case OperateType.Update:
                    {
                        if (inWhere)
                            return true;
                        return m_updateColumns == null || m_updateColumns.ContainsKey(columnName);
                    }
                case OperateType.Delete:
                    {
                        return m_deleteColumns == null || m_deleteColumns.ContainsKey(columnName);
                    }
            }
            return false;
        }
示例#41
0
 private void Start()
 {
     InputCache = OperateType.Default;
 }
示例#42
0
        /// <summary>
        /// 添加或修改文章
        /// </summary>
        /// <param name="blogID"></param>
        /// <param name="postID"></param>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <param name="sentPost"></param>
        /// <param name="publish"></param>
        /// <param name="operate"></param>
        /// <returns></returns>
        private int NewOrUpdatePost(string blogID, string postID, string userName, string password, MWAPost sentPost, bool publish, OperateType operate)
        {
            ValidateRequest(userName, password);

            PostInfo post = new PostInfo();
            PostService _postService = new PostService();

            if (operate == OperateType.Update)
            {
                post = new PostService().GetPost(Jqpress.Framework.Utils.TypeConverter.StrToInt(postID, 0));

            }
            else
            {
                post.CommentCount = 0;
                post.ViewCount = 0;
                post.PostTime = DateTime.Now;

                UserInfo user = (new UserService()).GetUser(userName);
                if (user != null)
                {
                    post.UserId = user.UserId;
                }
            }

            post.Title = Jqpress.Framework.Web.HttpHelper.HtmlEncode(sentPost.title);
            post.PostContent = sentPost.description;
            post.Status = publish == true ? 1 : 0;
            post.PageName = Jqpress.Framework.Utils.StringHelper.FilterPageName(sentPost.pagename, "post", true);
            post.Summary = sentPost.excerpt;

            post.UrlFormat = (int)PostUrlFormat.Default;
            post.Template = string.Empty;
            post.Recommend = 0;
            post.TopStatus = 0;
            post.PostStatus = 0;
            post.UpdateTime = DateTime.Now;

            if (sentPost.commentPolicy != "")
            {
                if (sentPost.commentPolicy == "1")
                    post.CommentStatus = 1;
                else
                    post.CommentStatus = 0;
            }

            foreach (string item in sentPost.categories)
            {
                CategoryInfo cat;
                if (LookupCategoryGuidByName(item, out cat))
                {
                    post.CategoryId = cat.CategoryId;
                }
                else
                {
                    CategoryInfo newcat = new CategoryInfo();
                    newcat.PostCount = 0;
                    newcat.CreateTime = DateTime.Now;
                    newcat.Description = "由离线工具创建";
                    newcat.SortNum = 1000;
                    newcat.CateName = Jqpress.Framework.Web.HttpHelper.HtmlEncode(item);
                    newcat.PageName = Jqpress.Framework.Utils.StringHelper.FilterPageName(item, "cate", false);

                    newcat.CategoryId = new CategoryService().InsertCategory(newcat);
                    post.CategoryId = newcat.CategoryId;
                }
            }
            post.Tag = GetTagIdList(sentPost.tags);

            if (operate == OperateType.Update)
            {
                new PostService().UpdatePost(post);
            }
            else
            {
                post.PostId = new PostService().InsertPost(post);

                //    SendEmail(p);
            }

            return post.PostId;
        }
示例#43
0
 CommandStatus ICommandHandler.Operate(AnalogOutputDouble64 command, ushort index, OperateType opType)
 {
     return CommandStatus.NOT_SUPPORTED;
 }
示例#44
0
 public static DataTable GetDeleteDataFromHXC(string tableName, string dbName, string lastTime, string time, OperateType type = OperateType.AUD)
 {
     return GetDeleteDataFromHXC(tableName, tableName, tableName, dbName, lastTime, time, type);
 }
示例#45
0
 public static DataTable GetUpdateData(string tableName, string dbName, string lastTime, string time, OperateType type = OperateType.AUD)
 {
     return null;
     //return GetUpdateData(tableName, tableName, tableName, dbName, lastTime, time, type);
 }
示例#46
0
 CommandStatus ICommandHandler.Operate(ControlRelayOutputBlock command, ushort index, OperateType opType)
 {
     return OnControl(command, index, true);
 }
 CommandStatus ICommandHandler.Operate(ControlRelayOutputBlock command, ushort index, OperateType opType)
 {
     lock (mutex)
     {
         return GetOrElseAndLogBinary(command, index, binaryMap, () => proxy.Operate(command, index, opType));
     }
 }
示例#48
0
文件: User.cs 项目: suizhikuo/KYCMS
 public void SetFriend(int Id, OperateType type)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@Id", SqlDbType.Int, 4), new SqlParameter("@IsDisable", SqlDbType.Int, 4) };
     commandParameters[0].Value = Id;
     commandParameters[1].Value = (type == OperateType.Disable) ? 2 : 1;
     SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_User_SetFriend", commandParameters);
 }
示例#49
0
        /// <summary> 获取删除类别的上传数据 
        /// </summary>
        /// <param name="tableName">表名</param>  
        /// <param name="dbName">帐套名</param>
        /// <param name="lastTime">最后一次上传时间</param>
        /// <param name="time">下一次开始上传时间</param>
        /// <returns></returns>
        public static DataTable GetDeleteDataFromHXC(string tableName, string realTableName, string preTableName, string dbName, string lastTime, string time, OperateType type)
        {
            if (preTableName.Length == 0)
            {
                preTableName = tableName;
            }

            string where = string.Empty;
            if (type == OperateType.AUD)
            {
                where = string.Format("{3}.enable_flag='{0}' and {3}.update_time>={1} and {3}.update_time < {2} and {3}.data_source='{4}'",
                    DataSources.EnumStatus.Start.ToString("d"), lastTime, time, preTableName, DataSources.EnumDataSources.SELFBUILD.ToString("d"));
            }

            DataTable dt = null;
            try
            {
                if (where.Length > 0)
                {
                    dt = DBHelper.GetTable("获取删除上传表[" + tableName + "]数据", dbName, tableName, tableName + ".*", where, "", "");
                }
            }
            catch (Exception ex)
            {
                LogAssistant.LogServiceError.WriteLog(string.Format("{0}", tableName), ex.Message);
                dt = null;
            }

            if (dt != null)
            {
                dt.TableName = realTableName;
            }
            return dt;
        }