当前位置: 首页>>代码示例>>C#>>正文


C# Dbconn.Excute方法代码示例

本文整理汇总了C#中Dbconn.Excute方法的典型用法代码示例。如果您正苦于以下问题:C# Dbconn.Excute方法的具体用法?C# Dbconn.Excute怎么用?C# Dbconn.Excute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Dbconn的用法示例。


在下文中一共展示了Dbconn.Excute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Send

        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);
        }
开发者ID:huaminglee,项目名称:Code,代码行数:14,代码来源:SMSSendImmediately.cs

示例2: Execute

        /// <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;
        }
开发者ID:huaminglee,项目名称:Code,代码行数:25,代码来源:SendAMMessageForVex.cs

示例3: SendSMS

        /// <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;
            }
        }
开发者ID:huaminglee,项目名称:Code,代码行数:29,代码来源:MsgCenter.cs

示例4: SetITAppraisal1

        /// <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 = '" + strActor
                       + "', FA3_RgDt = GETDATE(), FA3_UptNo = ISNULL(FA3_UptNo, 0)+1 "
                       + " WHERE FA3_ID = '" + strID + "'";
            }
            return conn.Excute(strSQL);
        }
开发者ID:huaminglee,项目名称:Code,代码行数:96,代码来源:PE_OA_FA_ITAppraisal.cs

示例5: Execute

        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 [email protected]", 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;

        }
开发者ID:huaminglee,项目名称:Code,代码行数:84,代码来源:MDM_SSO_System_Relation_ExecuteF22.cs


注:本文中的Dbconn.Excute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。