Esempio n. 1
0
        /// <summary>
        /// 获取选中的秤体编码集合
        /// </summary>
        /// <returns></returns>
        private List <string> GetSelectEqucode(out string eqNameStr)
        {
            List <string> rtList = new List <string>();

            eqNameStr = string.Empty;
            int succount = 0;

            for (int i = 0; i < Attentions.Count; i++)
            {
                SeatAttentionWeightModel attion = Attentions[i];
                if (attion.IsChecked)//选中
                {
                    try
                    {
                        rtList.Add(attion.equcode);
                        eqNameStr = eqNameStr + "," + attion.equname;
                        succount  = succount + 1;
                    }
                    catch //(Exception ex)
                    {
                    }
                }
            }
            if (!string.IsNullOrEmpty(eqNameStr))
            {
                eqNameStr = eqNameStr.Substring(1);
            }
            return(rtList);
        }
Esempio n. 2
0
        /// <summary>
        /// 确定按钮事件
        /// </summary>
        private void ConfirmButton_Click(object sender, RoutedEventArgs e)
        {
            if (this.DataGrid.SelectedItem == null)
            {
                MessageBox.Show("请选择一条衡器信息");
                return;
            }
            memoInfos = this.msgTxt.Text.Trim();
            if (string.IsNullOrEmpty(memoInfos))
            {
                MessageBox.Show("请录入补打内容");
                return;
            }
            this.SelectedMeasure = this.DataGrid.SelectedItem as SeatAttentionWeightModel;

            FormState = 1;
            this.Close();
        }
Esempio n. 3
0
        /// <summary>
        /// 远程补票
        /// </summary>
        private void SupplementMethod()
        {
            //SendPrintTicket();
            if (SelectedTabControlIndex == 0)
            {
                if (this.SelectedJingRecord == null)
                {
                    this.ShowMessage("提示", "请先选择一条净重记录信息!", true, false);
                    return;
                }
            }
            else if (SelectedTabControlIndex == 1)
            {
                if (this.SelectedMaoRecord == null)
                {
                    this.ShowMessage("提示", "请先选择一条毛重记录信息!", true, false);
                    return;
                }
            }
            else if (selectedTabControlIndex == 2)
            {
                if (this.SelectedPiRecord == null)
                {
                    this.ShowMessage("提示", "请先选择一条皮重记录信息!", true, false);
                    return;
                }
            }
            else
            {
                this.ShowMessage("提示", "请先选择一条净重、毛重或皮重记录信息!", true, false);
                return;
            }
            SelectMeasureView smv = new SelectMeasureView(this.CarMeasures.ToList());

            smv.ShowDialog();
            if (smv.FormState == 1)
            {
                selectedMeasure = smv.SelectedMeasure;
                SendPrintTicket(smv.memoInfos);
            }
        }
Esempio n. 4
0
 /// <summary>
 /// 发送
 /// </summary>
 /// <param name="sEquecode"></param>
 private void SendClearNotic(List <string> sEquecode)
 {
     for (int i = 0; i < Attentions.Count; i++)
     {
         SeatAttentionWeightModel attion = Attentions[i];
         if (attion.IsChecked)//选中
         {
             try
             {
                 int unm  = CommonMethod.CommonMethod.GetRandom();
                 var para = new
                 {
                     clientid = attion.equcode,
                     cmd      = ParamCmd.UserNotice,
                     msg      = "ClearNoticeInfos",
                     msgid    = unm
                 };
                 SocketCls.Emit(SeatSendCmdEnum.cmd2client, JsonConvert.SerializeObject(para));
                 #region 写日志
                 LogModel log = new LogModel()
                 {
                     CreateTime   = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                     Direction    = LogConstParam.Directions_Out,
                     FunctionName = "坐席_发送通知窗体_发送清空通知",
                     Level        = LogConstParam.LogLevel_Info,
                     Msg          = attion.seatname + "坐席往秤体发送清空通知",
                     Origin       = "汽车衡_" + LoginUser.Role.Name,
                     Data         = para,
                     IsDataValid  = LogConstParam.DataValid_Ok,
                     ParamList    = new List <DataParam>()
                     {
                         new DataParam()
                         {
                             ParamName = "cmd", ParamValue = SeatSendCmdEnum.cmd2client
                         }
                     },
                     OperateUserName = LoginUser.Name
                 };
                 Talent.ClinetLog.SysLog.Log(JsonConvert.SerializeObject(log));
                 #endregion
             }
             catch (Exception ex)
             {
                 #region 写日志
                 LogModel log = new LogModel()
                 {
                     CreateTime   = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                     Direction    = LogConstParam.Directions_Out,
                     FunctionName = "坐席_发送通知窗体_发送清空通知",
                     Level        = LogConstParam.LogLevel_Info,
                     Msg          = attion.seatname + "坐席往秤体发送清空通知:" + ex.Message,
                     Origin       = LoginUser.Role.Name,
                     Data         = "",
                     IsDataValid  = LogConstParam.DataValid_Ok,
                     ParamList    = new List <DataParam>()
                     {
                         new DataParam()
                         {
                             ParamName = "cmd", ParamValue = SeatSendCmdEnum.cmd2client
                         }
                     },
                     OperateUserName = LoginUser.Name
                 };
                 Talent.ClinetLog.SysLog.Log(JsonConvert.SerializeObject(log));
                 #endregion
             }
         }
     }
 }