예제 #1
0
        public static void Send(string pstrPhoneNumber, string pstrContent)
        {
            pstrPhoneNumber = pstrPhoneNumber.Replace("'", "");
            pstrContent = pstrContent.Replace("'", "");

            Dbconn conn = new Dbconn("SMS");
            string strSQL = @"
                EXEC SMS.DBO.sp_smstosend 'SMS', 'POS', '" + pstrPhoneNumber + @"', '', '" + pstrContent + @"', '" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + @"',
                    '1', '' ;
                EXEC SMS.DBO.sp_smspush_phone '" + pstrPhoneNumber + @"';
            ";

            conn.Excute(strSQL);
        }
예제 #2
0
        /// <summary>
        /// 根据XML内容更新服务器申请单
        /// </summary>
        /// <returns></returns>
        public bool Execute()
        {

            DateTime timeNow = DateTime.Now;

            if (timeNow.DayOfWeek != DayOfWeek.Sunday)
            {
                //System.Threading.Thread.Sleep(30000);
                AMSendWS.MsgCenter msg = new AMSendWS.MsgCenter();
                msg.SendSubjectMsg("AM", "ITSM", "各位好,请将今天的工作内容发给我。谢谢!", "马卫清", "马卫清", "各位好,请将今天的工作内容发给我。谢谢!", DateTime.Now.AddHours(-1).ToString("yyyy-MM-dd HH:mm:ss"), "1");

                msg.SendSubjectMsg("AM", "ITSM", "各位好,请将今天的工作内容发给我。谢谢!", "刘洪", "马卫清", "各位好,请将今天的工作内容发给我。谢谢!", DateTime.Now.AddHours(-1).ToString("yyyy-MM-dd HH:mm:ss"), "1");
                msg.SendSubjectMsg("AM", "ITSM", "各位好,请将今天的工作内容发给我。谢谢!", "张凯军", "马卫清", "各位好,请将今天的工作内容发给我。谢谢!", DateTime.Now.AddHours(-1).ToString("yyyy-MM-dd HH:mm:ss"), "1");
                msg.SendSubjectMsg("AM", "ITSM", "各位好,请将今天的工作内容发给我。谢谢!", "郭琦琦", "马卫清", "各位好,请将今天的工作内容发给我。谢谢!", DateTime.Now.AddHours(-1).ToString("yyyy-MM-dd HH:mm:ss"), "1");
                msg.SendSubjectMsg("AM", "ITSM", "各位好,请将今天的工作内容发给我。谢谢!", "俞晓东", "马卫清", "各位好,请将今天的工作内容发给我。谢谢!", DateTime.Now.AddHours(-1).ToString("yyyy-MM-dd HH:mm:ss"), "1");

                Dbconn conn = new Dbconn("WS_Log");
                conn.Excute("INSERT INTO Log_MDMTEST (name1) values('" + System.Net.Dns.GetHostName() + "')");
            }
            return true;
        }
