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


C# Dbconn.Delete方法代码示例

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


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

示例1: Execute

        /// <summary>
        /// 删除系统权限信息
        /// </summary>
        /// <returns></returns>
        public bool Execute()
        {
            Dbconn conn = new Dbconn("MDM");

            try
            {
                string strAuthorization_ID = m_request.Tables[0].Rows[0]["Authorization_ID"].ToString();
                m_request.Tables[0].Columns.Remove("Authorization_ID");

                ArrayList listTable = new ArrayList();
                listTable.Add("MDM_System_Authorization");
                listTable.Add("MDM_System_Menu_AUZ");
                conn.BeginTransaction();
                conn.TableLock(listTable);

                if (strAuthorization_ID != "")
                {
                    string strWhere = " Authorization_ID=" + strAuthorization_ID;
                    conn.Delete("MDM_System_Authorization", strWhere);
                    conn.Delete("MDM_System_Menu_AUZ", strWhere);
                }
                conn.CommitTransaction();
                return true;
            }
            catch
            {
                conn.RollbackTransaction();
                throw;
            }



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

示例2: Execute

        /// <summary>
        /// 编辑WS信息
        /// </summary>
        /// <returns></returns>
        public bool Execute()
        {
            Dbconn conn = new Dbconn("WSRR");

            try
            {
                if(m_request == null
                    || m_request.Tables.Count==0
                    || m_request.Tables[0].Rows.Count == 0)
                {
                    return true;
                }
                string strParam_ID = m_request.Tables[0].Rows[0]["Param_ID"].ToString();
                
                ArrayList listTable = new ArrayList();
                listTable.Add("WS_Param");
                conn.BeginTransaction();
                conn.TableLock(listTable);
                string strWhere = " Param_ID = '" + strParam_ID + "'";

                conn.Delete("WS_Param", strWhere);
                conn.CommitTransaction();
                return true;
            }
            catch
            {
                conn.RollbackTransaction();
                throw;
            }



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

示例3: GetData

        public DataSet GetData()
        {
            Dbconn conn = new Dbconn("WSRR");
            string strXML = m_request.Tables[0].Rows[0]["XML"].ToString();
            DataTable dt_EditResult = new dsCommon.dtResultDataTable();
            DataSet dsRequest = new DataSet();
            DataSet ds_Return = new DataSet();
            dsRequest = Common.Common.GetDSByExcelXML(strXML);
            DataTable dt_OPTYPE = dsRequest.Tables["OPTYPE"];
            DataTable dt_LIST = dsRequest.Tables["LIST"];

            for (int i = 0; i < dt_OPTYPE.Rows.Count; i++)
            {
                //获取用户权限信息
                if (dt_OPTYPE.Rows[i][0].ToString().ToUpper() == "GET")
                {
                    string strUserName = dt_LIST.Rows[0]["UserName"].ToString();
                    string strSQL = @"
                                SELECT DISTINCT
	                                   T1.[AUZID]
                                      ,T1.[AUZName]
                                      ,0 AS Authorization_ID_F
                                      , CASE WHEN T2.USERNAME IS NULL THEN '0'
                                       ELSE  '1' END  HavaFlag
                                  FROM [WSRR_Manage].[F01_CERT].[AUZ] T1 WITH ( NOLOCK )
                                  LEFT JOIN [WSRR_Manage].[F01_CERT].[UserAUZ] T2 WITH ( NOLOCK ) ON T1.AUZID=T2.AUZID
			                                AND [email protected]";
                    ds_Return = conn.GetDataSet(strSQL, new string[] { strUserName });
                }
                //更新用户权限
                else if (dt_OPTYPE.Rows[i][0].ToString().ToUpper() == "UPDATE")
                {
                    string strUserName = dt_LIST.Rows[0]["UserName"].ToString();
                    conn.LockTableList.Add("[WSRR_Manage].[F01_CERT].[UserAUZ]");//锁定表
                    conn.BeginTransaction();
                    //1.删除该用户的所有权限
                    string strWhere = " UserName=" + strUserName;
                    bool deleteFlag = conn.Delete("[WSRR_Manage].[F01_CERT].[UserAUZ]", strWhere);
                    //2.新增勾选的权限
                    bool insertFlag = conn.Insert("[WSRR_Manage].[F01_CERT].[UserAUZ]", dt_LIST);
                    conn.CommitTransaction();
                    //删除操作和插入操作都正确的情况下
                    if (deleteFlag && insertFlag)
                    {
                        dt_EditResult.Rows.Add(new object[] { true, strUserName + "权限更新成功!" });
                    }
                    else
                    {
                        dt_EditResult.Rows.Add(new object[] { true, strUserName + "权限更新失败!" });
                    }
                    ds_Return.Tables.Add(dt_EditResult);
                }
            }
            return ds_Return;
        }
开发者ID:huaminglee,项目名称:Code,代码行数:55,代码来源:User_Authority.cs

示例4: Execute

        /// <summary>
        /// 编辑系统属性值信息
        /// </summary>
        /// <returns></returns>
        public bool Execute()
        {
            Dbconn conn = new Dbconn("MDM");

            try
            {
                string strSystem_ID = m_request.Tables[0].Rows[0]["System_ID"].ToString();
                string strSystem_Code = m_request.Tables[0].Rows[0]["System_Code"].ToString();

                DataTable dt_Add = new DataTable();
                dt_Add.Columns.Add("System_ID");
                dt_Add.Columns.Add("System_Code");
                dt_Add.Columns.Add("Property_ID");
                dt_Add.Columns.Add("Property_Text");
                for (int i = 2; i < m_request.Tables[0].Columns.Count; i++)
                {
                    string strValue = m_request.Tables[0].Rows[0][i].ToString();
                    if (strValue != "")
                    {
                        dt_Add.Rows.Add(new object[] { strSystem_ID, strSystem_Code, m_request.Tables[0].Columns[i].ToString(),strValue});
                    }
                }


                ArrayList listTable = new ArrayList();
                listTable.Add("MDM_System_Property_info");
                conn.BeginTransaction();
                conn.TableLock(listTable);
                string strWhere = " System_ID=" + strSystem_ID;
                conn.Delete("MDM_System_Property_info", strWhere);

                conn.InsertBYSQLBC("MDM_System_Property_info", dt_Add);
                
                conn.CommitTransaction();
                return true;
            }
            catch
            {
                conn.RollbackTransaction();
                throw;
            }



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

示例5: Execute

        /// <summary>
        /// 删除任务参数信息
        /// </summary>
        /// <returns></returns>
        public bool Execute()
        {
            Dbconn conn = new Dbconn("MDM");    //创建连接类

            try
            {
                if (m_request == null
                    || m_request.Tables.Count == 0
                    || m_request.Tables[0].Rows.Count == 0)
                {
                    return true;
                }
                string strParam_ID = m_request.Tables[0].Rows[0]["param_id"].ToString();    //获取参数Param_ID
                string strTASK_ID = m_request.Tables[0].Rows[0]["task_id"].ToString();  //获取参数Task_ID

                ArrayList listTable = new ArrayList();
                listTable.Add("WS_SchedulingParam");
                conn.BeginTransaction();    //开启事务
                conn.TableLock(listTable);  //锁表WS_SchedulingParam

                string strWhere = " Param_ID = '" + strParam_ID + "'";  //创建where语句
                conn.Delete("WS_SchedulingParam", strWhere);    //删除参数

                //更新主表
                DataTable dtScheduling = new DataTable();
                dtScheduling.Columns.Add("UpdateTime");
                DataRow drScheduling = dtScheduling.NewRow();
                drScheduling["UpdateTime"] = DateTime.Now;
                dtScheduling.Rows.Add(drScheduling);
                string strSchedulingWhere = " 1=1 AND TASK_ID = '" + strTASK_ID + "'";
                conn.Update("WS_Scheduling", dtScheduling, strSchedulingWhere);    //更新数据

                conn.CommitTransaction();   //提交事务
                return true;
            }
            catch
            {
                conn.RollbackTransaction(); //回滚
                throw;
            }



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

示例6: GetData


//.........这里部分代码省略.........
                    {
                        throw new Exception("Template_ID不能为空");
                    }

                    ds.Tables["list"].Columns.Remove("Template_ID");

                    Commom_Ds.SetUpdateInfo(ds.Tables["list"], hzyMessage);

                    conn.BeginTransaction();
                    if (CheckName(ds.Tables["list"], conn) == false)
                    {
                        conn.RollbackTransaction();
                        throw new Exception("模板名称已经存在");
                    }

                    bResult = conn.Update("EnvoTemplates", ds.Tables["list"], "Template_ID='" + strTemplate_ID + "'");
                    conn.CommitTransaction();
                }


                if (bResult)
                {
                    dt_EditResult.Rows.Add(new object[] { true, "修改成功" });
                }
                else
                {
                    dt_EditResult.Rows.Add(new object[] { false, "修改失败" });

                }
                ds_Return.Tables.Add(dt_EditResult);
            }
            else if (dt_OPTYPE.Rows[0][0].ToString().ToUpper() == "INSERT")
            {

                bool bResult = true;

                if (ds.Tables["list"].Rows.Count > 0)
                {
                    ds.Tables["list"].Columns.Remove("Template_ID");

                    Commom_Ds.SetUpdateInfo(ds.Tables["list"], hzyMessage);

                    conn.BeginTransaction();
                    if (CheckName(ds.Tables["list"], conn) == false)
                    {
                        conn.RollbackTransaction();
                        throw new Exception("模板名称已经存在");
                    }
                    bResult = conn.Insert("EnvoTemplates", ds.Tables["list"]);
                    conn.CommitTransaction();
                }


                if (bResult)
                {
                    dt_EditResult.Rows.Add(new object[] { true, "修改成功" });
                }
                else
                {
                    dt_EditResult.Rows.Add(new object[] { false, "修改失败" });

                }
                ds_Return.Tables.Add(dt_EditResult);
            }
            else if (dt_OPTYPE.Rows[0][0].ToString().ToUpper() == "DELETE")
            {

                bool bResult = true;

                if (ds.Tables["list"].Rows.Count > 0)
                {
                    string strTemplate_ID = ds.Tables["list"].Rows[0]["Template_ID"].ToString();
                    if (strTemplate_ID == "")
                    {
                        throw new Exception("Template_ID不能为空");
                    }

                    conn.BeginTransaction();
                    bResult = conn.Delete("EnvoTemplates", "Template_ID='" + strTemplate_ID + "'");
                    conn.CommitTransaction();
                }


                if (bResult)
                {
                    dt_EditResult.Rows.Add(new object[] { true, "修改成功" });
                }
                else
                {
                    dt_EditResult.Rows.Add(new object[] { false, "修改失败" });

                }
                ds_Return.Tables.Add(dt_EditResult);
            }

            return ds_Return;



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

示例7: Execute

        /// <summary>
        /// 部署WS
        /// </summary>
        /// <returns></returns>
        public bool Execute()
        {
            Dbconn conn = new Dbconn("WSRR");
            Dbconn connDeploy = new Dbconn("WSRR_Deploy");

            try
            {
                if(m_request == null
                    || m_request.Tables.Count==0
                    || m_request.Tables[0].Rows.Count == 0)
                {
                    return true;
                }
                string strWS_ID = m_request.Tables[0].Rows[0]["WS_ID"].ToString();

                string strSQL = "";

                DataSet ds = conn.GetDataSet(@"
                            SELECT * FROM dbo.WS
                            WHERE [email protected];

                            SELECT * FROM dbo.WS_Param
                            WHERE [email protected]",new string[]{strWS_ID});

                if (ds.Tables.Count !=2 || ds.Tables[0].Rows.Count == 0)
                {
                    throw new Exception("WS_ID的信息不正确!");
                }
                string strENV =  ConfigurationManager.AppSettings["WSRR_ENV"];

                if (strENV.ToLower() == "prod")
                {
                    ds.Tables[0].Rows[0]["WS_Host"] = ds.Tables[0].Rows[0]["WS_Host_Test"].ToString();
                }
                else
                {
                    ds.Tables[0].Rows[0]["WS_Host"] = ds.Tables[0].Rows[0]["WS_Host_Prod"].ToString();
                }

                ArrayList tableList = new ArrayList();
                tableList.Add("WS");
                tableList.Add("WS_Param");
                connDeploy.BeginTransaction();
                connDeploy.TableLock(tableList);

                connDeploy.Delete("WS", "WS_ID='" + strWS_ID + "'");
                connDeploy.Delete("WS_Param", "WS_ID='" + strWS_ID + "'");

                connDeploy.Insert("WS", ds.Tables[0]);
                connDeploy.Insert("WS_Param", ds.Tables[1]);
                connDeploy.CommitTransaction();

                return true;
            }
            catch
            {
                conn.RollbackTransaction();
                throw;
            }



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

示例8: Execute

        public bool Execute()
        {
            string strEnv_ID = "";
            string strEnv_SN = "HZY_CMT";

            Dbconn conn_HZY_SBS = new Dbconn("F22GP_ForSalesPlan");

            DataSet ds = conn_HZY_SBS.GetDataSet(
                @" SELECT   
                                --98 AS Env_ID ,
                                NULL AS VexSSONewID ,
                                b.userid AS App_UserName ,
                                RIGHT(sys.fn_VarBinToHexStr(hashbytes('MD5', CONVERT(VARCHAR(100), b.password))), 32) AS App_Password ,
                                b.password AS App_PasswordSrc ,
                                CASE WHEN b.dptype <> 0 THEN ISNULL(a.depotid,'') + '_' + d_name ELSE b.username END  AS App_UserName_CN ,
                                GETDATE() Chang_Password_Time ,
                                1 Checked ,
                                'system' Check_User ,
                                GETDATE() Check_Time ,
                                GETDATE() Createtime ,
                                GETDATE() Updatetime,
                                0 as oprationFlag
                        FROM    
                                j_user b
                                LEFT JOIN j_depot a ON a.depotid = b.depotid
                     ");

            Dbconn connMDM = new Dbconn("VexSSO");

            try
            {

                ArrayList tableList = new ArrayList();
                connMDM.BeginTransaction();
                tableList.Add("MDM_System_User");
                connMDM.TableLock(tableList);

                strEnv_ID = connMDM.GetDataTableFirstValue("SELECT [Env_ID]  FROM [MDM_System_Env]  WHERE Env_SN='" + strEnv_SN + "'").ToString();
                DataTable dtMDM = connMDM.GetDataTable(@"
                                                        SELECT [App_UserID]
                                                              ,[Env_ID]
                                                              ,[VexSSONewID]
                                                              ,[App_UserName]
                                                              ,[App_Password]
                                                              ,[App_PasswordSrc]
                                                              ,[App_UserName_CN]
                                                              ,[Chang_Password_Time]
                                                              ,[Checked]
                                                              ,[Check_User]
                                                              ,[Check_Time]
                                                              ,[Createtime]
                                                              ,[Updatetime]
                                                          FROM [dbo].[MDM_System_User]
                                                          WHERE Env_ID='" + strEnv_ID + @"'
                                                        ");


                DataTable dtMDMUpdate = dtMDM.Clone();
                DataTable dtMDMInsert = dtMDM.Clone();
                DataTable dtMDMDelete = dtMDM.Clone();

                for (int i = 0; i < dtMDM.Rows.Count; i++)
                {
                    string strApp_UserName = dtMDM.Rows[i]["App_UserName"].ToString();

                    DataRow[] dr = ds.Tables[0].Select("App_UserName='" + strApp_UserName + "'");
                    if (dr.Length > 0)
                    {
                        dtMDM.Rows[i]["App_Password"] = dr[0]["App_Password"];
                        dtMDM.Rows[i]["App_PasswordSrc"] = dr[0]["App_PasswordSrc"];
                        dtMDM.Rows[i]["App_UserName_CN"] = dr[0]["App_UserName_CN"];

                        dtMDMUpdate.ImportRow(dtMDM.Rows[i]);
                        dr[0]["oprationFlag"] = "1";
                    }
                    else
                    {
                        dtMDMDelete.ImportRow(dtMDM.Rows[i]);
                    }
                }

                DataRow[] drInsert = ds.Tables[0].Select("oprationFlag=0");
                for (int i = 0; i < drInsert.Length; i++)
                {
                    DataRow dr = dtMDMInsert.NewRow();
                    dr["Env_ID"] = strEnv_ID;
                    dr["VexSSONewID"] = drInsert[i]["VexSSONewID"];
                    dr["App_UserName"] = drInsert[i]["App_UserName"];
                    dr["App_Password"] = drInsert[i]["App_Password"];
                    dr["App_PasswordSrc"] = drInsert[i]["App_PasswordSrc"];
                    dr["App_UserName_CN"] = drInsert[i]["App_UserName_CN"];
                    dr["Chang_Password_Time"] = drInsert[i]["Chang_Password_Time"];
                    dr["Checked"] = drInsert[i]["Checked"];
                    dr["Check_User"] = drInsert[i]["Check_User"];
                    dr["Check_Time"] = drInsert[i]["Check_Time"];
                    dr["Createtime"] = drInsert[i]["Createtime"];
                    dr["Updatetime"] = drInsert[i]["Updatetime"];
                    dtMDMInsert.Rows.Add(dr);
                }

//.........这里部分代码省略.........
开发者ID:huaminglee,项目名称:Code,代码行数:101,代码来源:MDM_System_User_ExceuteGetFromGPF22ForHZYCMT.cs

示例9: GetData

        public DataSet GetData()
        {
            Dbconn conn = new Dbconn("WSRR");
            string strXML = m_request.Tables[0].Rows[0]["XML"].ToString();
            DataTable dt_EditResult = new dsCommon.dtResultDataTable();
            DataSet dsRequest = new DataSet();
            DataSet ds_Return = new DataSet();
            dsRequest = Common.Common.GetDSByExcelXML(strXML);
            DataTable dt_OPTYPE = dsRequest.Tables["OPTYPE"];
            DataTable dt_LIST = dsRequest.Tables["LIST"];

            for (int i = 0; i < dt_OPTYPE.Rows.Count; i++)
            {
                //获取用户权限信息
                if (dt_OPTYPE.Rows[i][0].ToString().ToUpper() == "GET")
                {
                    string strSQL = @"
                            SELECT 
                                   [MenuID]
                                  ,[MenuName]
                                  ,[MenuFatherID]
                                  ,[ActionURL]
                              FROM [WSRR_Manage].[F01_CERT].[Menu]
                        ";
                    ds_Return = conn.GetDataSet(strSQL);
                    //ds_Return.Tables[0].Rows.Add(new object[] { "0", "00_根目录", "-1", "-1" });
                }     
                //更新
                else if (dt_OPTYPE.Rows[i][0].ToString().ToUpper() == "EDIT")
                {
                    string strMenuID = dt_LIST.Rows[0]["MenuID"].ToString();
                    bool bResult = false;
                    conn.LockTableList.Add("[WSRR_Manage].[F01_CERT].[Menu]");//锁定表
                    conn.BeginTransaction();//开始事务
                    dt_LIST.Columns.Remove("MenuID");//移除属性,标识符列(ID)不能更新
                    bResult = conn.Update("[WSRR_Manage].[F01_CERT].[Menu]", dt_LIST, "MenuID=" + strMenuID);//update语句
                    conn.CommitTransaction();
                    if (bResult)
                    {
                        dt_EditResult.Rows.Add(new object[] { true, "修改成功" });
                    }
                    else
                    {
                        dt_EditResult.Rows.Add(new object[] { false, "修改失败" });

                    }
                    ds_Return.Tables.Add(dt_EditResult);
                }
                else if (dt_OPTYPE.Rows[i][0].ToString().ToUpper() == "INSERT")
                {
                    string strMenuID = dt_LIST.Rows[0]["MenuID"].ToString();
                    bool bResult = false;
                    conn.LockTableList.Add("[WSRR_Manage].[F01_CERT].[Menu]");//锁定表
                    conn.BeginTransaction();//开始事务
                    dt_LIST.Columns.Remove("MenuID");//移除属性,标识符列(ID)不能更新
                    bResult = conn.Insert("[WSRR_Manage].[F01_CERT].[Menu]", dt_LIST);//update语句
                    conn.CommitTransaction();
                    if (bResult)
                    {
                        dt_EditResult.Rows.Add(new object[] { true, "修改成功" });
                    }
                    else
                    {
                        dt_EditResult.Rows.Add(new object[] { false, "修改失败" });

                    }
                    ds_Return.Tables.Add(dt_EditResult);
                }
                else if (dt_OPTYPE.Rows[i][0].ToString().ToUpper() == "DELETE")
                {
                    string strMenuID = dt_LIST.Rows[0]["MenuID"].ToString();
                    bool bResult = false;
                    conn.LockTableList.Add("[WSRR_Manage].[F01_CERT].[Menu]");//锁定表
                    conn.BeginTransaction();//开始事务
                    dt_LIST.Columns.Remove("MenuID");//移除属性,标识符列(ID)不能更新
                    bResult = conn.Delete("[WSRR_Manage].[F01_CERT].[Menu]" , "MenuID=" + strMenuID);//update语句
                    conn.CommitTransaction();
                    if (bResult)
                    {
                        dt_EditResult.Rows.Add(new object[] { true, "修改成功" });
                    }
                    else
                    {
                        dt_EditResult.Rows.Add(new object[] { false, "修改失败" });

                    }
                    ds_Return.Tables.Add(dt_EditResult);
                }
            }

            return ds_Return;
        }
开发者ID:huaminglee,项目名称:Code,代码行数:92,代码来源:MenuManage.cs

示例10: Execute

        /// <summary>
        /// 获取MDM应用的数据
        /// </summary>
        /// <returns></returns>
        public bool Execute()
        {



            DateTime dateStart = DateTime.Now;
            DateTime dateEnd = DateTime.Now;


            if (m_request != null && m_request.Tables.Count >0 &&  m_request.Tables[0].Rows.Count == 1)
            {
                if (m_request.Tables[0].Columns.Contains("dateStart"))
                {
                    dateStart = Convert.ToDateTime(m_request.Tables[0].Rows[0]["dateStart"]).AddDays(-1);
                }

                if (m_request.Tables[0].Columns.Contains("dateEnd"))
                {
                    dateEnd = Convert.ToDateTime(m_request.Tables[0].Rows[0]["dateEnd"]).AddDays(-1);
                }
            }



            DateTime currentDate = dateStart;
            Dbconn conn = new Dbconn("BI_CustomerFlow");

            DataTable dtLog = new DataTable();
            dtLog.Columns.Add("Execute_Date");
            dtLog.Columns.Add("Result");
            dtLog.Columns.Add("Message");
            dtLog.Columns.Add("Exception");

            while (currentDate <= dateEnd)
            {
                try
                {
                    dtLog.Clear();

                    //获取FTP的数据
                    GetFTPData(currentDate);
                    conn.LockTableList.Add("T_CustomerFlow");
                    conn.BeginTransaction();

                    conn.Delete("T_CustomerFlow", "Local_Date_and_Time between '" + currentDate.ToString("yyyy-MM-dd 00:00:00.000") + "' and '" + currentDate.ToString("yyyy-MM-dd 23:59:59.999") + "' ");
                    //插入数据
                    conn.InsertBYSQLBC("T_CustomerFlow", m_dtFTP);

                    dtLog.Rows.Add(new object[] { currentDate, true, "", "" });
                    conn.Insert("Log_GetFTPData", dtLog);
                    //throw new Exception("test");
                    conn.CommitTransaction();

                }
                catch (Exception ex)
                {
                    conn.RollbackTransaction();


                    try
                    {
                        dtLog.Rows.Add(new object[] { currentDate, false, ex.Message, ex.ToString() });
                        conn.BeginTransaction();
                        conn.Insert("Log_GetFTPData", dtLog);
                        conn.CommitTransaction();

                    }
                    catch (Exception ex1)
                    {


                    }

                    try
                    {
                        AMSendWS.MsgCenter cls = new AMSendWS.MsgCenter();
                        cls.SendMsg("AM", "BI客流数据获取", "马卫清", "信息部服务中心", "BI客流数据获取:执行日期:“" + currentDate.ToString("yyyy-MM-dd") + "”时发生错误:" + ex.ToString(), DateTime.Now.AddDays(-1).ToString());
                    }
                    catch (Exception ex2)
                    {


                    }
                }

                currentDate = currentDate.AddDays(1);
            }
            return true;

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

示例11: Execute

        /// <summary>
        /// 编辑系统菜单权限
        /// </summary>
        /// <returns></returns>
        public bool Execute()
        {
            Dbconn conn = new Dbconn("MDM");

            try
            {
                string strAuthorization_ID = m_request.Tables[0].Rows[0]["Authorization_ID"].ToString();

                ArrayList listTable = new ArrayList();
                listTable.Add("MDM_System_Menu_AUZ");
                conn.BeginTransaction();
                conn.TableLock(listTable);
                string strWhere = " Authorization_ID=" + strAuthorization_ID;

                conn.Delete("MDM_System_Menu_AUZ", strWhere);

                ArrayList listMenu = new ArrayList();

                for (int i = 0; i < m_request.Tables[0].Rows.Count; i++)
                {
                    string strMenuId = m_request.Tables[0].Rows[i]["Menu_Id"].ToString();
                    if (!listMenu.Contains(strMenuId))
                    {
                        listMenu.Add(strMenuId);
                    }
                }

//                for (int i = 0; i < m_request.Tables[0].Rows.Count; i++)
//                {
//                    string strMenuId = m_request.Tables[0].Rows[i]["Menu_Id"].ToString();
//                    while (true)
//                    {
//                        if (!listMenu.Contains(strMenuId))
//                        {
//                            listMenu.Add(strMenuId);

//                            DataTable dt = conn.GetDataTable(@"
//                            SELECT DISTINCT Menu_Father_ID FROM dbo.MDM_System_Menu
//                            WHERE Menu_Id = " + strMenuId + @"
//                            AND Menu_Father_ID != 0", new string[0]);

//                            if (dt.Rows.Count == 0)
//                            {
//                                break;
//                            }
//                            if (dt.Rows[0]["Menu_Father_ID"].ToString() == strMenuId)
//                            {
//                                break;
//                            }

//                            strMenuId = dt.Rows[0]["Menu_Father_ID"].ToString();
//                        }
//                        else
//                        {
//                            break;
//                        }                       
//                    }
//                } 

                for (int i = 0; i < listMenu.Count; i++)
                {
                    DataTable dt = m_request.Tables[0].Clone();
                    DataRow dr = dt.NewRow();
                    dr["Menu_ID"] = listMenu[i];
                    dr["Authorization_ID"] = strAuthorization_ID;
                    dr["HavaFlag"] = 1;
                    dt.Rows.Add(dr);
                   
                    conn.Insert("MDM_System_Menu_AUZ", dt);
                }
                conn.CommitTransaction();
                return true;
            }
            catch
            {
                conn.RollbackTransaction();
                throw;
            }



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

示例12: SaveRows4

        /// <summary>
        /// 新建或修改人员记录
        /// </summary>
        /// <returns></returns>
        public DataSet SaveRows4(Dbconn conn, String strType)
        {
            DataSet ds_Return = 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);
            DataTable dtOptypes = dsXML.Tables["OPTYPE"];
            bool bResult = true;
            conn.BeginTransaction();
            for (int i = 0; i < dtOptypes.Rows.Count; i++)
            {
                //如果包含rowindex,就循环移除
                if (dsXML.Tables[i + 1].Columns.Contains("rowindex"))
                {
                    dsXML.Tables[i + 1].Columns.Remove("rowindex");
                }
                //如果子表解析出来的XML,类型有insert,做新增
                if (dtOptypes.Rows[i][0].ToString().ToUpper() == "INSERT")
                {
                    DataTable dt_List1 = dsXML.Tables[i + 1];
                    if (dt_List1.Rows[0]["c_oid"].ToString() == "")
                    {
                        String strOID = getUniqueKey(conn);
                        if (strOID == "")
                        {
                            dt_EditResult.Rows.Add(new object[] { false, "获取 UNIQUE_KEY失败!" }); 
                            ds_Return.Tables.Add(dt_EditResult);
                            return ds_Return; 
                        }
                        dt_List1.Rows[0]["c_oid"] = strOID;
                        dt_List1.Rows[0]["c_employeeid"] = strOID;
                    }
                    if (dt_List1.Rows[0]["c_oid_indiaccount"].ToString() == "")
                    {
                        String strOID = getUniqueKey(conn);
                        if (strOID == "")
                        {
                            dt_EditResult.Rows.Add(new object[] { false, "获取 UNIQUE_KEY失败!" });
                            ds_Return.Tables.Add(dt_EditResult);
                            return ds_Return;
                        }
                        dt_List1.Rows[0]["c_oid_indiaccount"] = strOID; 
                    } 

                    bResult = conn.Insert("B02_BILL.HR5_EMPLOYEE", dt_List1);
                }
                //如果类型包含,update,解析成表,做update
                else if (dtOptypes.Rows[i][0].ToString().ToUpper() == "UPDATE")
                {
                    DataTable dt_List2 = dsXML.Tables[i + 1];
                    if (dt_List2.Rows[0]["c_oid_indiaccount"].ToString() == "")
                    {
                        String strOID = getUniqueKey(conn);
                        if (strOID == "")
                        {
                            dt_EditResult.Rows.Add(new object[] { false, "获取 UNIQUE_KEY失败!" });
                            ds_Return.Tables.Add(dt_EditResult);
                            return ds_Return;
                        }
                        dt_List2.Rows[0]["c_oid_indiaccount"] = strOID;
                    }
                    //添加更新主键,按照GUID更新
                    ArrayList ListKey = new ArrayList();
                    ListKey.Add("hr5_id");
                    bResult = conn.Update("B02_BILL.HR5_EMPLOYEE", dt_List2, ListKey);
                }
                //如果类型包含,DELETE,解析成表,做DELETE
                else if (dtOptypes.Rows[i][0].ToString().ToUpper() == "DELETE")
                {
                    DataTable dt_List3 = dsXML.Tables[i + 1];
                    for (int k = 0; k < dt_List3.Rows.Count; k++)
                    {
                        string strID1 = dt_List3.Rows[k]["hr5_id"].ToString();
                        bResult = conn.Delete("B02_BILL.HR5_EMPLOYEE", "hr5_id=" + "'" + strID1 + "'");
                    }
                }
            }
            conn.CommitTransaction();
            if (bResult)
            {
                dt_EditResult.Rows.Add(new object[] { true, "保存成功!" });
            }
            else
            {
                dt_EditResult.Rows.Add(new object[] { false, "保存失败!" });

            }
            ds_Return.Tables.Add(dt_EditResult);
            return ds_Return;
        }
开发者ID:huaminglee,项目名称:Code,代码行数:94,代码来源:PE_OA_HR_OverTimes.cs

示例13: Execute

        public bool Execute()
        {
            string strEnv_SN = "Present";
            string strEnv_ID = "";
            Dbconn conn_EHR = new Dbconn("EHR");
            DataSet ds = conn_EHR.GetDataSet(
                @"      
                    SELECT  NULL AS VexSSONewID ,
                            t2.C_PASSWORD [App_Password],
                            t2.C_PASSWORD App_PasswordSrc,
                            t1.C_CODE App_UserName,
                            t1.C_NAME App_UserName_CN,
                            GETDATE() Chang_Password_Time ,
                            1 Checked ,
                            'system' Check_User ,
                            GETDATE() Check_Time ,
                            GETDATE() Createtime ,
                            GETDATE() Updatetime ,
                            0 AS oprationFlag
                    FROM    ehr.TB_INF_EMPLOYEE t1
                            LEFT JOIN ehr.TB_SYS_USER t2 ON t1.C_OID = t2.C_EMPLOYEEID 
                            WHERE t1.C_EMPLOYEESTATUS!=3
                     ");
            Dbconn connMDM = new Dbconn("VexSSO");

            try
            {


                ArrayList tableList = new ArrayList();
                connMDM.BeginTransaction();
                tableList.Add("MDM_System_User");
                connMDM.TableLock(tableList);

                strEnv_ID = connMDM.GetDataTableFirstValue("SELECT [Env_ID]  FROM [MDM_System_Env]  WHERE Env_SN='" + strEnv_SN + "'").ToString();
                DataTable dtMDM = connMDM.GetDataTable(@"
                                                        SELECT [App_UserID]
                                                              ,[Env_ID]
                                                              ,[VexSSONewID]
                                                              ,[App_UserName]
                                                              ,[App_Password]
                                                              ,[App_PasswordSrc]
                                                              ,[App_UserName_CN]
                                                              ,[Chang_Password_Time]
                                                              ,[Checked]
                                                              ,[Check_User]
                                                              ,[Check_Time]
                                                              ,[Createtime]
                                                              ,[Updatetime]
                                                          FROM [dbo].[MDM_System_User]
                                                          WHERE Env_ID='" + strEnv_ID + @"'");

                DataTable dtMDMUpdate = dtMDM.Clone();
                DataTable dtMDMInsert = dtMDM.Clone();
                DataTable dtMDMDelete = dtMDM.Clone();

                for (int i = 0; i < dtMDM.Rows.Count; i++)
                {
                    string strApp_UserName = dtMDM.Rows[i]["App_UserName"].ToString();

                    DataRow[] dr = ds.Tables[0].Select("App_UserName='" + strApp_UserName + "'");
                    if (dr.Length > 0)
                    {
                        dtMDM.Rows[i]["App_Password"] = dr[0]["App_Password"];
                        dtMDM.Rows[i]["App_PasswordSrc"] = dr[0]["App_PasswordSrc"];
                        dtMDM.Rows[i]["App_UserName_CN"] = dr[0]["App_UserName_CN"];

                        dtMDMUpdate.ImportRow(dtMDM.Rows[i]);
                        dr[0]["oprationFlag"] = "1";
                    }
                    else
                    {
                        dtMDMDelete.ImportRow(dtMDM.Rows[i]);
                    }
                }

                DataRow[] drInsert = ds.Tables[0].Select("oprationFlag=0");
                for (int i = 0; i < drInsert.Length; i++)
                {
                    DataRow dr = dtMDMInsert.NewRow();
                    dr["Env_ID"] = strEnv_ID;
                    dr["VexSSONewID"] = drInsert[i]["VexSSONewID"];
                    dr["App_UserName"] = drInsert[i]["App_UserName"];
                    dr["App_Password"] = drInsert[i]["App_Password"];
                    dr["App_PasswordSrc"] = drInsert[i]["App_PasswordSrc"];
                    dr["App_UserName_CN"] = drInsert[i]["App_UserName_CN"];
                    dr["Chang_Password_Time"] = drInsert[i]["Chang_Password_Time"];
                    dr["Checked"] = drInsert[i]["Checked"];
                    dr["Check_User"] = drInsert[i]["Check_User"];
                    dr["Check_Time"] = drInsert[i]["Check_Time"];
                    dr["Createtime"] = drInsert[i]["Createtime"];
                    dr["Updatetime"] = drInsert[i]["Updatetime"];
                    dtMDMInsert.Rows.Add(dr);
                }

                if (dtMDMDelete.Rows.Count > 0)
                {
                    for (int i = 0; i < dtMDMDelete.Rows.Count; i++)
                    {
                        string strWhere = "App_UserID='" + dtMDMDelete.Rows[i]["App_UserID"] + "'";
//.........这里部分代码省略.........
开发者ID:huaminglee,项目名称:Code,代码行数:101,代码来源:MDM_System_User_ExceuteGetFromEHRForPresent.cs

示例14: Execute

        public bool Execute()
        {
            string strEnv_ID = "";
            string strEnv_SN = "EP_PLMFZ";

            Dbconn conn_PLM_AS = new Dbconn("PLM_AS");
            DataSet ds = conn_PLM_AS.GetDataSet(
                @"  SELECT 
                        --44 as Env_ID,
                        null as VexSSONewID,
                        username as App_UserName,
                        RIGHT(sys.fn_VarBinToHexStr(hashbytes('MD5', convert(vARCHAR(100),PASSWORD))), 32) as App_Password,
                        PASSWORD as App_PasswordSrc,
                        userNameC as App_UserName_CN,
                        getdate() Chang_Password_Time ,
			            1 Checked ,
			            'system' Check_User ,
			            getdate() Check_Time ,
			            getdate() Createtime ,
			            getdate() Updatetime,
                        0 as oprationFlag

                   FROM PLMAss.dbo.USERINFO u 
                     ");



            Dbconn connMDM = new Dbconn("VexSSO");

            try
            {


                ArrayList tableList = new ArrayList();
                connMDM.BeginTransaction();
                tableList.Add("MDM_System_User");
                connMDM.TableLock(tableList);

                strEnv_ID = connMDM.GetDataTableFirstValue("SELECT [Env_ID]  FROM [MDM_System_Env]  WHERE Env_SN='" + strEnv_SN + "'").ToString();
                DataTable dtMDM = connMDM.GetDataTable(@"
                                                        SELECT [App_UserID]
                                                              ,[Env_ID]
                                                              ,[VexSSONewID]
                                                              ,[App_UserName]
                                                              ,[App_Password]
                                                              ,[App_PasswordSrc]
                                                              ,[App_UserName_CN]
                                                              ,[Chang_Password_Time]
                                                              ,[Checked]
                                                              ,[Check_User]
                                                              ,[Check_Time]
                                                              ,[Createtime]
                                                              ,[Updatetime]
                                                          FROM [dbo].[MDM_System_User]
                                                          WHERE Env_ID='" + strEnv_ID + @"'
                                                        ");


                DataTable dtMDMUpdate = dtMDM.Clone();
                DataTable dtMDMInsert = dtMDM.Clone();
                DataTable dtMDMDelete = dtMDM.Clone();

                for (int i = 0; i < dtMDM.Rows.Count; i++)
                {
                    string strApp_UserName = dtMDM.Rows[i]["App_UserName"].ToString();

                    DataRow[] dr = ds.Tables[0].Select("App_UserName='" + strApp_UserName + "'");
                    if (dr.Length > 0)
                    {
                        dtMDM.Rows[i]["App_Password"] = dr[0]["App_Password"];
                        dtMDM.Rows[i]["App_PasswordSrc"] = dr[0]["App_PasswordSrc"];
                        dtMDM.Rows[i]["App_UserName_CN"] = dr[0]["App_UserName_CN"];

                        dtMDMUpdate.ImportRow(dtMDM.Rows[i]);
                        dr[0]["oprationFlag"] = "1";
                    }
                    else
                    {
                        dtMDMDelete.ImportRow(dtMDM.Rows[i]);
                    }
                }

                DataRow[] drInsert = ds.Tables[0].Select("oprationFlag=0");
                for (int i = 0; i < drInsert.Length; i++)
                {
                    DataRow dr = dtMDMInsert.NewRow();
                    dr["Env_ID"] = strEnv_ID;
                    dr["VexSSONewID"] = drInsert[i]["VexSSONewID"];
                    dr["App_UserName"] = drInsert[i]["App_UserName"];
                    dr["App_Password"] = drInsert[i]["App_Password"];
                    dr["App_PasswordSrc"] = drInsert[i]["App_PasswordSrc"];
                    dr["App_UserName_CN"] = drInsert[i]["App_UserName_CN"];
                    dr["Chang_Password_Time"] = drInsert[i]["Chang_Password_Time"];
                    dr["Checked"] = drInsert[i]["Checked"];
                    dr["Check_User"] = drInsert[i]["Check_User"];
                    dr["Check_Time"] = drInsert[i]["Check_Time"];
                    dr["Createtime"] = drInsert[i]["Createtime"];
                    dr["Updatetime"] = drInsert[i]["Updatetime"];
                    dtMDMInsert.Rows.Add(dr);
                }
//.........这里部分代码省略.........
开发者ID:huaminglee,项目名称:Code,代码行数:101,代码来源:MDM_System_User_ExceuteGetFromPLM.cs

示例15: SetCalendar

        /// <summary>
        /// 新建或修改日历记录
        /// </summary>
        /// <returns></returns>
        public DataSet SetCalendar(Dbconn conn, String strType)
        {
            DataSet ds_Return = 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]["dail_id"].ToString();
            DataTable dt_List = dsXML.Tables["LIST"];
            if (strID == "")
            {
                throw new Exception("数据异常,缺少主键,请联系管理员!");
            }

            bool bResult = false;
            if (strType == "New") //新建
            {
                conn.BeginTransaction();
                bResult = conn.Insert("[B01_MDM].[DAIL_DailyManage]", dt_List);
                conn.CommitTransaction();
            }
            else if (strType == "Upd") //修改
            {
                conn.BeginTransaction();
                bResult = conn.Update("[B01_MDM].[DAIL_DailyManage]", dt_List, "dail_id='" + strID + "'");
                conn.CommitTransaction();
            }
            else if (strType == "Del") //删除
            {
                conn.BeginTransaction();
                bResult = conn.Delete("[B01_MDM].[DAIL_DailyManage]", "dail_id='" + strID + "'");
                conn.CommitTransaction();
            }

            if (bResult)
            {
                dt_EditResult.Rows.Add(new object[] { true, "保存成功!" });
            }
            else
            {
                dt_EditResult.Rows.Add(new object[] { false, "保存失败!" });

            }
            ds_Return.Tables.Add(dt_EditResult);
            return ds_Return;
        }
开发者ID:huaminglee,项目名称:Code,代码行数:51,代码来源:PE_OA_Calendar.cs


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