Exemplo n.º 1
0
        private void OnLoginWorkerInfo()
        {
            try
            {
                string nodeName = this.cbxCheckNodes.Text;
                string workerID = this.cbxWorkerIDS.Text;
                if (string.IsNullOrWhiteSpace(nodeName))
                {
                    MessageBox.Show("工位名称为空,请重新选择");
                    return;
                }
                if (string.IsNullOrWhiteSpace(workerID))
                {
                    MessageBox.Show("登录的员工号为空,请重新选择");
                    return;
                }
                FTDataAccess.BLL.PLNodesBll plNodesBll = new FTDataAccess.BLL.PLNodesBll();
                string strWhere = string.Format(" nodeName='{0}'", nodeName);

                List <FTDataAccess.Model.PLNodesModel> nodeList = plNodesBll.GetModelList(strWhere);
                if (nodeList == null || nodeList.Count() < 1)
                {
                    MessageBox.Show("没有工位信息:" + nodeName);
                    return;
                }
                FTDataAccess.Model.PLNodesModel node = nodeList[0];
                node.workerID      = workerID;
                node.lastLoginTime = System.DateTime.Now;
                if (plNodesBll.Update(node))
                {
                    logRecorder.AddDebugLog(this.Text, string.Format("登录员工信息成功,工位:{0},员工号:{1}", nodeName, workerID));
                }
                else
                {
                    logRecorder.AddDebugLog(this.Text, string.Format("登录员工信息失败,工位:{0},员工号:{1}", nodeName, workerID));
                    MessageBox.Show(string.Format("登录员工信息失败,工位:{0},员工号:{1}", nodeName, workerID));
                }
            }
            catch (Exception ex)
            {
                PoupAskmes(ex.Message);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(FTDataAccess.Model.PLNodesModel model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(FTDataAccess.Model.PLNodesModel model)
 {
     return(dal.Add(model));
 }