예제 #3
0
        /// <summary>
        /// SendSMS 发送短信
        /// </summary>
        /// <param name="strSystem"></param>
        /// <param name="pstrPhoneNumber"></param>
        /// <param name="pstrContent"></param>
        /// <param name="strCom"></param>
        /// <returns></returns>
        public bool SendSMS(string pstrSystem, string pstrPhoneNumber, string pstrContent, string pstrCom)
        {
            pstrPhoneNumber = pstrPhoneNumber.Replace("'", "");
            pstrContent = pstrContent.Replace("'", "");
            int iResult = -1;
            Dbconn conn = new Dbconn("SMS");
            string strSQL = @"
                EXEC SMS.DBO.sp_smstosend 'SMS', '" + pstrSystem + "', '" + pstrPhoneNumber + "', '', '" + pstrContent + @"', '"
                                                    + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "','" + pstrCom + @"', '' ;
                EXEC SMS.DBO.sp_smspush_phone '" + pstrPhoneNumber + @"';";
            iResult = conn.Excute(strSQL);

            if (iResult > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
예제 #4
0
        /// <summary>
        /// 新建或修改鉴定单记录
        /// </summary>
        /// <returns></returns>
        public int SetITAppraisal1(Dbconn conn, String strType)
        {
            DataSet ds = new DataSet();
            string strActor = m_request.Tables[0].Rows[0]["actor"].ToString();
            string strXML = m_request.Tables[0].Rows[0]["XML"].ToString();
            //获取申购单主表数据
            DataSet dsXML = Common.Common.GetDSByExcelXML(strXML);
            String strOPType = dsXML.Tables["OPTYPE"].Rows[0][0].ToString().ToUpper();
            String strID = dsXML.Tables["LIST"].Rows[0]["fa3_id"].ToString();
            String strDIVI = dsXML.Tables["LIST"].Rows[0]["fa3_divi"].ToString();
            String strCONO = dsXML.Tables["LIST"].Rows[0]["fa3_cono"].ToString();
            String strState = dsXML.Tables["LIST"].Rows[0]["fa3_state"].ToString();
            String strDepartment = dsXML.Tables["LIST"].Rows[0]["fa3_department"].ToString();
            String strName = dsXML.Tables["LIST"].Rows[0]["fa3_name"].ToString();
            String strDeviceno = dsXML.Tables["LIST"].Rows[0]["fa3_deviceno"].ToString();
            String strAssetsno = dsXML.Tables["LIST"].Rows[0]["fa3_assetsno"].ToString();
            String strFilldate = dsXML.Tables["LIST"].Rows[0]["fa3_filldate"].ToString();
            String strFaultphenomenon = dsXML.Tables["LIST"].Rows[0]["fa3_faultphenomenon"].ToString();
            String strDiagnosisresults = dsXML.Tables["LIST"].Rows[0]["fa3_diagnosisresults"].ToString();
            String strSolution = dsXML.Tables["LIST"].Rows[0]["fa3_solution"].ToString();
            String strDiagnosisdept = dsXML.Tables["LIST"].Rows[0]["fa3_diagnosisdept"].ToString();
            String strDiagnosispeople = dsXML.Tables["LIST"].Rows[0]["fa3_diagnosispeople"].ToString();
            String strAudit = dsXML.Tables["LIST"].Rows[0]["fa3_audit"].ToString();
            String strAuditdate = dsXML.Tables["LIST"].Rows[0]["fa3_auditdate"].ToString();
            String strBrandmodel1 = dsXML.Tables["LIST"].Rows[0]["fa3_brandmodel1"].ToString();
            String strNo1 = dsXML.Tables["LIST"].Rows[0]["fa3_no1"].ToString();
            String strNum1 = dsXML.Tables["LIST"].Rows[0]["fa3_num1"].ToString();
            String strRemarks1 = dsXML.Tables["LIST"].Rows[0]["fa3_remarks1"].ToString();
            String strBrandmodel2 = dsXML.Tables["LIST"].Rows[0]["fa3_brandmodel2"].ToString();
            String strNo2 = dsXML.Tables["LIST"].Rows[0]["fa3_no2"].ToString();
            String strNum2 = dsXML.Tables["LIST"].Rows[0]["fa3_num2"].ToString();
            String strRemarks2 = dsXML.Tables["LIST"].Rows[0]["fa3_remarks2"].ToString();
            String strBrandmodel3 = dsXML.Tables["LIST"].Rows[0]["fa3_brandmodel3"].ToString();
            String strNo3 = dsXML.Tables["LIST"].Rows[0]["fa3_no3"].ToString();
            String strNum3 = dsXML.Tables["LIST"].Rows[0]["fa3_num3"].ToString();
            String strRemarks3 = dsXML.Tables["LIST"].Rows[0]["fa3_remarks3"].ToString();


            //拼接查询语句
            string strSQL = "";
            if (strType == "New")
            {
                strSQL = @" INSERT INTO B02_BILL.FA3_ITAppraisal(FA3_ID, FA3_CONO, FA3_DIVI, FA3_State, 
                            FA3_Department, FA3_Name, FA3_DeviceNo, FA3_Assetsno, FA3_FillDate, 
                            FA3_FaultPhenomenon, FA3_DiagnosisResults, FA3_Solution, FA3_DiagnosisDept, 
                            FA3_DiagnosisPeople, FA3_BrandModel1, FA3_No1, 
                            FA3_Num1, FA3_Remarks1, FA3_BrandModel2, FA3_No2, FA3_Num2, FA3_Remarks2, 
                            FA3_BrandModel3, FA3_No3, FA3_Num3, FA3_Remarks3, 
                            FA3_RgUser, FA3_UptNo, FA3_RgDt) VALUES( '"
                        + strID + "', '" + strCONO + "', '" + strDIVI + "', '" + strState + "', '"
                        + strDepartment + "', '" + strName + "', '" + strDeviceno + "', '"
                        + strAssetsno + "', '" + strFilldate + "', '" + strFaultphenomenon + "', '"
                        + strDiagnosisresults + "', '" + strSolution + "', '"
                        + strDiagnosisdept + "', '" + strDiagnosispeople + "', '"
                        + strNo1 + "', '" + strBrandmodel1 + "', '" + strNum1 + "', '" + strRemarks1 + "', '"
                        + strNo2 + "', '" + strBrandmodel2 + "', '" + strNum2 + "', '" + strRemarks2 + "', '"
                        + strNo3 + "', '" + strBrandmodel3 + "', '" + strNum3 + "', '" + strRemarks3 + "', '"
                        + strActor + "', 0, GETDATE())";

            }
            else if (strType == "Upd")
            {
                strSQL = @" UPDATE B02_BILL.FA3_ITAppraisal SET FA3_State = '" + strState
                       + "', FA3_Department = '" + strDepartment
                       + "', FA3_Name = '" + strDepartment
                       + "', FA3_DeviceNo = '" + strDeviceno
                       + "', FA3_Assetsno = '" + strAssetsno
                       + "', FA3_AssetsNo = '" + strFilldate
                       + "', FA3_FillDate = '" + strFilldate
                       + "', FA3_FaultPhenomenon = '" + strFaultphenomenon
                       + "', FA3_DiagnosisResults = '" + strDiagnosisresults
                       + "', FA3_Solution = '" + strSolution
                       + "', FA3_DiagnosisDept = '" + strDiagnosisdept
                       + "', FA3_DiagnosisPeople = '" + strDiagnosispeople
                       + "', FA3_No1 = '" + strNo1
                       + "', FA3_BrandModel1 = '" + strBrandmodel1
                       + "', FA3_Num1 = '" + strNum1
                       + "', FA3_Remarks1 = '" + strRemarks1
                       + "', FA3_No2 = '" + strNo2
                       + "', FA3_BrandModel2 = '" + strBrandmodel2
                       + "', FA3_Num2 = '" + strNum2
                       + "', FA3_Remarks2 = '" + strRemarks2
                       + "', FA3_No3 = '" + strNo3
                       + "', FA3_BrandModel3 = '" + strBrandmodel3
                       + "', FA3_Num3 = '" + strNum3
                       + "', FA3_Remarks3 = '" + strRemarks3
                       + "', FA3_LmUser = '******', FA3_RgDt = GETDATE(), FA3_UptNo = ISNULL(FA3_UptNo, 0)+1 "
                       + " WHERE FA3_ID = '" + strID + "'";
            }
            return conn.Excute(strSQL);
        }
        public bool Execute()
        {
            string strSystem_Fid = "144";
            string strSystem_id = "ST0301A";
            string strSystem_Name = "F22分销系统 CS总部版";
            string strCompany_id = "235";
            Dbconn conn = new Dbconn("F22");
            Dbconn conn_MDM = new Dbconn("MDM");

            //取到总部的数据
            DataSet ds = conn.GetDataSet(
                @"  SELECT  userid ,
                            username
                    FROM    j_user t1 WITH ( NOLOCK )
                    WHERE   1 = 1
                            AND dptype = 0
                            AND notuse = 0
 	                    ");


            DataTable dt_Add = new DataTable();
            dt_Add.Columns.Add("System_FID");
            dt_Add.Columns.Add("System_ID");
            dt_Add.Columns.Add("System_Name");
            dt_Add.Columns.Add("AM_User_ID");
            dt_Add.Columns.Add("AM_Login");
            dt_Add.Columns.Add("Company_ID");
            dt_Add.Columns.Add("System_User_ID");
            dt_Add.Columns.Add("System_User_Name");
            dt_Add.Columns.Add("Create_AM_User_ID");
            dt_Add.Columns.Add("CreateTime");
            dt_Add.Columns.Add("UpdateTime");

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                string strName = ds.Tables[0].Rows[i]["username"].ToString();
                string strUserID = ds.Tables[0].Rows[i]["userid"].ToString();

                DataTable dt_AM = conn_MDM.GetDataTable(@"SELECT AM_User_ID,AM_login FROM dbo.AM_User
                                                WHERE AM_LOGIN=@param0", new string[1] { strName });
                if (dt_AM.Rows.Count > 0)
                {
                    DataRow dr_add = dt_Add.NewRow();
                    dr_add["System_FID"] = strSystem_Fid;
                    dr_add["System_ID"] = strSystem_id;
                    dr_add["System_Name"] = strSystem_Name;
                    dr_add["AM_User_ID"] = dt_AM.Rows[0]["AM_User_ID"].ToString();
                    dr_add["AM_Login"] = dt_AM.Rows[0]["AM_Login"].ToString();

                    dr_add["Company_ID"] = strCompany_id;

                    dr_add["System_User_ID"] = strUserID;
                    dr_add["System_User_Name"] = strName;
                    dr_add["Create_AM_User_ID"] = "0"; //默认为系统自动建立
                    dr_add["CreateTime"] = DateTime.Now;
                    dr_add["UpdateTime"] = DateTime.Now;
                    dt_Add.Rows.Add(dr_add);
                }
            }

            if (dt_Add.Rows.Count > 0)
            {
                ArrayList listLockTable = new ArrayList();
                listLockTable.Add("SSO_System_Relation");

                conn_MDM.BeginTransaction();
                try
                {
                    conn_MDM.TableLock(listLockTable);
                    conn_MDM.Excute("DELETE FROM SSO_System_Relation WHERE System_FID='" + strSystem_Fid + "'");
                    conn_MDM.InsertBYSQLBC("SSO_System_Relation", dt_Add);
                    conn_MDM.CommitTransaction();
                }
                catch (Exception)
                {
                    conn_MDM.RollbackTransaction();
                    throw;
                }

            }

            return true;

        }