/// <summary> /// 拍照取名 /// </summary> /// <param name="strfileName">保存路径</param> /// <param name="strPosition">门岗值</param> /// <param name="strDriveway">通道值</param> /// <param name="ilChannel">摄像头</param> /// <returns>拼接后的路径</returns> public static string GetPicFileName(int id, string strfileName, int ilChannel) { StringBuilder sb = new StringBuilder(); string sPicFileName = LinQBaseDao.getDate().ToString("yyMMddHHmmss") + ilChannel.ToString() + id; sb.Append(strfileName); sb.Append(sPicFileName); sb.Append(".jpg"); return(sb.ToString()); }
public MainFrom mf;//主窗体 /// <summary> /// 单击发送按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSMSSend_Click(object sender, EventArgs e) { //短信内容 if (string.IsNullOrEmpty(txtcontent.Text.Trim())) { MessageBox.Show("请输入短信内容"); return; } //质检状态改为暂停质检 LinQBaseDao.Query("update QCInfo set QCInfo_Dictionary_ID=(select Dictionary_ID from Dictionary where Dictionary_Name='暂停质检') where QCInfo_ID=" + QcinfoID); //添加异常信息 //insert into Unusual values(质检编号,异常类型编号,异常类型编号,'内容','未处理',经手人编号,0) Unusual un = new Unusual(); un.Unusual_QCInfo_ID = QcinfoID; un.Unusual_UnusualType_Id = Convert.ToInt32(cboUnusualType_Name.SelectedValue); un.Unusual_TestItems_ID = Convert.ToInt32(cboUnusualType_Name.SelectedValue); un.Unusual_content = cboUnusualType_Name.Text + "异常:" + txtcontent.Text.Trim(); un.Unusual_State = "未处理"; un.Unusual_ISSMSSend = false; un.Unusual_time = LinQBaseDao.getDate(); int u_id = 0; if (UnusualDAL.InsertOneQCRecord(un, out u_id)) { MessageBox.Show("短信发送成功!"); int TestItems_ID = Convert.ToInt32(cboUnusualType_Name.SelectedValue); //发送内容及发送人 DataSet SMSDs = LinQBaseDao.Query("select top(1)* from SMSConfigure where SMSConfigure_TestItems_ID=" + TestItems_ID);//只会存在一条 #region 取内容 string[] SMSContent = SMSDs.Tables[0].Rows[0]["SMSConfigure_SendContent"].ToString().Split(','); string[] SMSContentTxt = SMSDs.Tables[0].Rows[0]["SMSConfigure_SendContentText"].ToString().Split(','); string Contents = SMSSendContent(SMSContent, un.Unusual_Id, SMSContentTxt, un.Unusual_content);//存储短信内容 #endregion #region 取号码、姓名,并对其号码发送短信(号码和姓名同位置是一组数据) string[] SMSPhon = SMSDs.Tables[0].Rows[0]["SMSConfigure_ReceivePhone"].ToString().Split(';'); //号码 string[] SMSName = SMSDs.Tables[0].Rows[0]["SMSConfigure_Receive"].ToString().Split(';'); //姓名 for (int y = 0; y < SMSPhon.Count(); y++) //循环要发送的人数的电话号码 { if (SMSPhon[y] != "") { SmsSend ss = new SmsSend(); ss.SmsSend_Phone = SMSPhon[y]; ss.SmsSend_Text = Contents; ss.SmsSend_userName = SMSName[y]; ss.SmsSend_IsSend = "0"; ss.SmsSend_Unusunal_ID = un.Unusual_Id; bool b = SmsSendDAL.Insert(ss); } } #endregion Emety(); } else { MessageBox.Show("短信发送失败!"); return; } }