EtongFlyChou.cs
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:135k
源码类别:

.net编程

开发平台:

C#

  1.             {
  2.                 MSDA.Open();
  3.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  4.             }
  5.             catch (Exception ex)
  6.             {
  7.                 throw ex;
  8.             }
  9.             finally
  10.             {
  11.                 MSDA.Close();
  12.             }
  13.             return dv;
  14.         }
  15.         //项目查询依据项目代码
  16.         public DataView PrjQureyData()
  17.         {
  18.             DataView dv = new DataView();
  19.             string strSQL;
  20.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  21.             strSQL = "select * from tb_Project where ProjectID=" + this.m_pID;
  22.             try
  23.             {
  24.                 MSDA.Open();
  25.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  26.             }
  27.             catch (Exception ex)
  28.             {
  29.                 throw ex;
  30.             }
  31.             finally
  32.             {
  33.                 MSDA.Close();
  34.             }
  35.             return dv;
  36.         }
  37.         //项目日志                               
  38.         public DataView LogQuery()
  39.         {
  40.             string strSQL;
  41.             DataView dv = new DataView();
  42.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  43.             strSQL = "select * from tb_Project_Log where ProjectID=" + this.m_pID;
  44.             try
  45.             {
  46.                 MSDA.Open();
  47.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  48.             }
  49.             catch (Exception ex)
  50.             {
  51.                 throw ex;
  52.             }
  53.             finally
  54.             {
  55.                 MSDA.Close();
  56.             }
  57.             return dv;
  58.         }
  59.         //项目日志新建
  60.         public void LogInsert()
  61.         {
  62.             string strSQL;
  63.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  64.             strSQL = "insert into tb_Project_Log values('" + this.m_lWriter + "','" + this.m_lDate + "','"
  65.                 + this.m_lInfo + "'," + this.m_pID;
  66.             MSDA.Open();
  67.             SqlTransaction tran = MSDA.BeginTransaction();
  68.             try
  69.             {
  70.                 MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  71.                 tran.Commit();
  72.             }
  73.             catch (Exception ex)
  74.             {
  75.                 tran.Rollback();
  76.                 throw ex;
  77.             }
  78.             finally
  79.             {
  80.                 MSDA.Close();
  81.             }
  82.         }
  83.         //已办工作查询
  84.         public DataView PrjQureyAlreadyDo()
  85.         {
  86.             string strSQL;
  87.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  88.             QueryParameterCollection Params = new QueryParameterCollection();
  89.             DataView dv = new DataView();
  90.             strSQL = "P_ZFGetAlreadyDo";
  91.             Params.Clear();
  92.             Params.Add("@Param_User", this.m_sUser);
  93.             try
  94.             {
  95.                 MSDA.Open();
  96.                 dv = MSDA.ExecuteDataView(CommandType.StoredProcedure, strSQL, Params);
  97.             }
  98.             catch (Exception ex)
  99.             {
  100.                 throw ex;
  101.             }
  102.             finally
  103.             {
  104.                 MSDA.Close();
  105.             }
  106.             return dv;
  107.         }
  108.         //工作流权限
  109.         public DataView PrjGetPermission()
  110.         {
  111.             int err =-1;
  112.             string strSQL = "select OpID from Tb_Sys_EmpOpRole where EmpID=" + this.m_EmpID;
  113.             DataView dv = new DataView();
  114.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  115.             try 
  116.             {
  117.                 MSDA.Open();
  118.                 dv = MSDA.ExecuteDataView(CommandType.Text,strSQL,null);
  119.             }
  120.             catch (Exception ex)
  121.             {
  122.                 err =1;
  123.                 throw ex;
  124.             }
  125.             finally 
  126.             {
  127.                 MSDA.Close();
  128.             }
  129.             if (err ==1) return null;
  130.             ArrayList al = new ArrayList();
  131.             for (int i = 0; i < dv.Table.Rows.Count; i++)
  132.             {
  133.                 DataView dv2 = new DataView();
  134.                 try
  135.                 {
  136.                     strSQL = "select PermID from tb_Op_Role where OpID=" + Convert.ToInt32(dv.Table.Rows[i]["OpID"]);
  137.                     MSDA.Open();
  138.                     dv2 = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  139.                     for (int j = 0; j < dv2.Table.Rows.Count; j++)
  140.                     {
  141.                         int s=0;
  142.                         for (int k = 0; k < al.Count; k++)
  143.                         {
  144.                             if (dv2.Table.Rows[j]["PermID"].ToString().Trim() == al[k].ToString()) s = 1;
  145.                         }
  146.                         if (s == 0) al.Add(dv2.Table.Rows[j]["PermID"].ToString());
  147.                     }
  148.                 }
  149.                 catch (Exception ex)
  150.                 {
  151.                     err = 1;
  152.                     throw ex;
  153.                 }
  154.                 finally
  155.                 {
  156.                     MSDA.Close();
  157.                 }
  158.                 if (err==1)return null;
  159.             }
  160.             DataView dv1 = new DataView();
  161.             if (al.Count > 0)
  162.             {
  163.                 try
  164.                 {
  165.                     MSDA.Open();
  166.                     string stral = "";
  167.                     for (int x = 0; x < al.Count; x++)
  168.                     {
  169.                         if (x == 0) stral = stral + al[x].ToString();
  170.                         else stral = stral + "," + al[x].ToString();
  171.                     }
  172.                     strSQL = "select PermID,DefaultPage,DisplayName from Tb_Sys_Permission where PermID in (" + stral + ")";
  173.                     dv1 = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  174.                     //for (int x = 0; x < al.Count; x++)
  175.                     //{
  176.                     //    strSQL = "select DefaultPage,DisplayName from Tb_Sys_Permission where PermID=" + Convert.ToInt32(al[x]);
  177.                     //    if (x == 0) dv1 = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  178.                     //    else
  179.                     //    {
  180.                     //        DataSet ds = new DataSet();
  181.                     //        dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  182.                     //        DataRow rows;
  183.                     //        rows = dv1.Table.NewRow();
  184.                     //        rows.ItemArray = dv.Table.Rows[0].ItemArray;
  185.                     //        dv1.Table.Rows.Add(rows);
  186.                     //        //dv1.Table.Rows[dv1.Table.Rows.Count -1]["DefaultPage"]
  187.                     //    }
  188.                     //}
  189.                 }
  190.                 catch (Exception ex)
  191.                 {
  192.                     throw ex;
  193.                 }
  194.                 finally
  195.                 {
  196.                     MSDA.Close();
  197.                 }
  198.             }
  199.             return dv1;
  200.         }
  201.         //工作流下一级的业务角色
  202.         public void PrjGetOpRole()
  203.         {
  204.             int err = -1;
  205.             if (this.m_Must != "0")
  206.             {
  207.                 try
  208.                 {
  209.                     this.PrjGetEmpType();
  210.                 }
  211.                 catch (Exception ex)
  212.                 {
  213.                     err = 1;
  214.                     throw ex;
  215.                 }
  216.                 if (err == 1) return;
  217.             }
  218.             try
  219.             {
  220.                 this.PrjGetOrgCID();
  221.             }
  222.             catch (Exception ex)
  223.             {
  224.                 err = 1;
  225.                 throw ex;
  226.             }
  227.             if (err == 1) return;
  228.             string strSQL = "select NDeptID from tb_Task_Role where MustChooseItem='" + this.m_Must +
  229.                 "' and ODeptID=" + this.m_DeptID + " and EmpType=" + this.m_EmpType + " and CID='" +
  230.                 this.m_cDID + "' and Prj=" + this.m_Psort;
  231.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  232.             DataView dv = new DataView();
  233.             try
  234.             {
  235.                 MSDA.Open();
  236.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  237.             }
  238.             catch (Exception ex)
  239.             {
  240.                 err = 1;
  241.                 throw ex;
  242.             }
  243.             finally
  244.             {
  245.                 MSDA.Close();
  246.             }
  247.             if (err == 1) return;
  248.             if (dv.Table.Rows.Count != 1) { this.Ndept = -1; return; }  //未找到
  249.             this.Ndept = Convert.ToInt32(dv.Table.Rows[0]["NDeptID"]);
  250.             
  251.         }
  252.         public void PrjGetEmpType()
  253.         {
  254.             int err=-1;
  255.             int iEmpType;
  256.             string strSQL= "select EmpType from Tb_Sys_Employee where EmpID=" + this.m_EmpID;
  257.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  258.             DataView dv = new DataView();
  259.             try
  260.             {
  261.                 MSDA.Open();
  262.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  263.             }
  264.             catch (Exception ex)
  265.             {
  266.                 err = 1;
  267.                 throw ex;
  268.             }
  269.             finally
  270.             {
  271.                 MSDA.Close();
  272.             }
  273.             if (err == 1) return;        
  274.             if (dv.Table.Rows.Count != 1) return;
  275.             //iEmpType = Convert.ToInt32(dv.Table.Rows[0]["EmpType"]);
  276.             this.EmpType = Convert.ToInt32(dv.Table.Rows[0]["EmpType"]);
  277.         }
  278.         public void PrjGetOrgCID()
  279.         {
  280.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  281.             DataView dv = new DataView();
  282.             int err = -1;
  283.             string strSQL = "select OrgLevel,OrgcID,ParentOrgID from Tb_Sys_Organization where OrgID=" + this.m_DeptID;
  284.             try
  285.             {
  286.                 MSDA.Open();
  287.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  288.             }
  289.             catch (Exception ex)
  290.             {
  291.                 err = 1;
  292.                 throw ex;
  293.             }
  294.             finally
  295.             {
  296.                 MSDA.Close();
  297.             }
  298.             if (err == 1) return;
  299.             if (dv.Table.Rows.Count != 1) return;
  300.             int iLevel, iPID;
  301.             string sCID;
  302.             iLevel = Convert.ToInt32(dv.Table.Rows[0]["OrgLevel"]);
  303.             if (iLevel <= 2) sCID = dv.Table.Rows[0]["OrgcID"].ToString();
  304.             else
  305.             {
  306.                 iPID = Convert.ToInt32(dv.Table.Rows[0]["ParentOrgID"]);
  307.                 strSQL = "select OrgcID from Tb_Sys_Organization where OrgID=" + iPID;
  308.                 try
  309.                 {
  310.                     MSDA.Open();
  311.                     dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  312.                 }
  313.                 catch (Exception ex)
  314.                 {
  315.                     err = 1;
  316.                     throw ex;
  317.                 }
  318.                 finally
  319.                 {
  320.                     MSDA.Close();
  321.                 }
  322.                 if (err == 1) return;
  323.                 if (dv.Table.Rows.Count != 1) return;
  324.                 sCID = dv.Table.Rows[0]["OrgcID"].ToString();
  325.             }
  326.             this.CdID = sCID;
  327.         }
  328.         public void PrjUpdateActStatus()
  329.         {
  330.             string strSQL = "update tb_wf_actins set status=0 where ActinsID=" + this.m_sID ;
  331.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  332.             MSDA.Open();
  333.             SqlTransaction tran = MSDA.BeginTransaction();
  334.             try
  335.             {
  336.                 MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  337.                 tran.Commit();
  338.             }
  339.             catch (Exception ex)
  340.             {
  341.                 tran.Rollback();
  342.                 throw ex;
  343.             }
  344.             finally
  345.             {
  346.                 MSDA.Close();
  347.             }
  348.         }
  349.         //获取所有的业务角色
  350.         public DataView GetAllOpRole()
  351.         {
  352.             DataView dv = new DataView();
  353.             string strSQL = "select * from Tb_Sys_OpRole";
  354.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  355.             try
  356.             {
  357.                 MSDA.Open();
  358.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  359.             }
  360.             catch (Exception ex)
  361.             {
  362.                 throw ex;
  363.             }
  364.             finally
  365.             {
  366.                 MSDA.Close();
  367.             }
  368.             return dv;
  369.         }
  370.         //获取指定职工的业务角色
  371.         public DataView GetAssignOpRole()
  372.         {
  373.             string strSQL = "select * from Tb_Sys_EmpOpRole where EmpID=" + this.m_EmpID;
  374.             DataView dv = new DataView();
  375.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  376.             try
  377.             {
  378.                 MSDA.Open();
  379.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  380.             }
  381.             catch (Exception ex)
  382.             {
  383.                 throw ex;
  384.             }
  385.             finally
  386.             {
  387.                 MSDA.Close();
  388.             }
  389.             return dv;
  390.         }
  391.         //获取指定工作流的业务角色
  392.         public DataView GetWFAssignOpRole()
  393.         {
  394.             string strSQL = "select * from Tb_WF_OpRole where WFID=" + this.m_wID ;
  395.             DataView dv = new DataView();
  396.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  397.             try
  398.             {
  399.                 MSDA.Open();
  400.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  401.             }
  402.             catch (Exception ex)
  403.             {
  404.                 throw ex;
  405.             }
  406.             finally
  407.             {
  408.                 MSDA.Close();
  409.             }
  410.             return dv;
  411.         }
  412.         //获取指定业务角色的名称
  413.         public void GetOpName()
  414.         {
  415.             string strSQL = "select OpName from Tb_Sys_OpRole where OpID=" + this.m_OpID;
  416.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  417.             DataView dv = new DataView();
  418.             try
  419.             {
  420.                 MSDA.Open();
  421.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  422.                 if (dv.Table.Rows.Count > 0)
  423.                     this.m_OpName = dv.Table.Rows[0]["OpName"].ToString();
  424.             }
  425.             catch (Exception ex)
  426.             {
  427.                 throw ex;
  428.             }
  429.             finally
  430.             {
  431.                 MSDA.Close();
  432.             }
  433.         }
  434.         //获取指定业务角色权限
  435.         public DataView GetOpPerm()
  436.         {
  437.             DataView dv = new DataView();
  438.             string strSQL = "select PermID from tb_Op_Role where OpID=" + this.OpID;
  439.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  440.             try
  441.             {
  442.                 MSDA.Open();
  443.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  444.             }
  445.             catch (Exception ex)
  446.             {
  447.                 throw ex;
  448.             }
  449.             finally
  450.             {
  451.                 MSDA.Close();
  452.             }
  453.             return dv;
  454.         }
  455.         //获取所有业务权限
  456.         public DataView GetOpPermAll()
  457.         {
  458.             DataView dv = new DataView();
  459.             string strSQL = "select PermID,DisplayName from Tb_Sys_Permission where ParentresCode='2'";
  460.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  461.             try
  462.             {
  463.                 MSDA.Open();
  464.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  465.             }
  466.             catch (Exception ex)
  467.             {
  468.                 throw ex;
  469.             }
  470.             finally
  471.             {
  472.                 MSDA.Close();
  473.             }
  474.             return dv;
  475.         }
  476.         //获取指定业务角色
  477.         public DataView GetOpRoleByOp()
  478.         {
  479.             string strSQL = "select * from Tb_Sys_OpRole where OpID=" + this.m_OpID;
  480.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  481.             DataView dv = new DataView();
  482.             try
  483.             {
  484.                 MSDA.Open();
  485.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  486.             }
  487.             catch (Exception ex)
  488.             {
  489.                 throw ex;
  490.             }
  491.             finally
  492.             {
  493.                 MSDA.Close();
  494.             }
  495.             return dv;
  496.         }
  497.         //更新业务角色和权限
  498.         public void UpOpPerm()
  499.         {
  500.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  501.             string strSQL = "update Tb_Sys_OpRole set OpName='" + this.m_OpName + "',OrgDesc='" + this.m_OpDesc + "' where OpID=" + this.m_OpID;
  502.             MSDA.Open();
  503.             SqlTransaction tran = MSDA.BeginTransaction();
  504.             try
  505.             {
  506.                 MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  507.                 strSQL = "delete from tb_Op_Role where OpID=" + this.m_OpID;
  508.                 MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  509.                 for (int i = 0; i < this.m_OpPerm.Count; i++)
  510.                 {
  511.                     strSQL = "insert into tb_Op_Role values(" + this.m_OpID + "," + Convert.ToInt32(this.m_OpPerm[i]) + ")";
  512.                     MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  513.                 }
  514.                 tran.Commit();
  515.             }
  516.             catch (Exception ex)
  517.             {
  518.                 tran.Rollback();
  519.                 throw ex;
  520.             }
  521.             finally
  522.             {
  523.                 MSDA.Close();
  524.             }
  525.         }
  526.         //查询业务角色
  527.         public DataView CheckOpByCondition()
  528.         {
  529.             string strSQL = "select * from Tb_Sys_OpRole";
  530.             if (this.m_OpID > 0)
  531.             {
  532.                 strSQL = strSQL + " where OpID=" + this.m_OpID;
  533.             }
  534.             if (this.m_OpName == null || this.m_OpName == "") ;
  535.             else 
  536.             {
  537.                 strSQL = strSQL + " where OpName='" + this.m_OpName + "'";
  538.             }
  539.             DataView dv = new DataView();
  540.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  541.             try
  542.             {
  543.                 MSDA.Open();
  544.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  545.             }
  546.             catch (Exception ex)
  547.             {
  548.                 throw ex;
  549.             }
  550.             finally
  551.             {
  552.                 MSDA.Close();
  553.             }
  554.             return dv;
  555.         }
  556.     }
  557.     //工作流
  558.     public class EtongFlyChouWFNTask
  559.     {
  560.         private int m_pID;                                  //ParentActID          TB_CONOLY_USER
  561.         private int m_tID;                                  //ActivityID
  562.         private ArrayList m_rID;                            //RoleID
  563.         private string m_tUnit;                             //Unit                  TB_WF_ACTIVITY
  564.         private string m_tName;                             //ActName
  565.         private int m_tWFID;                                //WorkFlowID
  566.         private int m_tPageID;                              //PageID
  567.         private int m_tStart;                               //StartEnd
  568.         private int m_tBlock;                               //BlockFlag
  569.         private int m_tShunt;                               //ShuntFlag
  570.         private int m_tMode;                                //ModeFlag
  571.         private string m_wDesc;                             //WFDesc                TB_WORKFOLW
  572.         private string m_wName;                             //WFName
  573.         private int m_wStatus;                              //Status
  574.         private int m_wStart;                               //StartUpType
  575.         private string m_wUnit;                             //Unit
  576.         private int m_wKind;                                //KindID
  577.         private string m_wStDesc;                           //StartDesc
  578.         private int m_wStID;                                //StartRouterID
  579.         private int m_iID;                                  //WFInstanceID          TB_WF_INSTANCE
  580.         private int m_iUser;                                //CreateUserID
  581.         private int m_iRole;                                //TargetRoleID
  582.         private int m_iStatus;                              //Status
  583.         private DateTime m_iEnd;                            //TheoryEndDate
  584.         private int m_iPrjID;                               //PrjID
  585.         private int m_aID;                                  //ActInsID              TB_WF_ACTINS
  586.         private DateTime m_aCreate;                         //CreateDate
  587.         private DateTime m_aReal;                           //RealEndDate
  588.         private int m_aStatus;                              //Status
  589.         private DateTime m_aTheory;                         //TheoryEndDate
  590.         private string m_aBlock;                            //BlockReason
  591.         private int m_aUser;                                //UserID
  592.         private int m_aRole;                                //RoleID
  593.         
  594.         
  595.         //上一级活动代码
  596.         public int TaskPID
  597.         {
  598.             set { m_pID = value; }
  599.             get { return m_pID; }
  600.         }
  601.         //流程活动代码
  602.         public int TaskID
  603.         {
  604.             set { m_tID = value; }
  605.             get { return m_tID; }
  606.         }
  607.         //用户列表
  608.         public ArrayList RolesID
  609.         {
  610.             set { m_rID = value; }
  611.             get { return m_rID; }
  612.         }
  613.         //流程活动单位
  614.         public string TaskUnit
  615.         {
  616.             set { m_tUnit = value; }
  617.             get { return m_tUnit; }
  618.         }
  619.         //流程活动名
  620.         public string TaskName
  621.         {
  622.             set { m_tName = value; }
  623.             get { return m_tName; }
  624.         }
  625.         //流程活动工作流代码
  626.         public int TaskWFID
  627.         {
  628.             set { m_tWFID = value; }
  629.             get { return m_tWFID; }
  630.         }
  631.         //流程活动页面代码
  632.         public int TaskPage
  633.         {
  634.             set { m_tPageID = value; }
  635.             get { return m_tPageID; }
  636.         }
  637.         //流程活动任务标志
  638.         public int TaskStart
  639.         {
  640.             set { m_tStart = value; }
  641.             get { return m_tStart; }
  642.         }
  643.         //流程活动阻塞标志
  644.         public int TaskBlock
  645.         {
  646.             set { m_tBlock = value; }
  647.             get { return m_tBlock; }
  648.         }
  649.         //流程活动分流
  650.         public int TaskShunt
  651.         {
  652.             set { m_tShunt = value; }
  653.             get { return m_tShunt; }
  654.         }
  655.         //流程活动工作方式
  656.         public int TaskMode
  657.         {
  658.             set { m_tMode = value; }
  659.             get { return m_tMode; }
  660.         }
  661.         //工作流描述
  662.         public string TaskWDecs
  663.         {
  664.             set { m_wDesc = value; }
  665.             get { return m_wDesc; }
  666.         }
  667.         //工作流名称
  668.         public string TaskWName
  669.         {
  670.             set { m_wName = value; }
  671.             get { return m_wName; }
  672.         }
  673.         //工作流状态
  674.         public int TaskWStatus
  675.         {
  676.             set { m_wStatus = value; }
  677.             get { return m_wStatus; }
  678.         }
  679.         //工作流启动类型
  680.         public int TaskWStart
  681.         {
  682.             set { m_wStart = value; }
  683.             get { return m_wStart; }
  684.         }
  685.         //工作流使用单位
  686.         public string TaskWUnit
  687.         {
  688.             set { m_wUnit = value; }
  689.             get { return m_wUnit; }
  690.         }
  691.         //工作流种类
  692.         public int TaskWKind
  693.         {
  694.             set { m_wKind = value; }
  695.             get { return m_wKind; }
  696.         }
  697.         //工作流关联表
  698.         public string TaskWStDesc
  699.         {
  700.             set { m_wStDesc = value; }
  701.             get { return m_wStDesc; }
  702.         }
  703.         //工作流任务启动位置
  704.         public int TaskWStID
  705.         {
  706.             set { m_wStID = value; }
  707.             get { return m_wStID; }
  708.         }
  709.         //工作流实例代码
  710.         public int TaskIID
  711.         {
  712.             set { m_iID = value; }
  713.             get { return m_iID; }
  714.         }
  715.         //工作流实例接受者用户代码
  716.         public int TaskIUser
  717.         {
  718.             set { m_iUser = value; }
  719.             get { return m_iUser; }
  720.         }
  721.         //工作流实例接受者角色代码
  722.         public int TaskIRole
  723.         {
  724.             set { m_iRole = value; }
  725.             get { return m_iRole; }
  726.         }
  727.         //工作流实例状态
  728.         public int TaskIStatus
  729.         {
  730.             set { m_iStatus = value; }
  731.             get { return m_iStatus; }
  732.         }
  733.         //工作流实例计划结束时间
  734.         public DateTime TaskIEnd
  735.         {
  736.             set { m_iEnd = value; }
  737.             get { return m_iEnd; }
  738.         }
  739.         //工作流实例项目代码
  740.         public int TaskIPrj
  741.         {
  742.             set { m_iPrjID = value; }
  743.             get { return m_iPrjID; }
  744.         }
  745.         //工作流活动实例
  746.         public int TaskIAID
  747.         {
  748.             set { m_aID = value; }
  749.             get { return m_aID; }
  750.         }
  751.         //工作流活动实例创建时间
  752.         public DateTime TaskACreate
  753.         {
  754.             set { m_aCreate = value; }
  755.             get { return m_aCreate; }
  756.         }
  757.         //工作流活动实例实际结束时间
  758.         public DateTime TaskAReal
  759.         {
  760.             set { m_aReal = value; }
  761.             get { return m_aReal; }
  762.         }
  763.         //工作流活动实例状态
  764.         public int TaskAStatus
  765.         {
  766.             set { m_aStatus = value; }
  767.             get { return m_aStatus; }
  768.         }
  769.         //工作流活动实例计划完成时间
  770.         public DateTime TaskATheory
  771.         {
  772.             set { m_aTheory = value; }
  773.             get { return m_aTheory; }
  774.         }
  775.         //工作流活动实例耽误原因
  776.         public string TaskABlock
  777.         {
  778.             set { m_aBlock = value; }
  779.             get { return m_aBlock; }
  780.         }
  781.         //工作流活动实例受理用户
  782.         public int TaskAUser
  783.         {
  784.             set { m_aUser = value; }
  785.             get { return m_aUser; }
  786.         }
  787.         //工作流活动实例受理角色
  788.         public int TaskARole
  789.         {
  790.             set { m_aRole = value; }
  791.             get { return m_aRole; }
  792.         }
  793.         //创建新任务
  794.         public EtongFlyChouWFNTask CreateNewTask()
  795.         {
  796.             return new EtongFlyChouWFNTask();
  797.         }
  798.         //删除工作流
  799.         public void WFDelete()
  800.         {
  801.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  802.             string strSQL;
  803.             strSQL = "delete from tb_WorkFlow where WFID=" + this.m_tWFID;
  804.             try
  805.             {
  806.                 MSDA.Open();
  807.                 MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  808.             }
  809.             catch (Exception ex)
  810.             {
  811.                 throw ex;
  812.             }
  813.             finally
  814.             {
  815.                 MSDA.Close();
  816.             }
  817.         }
  818.         //是否能删除该工作流
  819.         public bool IsCanWFDelete()
  820.         {
  821.             MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  822.             string strSQL;
  823.             bool result = true;
  824.             strSQL = "select count(*) as iNum from tb_WF_Activity where WorkFlowID=" + this.m_tWFID;
  825.             try
  826.             {
  827.                 MSDA.Open();
  828.                 SqlDataReader dr = MSDA.ExecuteReader(CommandType.Text, strSQL, null);
  829.                 if (dr.Read() == true)
  830.                 {
  831.                     if (Convert.ToInt32(dr["iNum"]) > 0) result = false;
  832.                 }
  833.                 dr.Close();
  834.             }
  835.             finally
  836.             {
  837.                 MSDA.Close();
  838.             }
  839.             return result;
  840.         }
  841.         
  842.     }
  843.     public class EtongFlyChouWFNM
  844.     {
  845.         private int m_ID;                      //CommID
  846.         private string m_Name;                 //CommName
  847.         private decimal m_Bud;                  //BudGetPrice
  848.         private decimal m_Diff;                 //DifferencePrice
  849.         private decimal m_DiffSum;              //DifferencePriceSum   Price
  850.         private decimal m_Mark;                 //MarketPrice
  851.         private string m_Size;                  //MeterialSize
  852.         private int m_Num;                      //Number
  853.         private string m_Unit;                  //UnitName  Memo
  854.         private int m_Prj;                      //ProjectID
  855.         private int m_wz;                       //WZID
  856.         private int m_UserID;                   //uSERID
  857.         private string m_UserName;              //UserName
  858.         private string m_Exp;                   //Explain
  859.         private string m_Field;                 //字段
  860.         private string m_Table;                 //表名
  861.         private string m_Condition;             //条件
  862.         private Int16 m_sstatus;                  //sstatus
  863.         private Int16 m_status;                   //status
  864.         //CommID
  865.         public int CommID
  866.         {
  867.             set { m_ID = value; }
  868.             get { return m_ID; }
  869.         }
  870.         public string CommName
  871.         {
  872.             set {m_Name =value;}
  873.             get { return m_Name; }
  874.         }
  875.         public decimal Bud
  876.         {
  877.             set { m_Bud = value; }
  878.             get { return m_Bud; }
  879.         }
  880.         public decimal Diff
  881.         {
  882.             set { m_Diff = value; }
  883.             get { return m_Diff; }
  884.         }
  885.         public decimal DiffSum
  886.         {
  887.             set { m_DiffSum = value; }
  888.             get { return m_DiffSum; }
  889.         }
  890.         public decimal Mark
  891.         {
  892.             set { m_Mark = value; }
  893.             get { return m_Mark; }
  894.         }
  895.         public string CommSize
  896.         {
  897.             set {m_Size =value;}
  898.             get {return m_Size;}
  899.         }
  900.         public int Num
  901.         {
  902.             set { m_Num = value; }
  903.             get { return m_Num; }
  904.         }
  905.         public string Unit
  906.         {
  907.             set { m_Unit = value; }
  908.             get { return m_Unit; }
  909.         }
  910.         public int Prj
  911.         {
  912.             set { m_Prj = value; }
  913.             get { return m_Prj; }
  914.         }
  915.         public int WZ
  916.         {
  917.             set { m_wz = value; }
  918.             get { return m_wz; }
  919.         }
  920.         public int UserID
  921.         {
  922.             set { m_UserID = value; }
  923.             get { return m_UserID; }
  924.         }
  925.         public string UserName
  926.         {
  927.             set { m_UserName = value; }
  928.             get { return m_UserName; }
  929.         }
  930.         public string Explain
  931.         {
  932.             set { m_Exp = value; }
  933.             get { return m_Exp; }
  934.         }
  935.         public string Filed
  936.         {
  937.             set { m_Field = value; }
  938.             get { return m_Field; }
  939.         }
  940.         public string Table
  941.         {
  942.             set { m_Table = value; }
  943.             get { return m_Table; }
  944.         }
  945.         public string Condition
  946.         {
  947.             set { m_Condition = value; }
  948.             get { return m_Condition; }
  949.         }
  950.         public Int16 sstatus
  951.         {
  952.             set { m_sstatus = value; }
  953.             get { return m_sstatus; }
  954.         }
  955.         public Int16 status
  956.         {
  957.             set { m_status = value; }
  958.             get { return m_status; }
  959.         }
  960.         private QueryParameterCollection Params = new QueryParameterCollection();
  961.         private MSSqlDataAccess MSDA2 = new MSSqlDataAccess(2);
  962.         private MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  963.         
  964.         /// <summary>
  965.         /// 获取待办事宜等
  966.         /// 1、待办;2、其他
  967.         /// </summary>
  968.         /// <param name="iUserID">用户ID</param>
  969.         /// <param name="iStatus">工作状态</param>
  970.         /// <returns>DataView工作流的事宜信息</returns>
  971.         public DataView GetWaitList(int iFlag,int iUserID,int iDept,int iStatus0,int iStatus2)
  972.         {
  973.             Params.Clear();
  974.             Params.Add("@Param_UserIDflag", iFlag);
  975.             Params.Add("@Param_UserID", iUserID);
  976.             Params.Add("@Param_DeptID", iDept);
  977.             Params.Add("@Param_Status0", iStatus0);
  978.             Params.Add("@Param_Status2", iStatus2);
  979.             DataView dv = new DataView();
  980.             string strSQL = "P_GetWaitList";
  981.             MSDA.Open();
  982.             dv = MSDA.ExecuteDataView(CommandType.StoredProcedure,strSQL,Params);
  983.             MSDA.Close();
  984.             return dv;
  985.         }
  986.         
  987.         /// <summary>
  988.         /// 获取物资代码大类
  989.         /// </summary>
  990.         /// <returns>所有的物资代码</returns>
  991.         public DataView GetBigWZList()
  992.         {
  993.             string strSQL = "select wz_code1,wz_code2,wz_namecode2 from wz_code2";
  994.             DataView dv = new DataView();
  995.             try
  996.             {
  997.                 MSDA2.Open();
  998.                 dv = MSDA2.ExecuteDataView(CommandType.Text, strSQL, null);
  999.             }
  1000.             catch
  1001.             {
  1002.             }
  1003.             finally
  1004.             {
  1005.                 MSDA2.Close();
  1006.             }
  1007.             return dv;
  1008.         }
  1009.         /// <summary>
  1010.         /// 设备费
  1011.         /// </summary>
  1012.         public DataView ProEquGetDataByPrj()
  1013.         {
  1014.             string strSQL = "select * from tb_Project_Equipment where ProjectID=" + this.m_Prj + " order by wz_id";
  1015.             MSDA.Open();
  1016.             DataView dv = new DataView();
  1017.             try
  1018.             {
  1019.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  1020.             }
  1021.             catch (Exception ex)
  1022.             {
  1023.                 throw ex;
  1024.             }
  1025.             finally
  1026.             {
  1027.                 MSDA.Close();
  1028.             }
  1029.             return dv;
  1030.         }
  1031.         public DataView ProEquGetData()
  1032.         {
  1033.             string strSQL = "select * from tb_Project_Equipment where ProjectID=" +
  1034.                 this.m_Prj + " and sstatus=" + this.m_sstatus + " order by wz_id";
  1035.             MSDA.Open();
  1036.             DataView dv = new DataView();
  1037.             try
  1038.             {
  1039.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  1040.             }
  1041.             catch (Exception ex)
  1042.             {
  1043.                 throw ex;
  1044.             }
  1045.             finally
  1046.             {
  1047.                 MSDA.Close();
  1048.             }
  1049.             return dv;
  1050.         }
  1051.         public DataView ProEquGetDataByEqu()
  1052.         {
  1053.             string strSQL = "select * from tb_Project_Equipment where EquipmentID=" + this.CommID + " and sstatus=" + this.m_sstatus;
  1054.             MSDA.Open();
  1055.             DataView dv = new DataView();
  1056.             try
  1057.             {
  1058.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  1059.             }
  1060.             catch (Exception ex)
  1061.             {
  1062.                 throw ex;
  1063.             }
  1064.             finally
  1065.             {
  1066.                 MSDA.Close();
  1067.             }
  1068.             return dv;
  1069.         }
  1070.         public int ProEquInsert()
  1071.         {
  1072.             int err = -1;
  1073.             string strSQL = "select * from tb_Project_Equipment where ProjectID=" +
  1074.                 this.m_Prj + " and wz_id=" + this.m_wz + " and sstatus=1";
  1075.             MSDA.Open();
  1076.             DataView dv = new DataView();
  1077.             try
  1078.             {
  1079.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  1080.             }
  1081.             catch (Exception ex)
  1082.             {
  1083.                 err = -2;
  1084.                 throw ex;
  1085.             }
  1086.             if (err == -2)
  1087.             {
  1088.                 MSDA.Close();
  1089.                 return err;
  1090.             }
  1091.             if (dv.Table.Rows.Count > 0)
  1092.             {
  1093.                 MSDA.Close();
  1094.                 return -1;
  1095.             }
  1096.             strSQL = "insert into tb_Project_Equipment values('" + this.m_Unit + "'," + 
  1097.                 this.m_wz + ",'" + this.m_Name + "'," + this.m_Num + "," + this.m_Prj + "," +
  1098.                 this.m_Mark + ",'" + this.m_Size + "',1," + this.status + ",'" + this.m_UserName + "')";
  1099.             SqlTransaction tran = MSDA.BeginTransaction();
  1100.             try
  1101.             {
  1102.                 MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  1103.                 tran.Commit();
  1104.             }
  1105.             catch (Exception ex)
  1106.             {
  1107.                 tran.Rollback();
  1108.                 throw ex;
  1109.             }
  1110.             finally
  1111.             {
  1112.                 MSDA.Close();
  1113.             }
  1114.             return 1;
  1115.         }
  1116.         public int ProEquUpdate()
  1117.         {
  1118.             int err = -1;
  1119.             DataView dv = new DataView();
  1120.             try
  1121.             {
  1122.                 dv = this.ProEquGetDataByEqu();
  1123.             }
  1124.             catch (Exception ex)
  1125.             {
  1126.                 err = -2;
  1127.                 throw ex;
  1128.             }
  1129.             if (err == -2) return err;
  1130.             if (dv.Table.Rows.Count < 1)
  1131.             {
  1132.                 //ex.Message = "未找到要更新的内容,请查证后再试!";
  1133.                 err = 1;
  1134.                 return err;
  1135.             }
  1136.             bool bl=false;
  1137.             if (this.m_Unit.Trim() != dv.Table.Rows[0]["UnitName"].ToString().Trim()) bl = true;
  1138.             if (this.m_wz != Convert.ToInt32(dv.Table.Rows[0]["wz_id"].ToString())) bl = true;
  1139.             if (this.m_Name.Trim() != dv.Table.Rows[0]["EquipmentName"].ToString().Trim()) bl = true;
  1140.             if (this.m_Num != Convert.ToInt32(dv.Table.Rows[0]["Number"].ToString())) bl =true;
  1141.             if (this.m_Mark != decimal.Parse(dv.Table.Rows[0]["Price"].ToString())) bl = true;
  1142.             if (this.m_Size.Trim() != dv.Table.Rows[0]["EquipmentSize"].ToString().Trim()) bl = true;
  1143.             if (bl)
  1144.             {
  1145.                 string strSQL = "Update tb_Project_Equipment set sstatus=2 where EquipmentID=" + this.m_ID;
  1146.                 MSDA.Open();
  1147.                 SqlTransaction tran = MSDA.BeginTransaction();
  1148.                 try
  1149.                 {
  1150.                     MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  1151.                     strSQL = "insert into tb_Project_Equipment values('" + this.m_Unit + "'," +
  1152.                     this.m_wz + ",'" + this.m_Name + "'," + this.m_Num + "," + this.m_Prj + "," +
  1153.                     this.m_Mark + ",'" + this.m_Size + "',1," + this.status + ",'" + this.m_UserName + "')";
  1154.                     MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  1155.                     tran.Commit();
  1156.                     return err;
  1157.                 }
  1158.                 catch (Exception ex)
  1159.                 {
  1160.                     tran.Rollback();
  1161.                     err = -2;
  1162.                     throw ex;
  1163.                 }
  1164.                 finally
  1165.                 {
  1166.                     MSDA.Close();
  1167.                 }
  1168.             }
  1169.             else
  1170.             {
  1171.                 err = 2;
  1172.                 //ex.Message = "未发生变化无需更新,请查证后再试!";
  1173.             }
  1174.             return err;
  1175.         }
  1176.         public void ProEquDelete()
  1177.         {
  1178.             int err = -1;
  1179.             DataView dv = new DataView();
  1180.             try
  1181.             {
  1182.                 dv = this.ProEquGetDataByEqu();
  1183.             }
  1184.             catch (Exception ex)
  1185.             {
  1186.                 err = -2;
  1187.                 throw ex;
  1188.             }
  1189.             if (err == -2) return;
  1190.             if (dv.Table.Rows.Count < 1)
  1191.             {
  1192.                 //ex.Message = "未找到要更新的内容,请查证后再试!";
  1193.                 err = 1;
  1194.                 return;
  1195.             }
  1196.             string sSQL = "insert into tb_Project_Equipment values('" + dv.Table.Rows[0]["UnitName"].ToString().Trim() +
  1197.                 "'," + Convert.ToInt32(dv.Table.Rows[0]["wz_id"].ToString()) + ",'" + dv.Table.Rows[0]["EquipmentName"].ToString().Trim() +
  1198.                 "'," + Convert.ToInt32(dv.Table.Rows[0]["Number"].ToString()) + "," + dv.Table.Rows[0]["ProjectID"].ToString().Trim() +
  1199.                 "," + decimal.Parse(dv.Table.Rows[0]["Price"].ToString()) + ",'" + dv.Table.Rows[0]["EquipmentSize"].ToString().Trim() +
  1200.                 "',2,3,'" + this.m_UserName + "')";
  1201.             MSDA.Open();
  1202.             SqlTransaction tran = MSDA.BeginTransaction();
  1203.             try
  1204.             {
  1205.                 MSDA.ExecuteNonQuery(CommandType.Text, sSQL, null);
  1206.                 sSQL = "Update tb_Project_Equipment set sstatus=2 where EquipmentID=" + this.m_ID;
  1207.                 MSDA.ExecuteNonQuery(CommandType.Text, sSQL, null);
  1208.                 tran.Commit();
  1209.             }
  1210.             catch (Exception ex)
  1211.             {
  1212.                 tran.Rollback();
  1213.                 throw ex;
  1214.             }
  1215.             finally
  1216.             {
  1217.                 MSDA.Close();
  1218.             }
  1219.         }
  1220.         /// <summary>
  1221.         /// 材料费
  1222.         /// </summary>
  1223.         public int ProMaterialInsert()
  1224.         {
  1225.             int err = -1;
  1226.             string strSQL = "select * from tb_Project_Material where ProjectID=" +
  1227.                 this.m_Prj + " and wz_id=" + this.m_wz + " and sstatus=1";
  1228.             DataView dv = new DataView();
  1229.             MSDA.Open();
  1230.             try
  1231.             {
  1232.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  1233.             }
  1234.             catch (Exception ex)
  1235.             {
  1236.                 err = -2;
  1237.                 throw ex;
  1238.             }
  1239.             if (err == -2)
  1240.             {
  1241.                 MSDA.Close();
  1242.                 return err;
  1243.             }
  1244.             if (dv.Table.Rows.Count > 0)
  1245.             {
  1246.                 MSDA.Close();
  1247.                 return -1;
  1248.             }
  1249.             strSQL = "insert into tb_Project_Material values(" + this.m_Bud + "," + this.m_Diff + "," +
  1250.                 this.m_DiffSum + "," + this.m_Mark + ",'" + this.m_Name + "','" +
  1251.                 this.m_Size + "'," + this.m_wz + "," + this.m_Num + ",'" + this.m_Unit + "'," +
  1252.                 this.m_Prj + ",1," + this.m_status + ",'" + this.m_UserName +  "')";
  1253.             SqlTransaction tran = MSDA.BeginTransaction();
  1254.             try
  1255.             {
  1256.                 MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  1257.                 tran.Commit();
  1258.             }
  1259.             catch (Exception ex)
  1260.             {
  1261.                 tran.Rollback();
  1262.                 throw ex;
  1263.             }
  1264.             finally
  1265.             {
  1266.                 MSDA.Close();
  1267.             }
  1268.             return 1;
  1269.         }
  1270.         public string ProMaterialGetMemo()
  1271.         {
  1272.             string strSQL = "select Memo from tb_Project_Material where MaterialID=" + this.m_ID ;
  1273.             MSDA.Open();
  1274.             DataView dv = MSDA.ExecuteDataView(CommandType.Text,strSQL,null);
  1275.             MSDA.Close();
  1276.             string sMemo="";
  1277.             if (dv.Table.Rows.Count > 0) sMemo = dv.Table.Rows[0][0].ToString();
  1278.             return sMemo;
  1279.         }
  1280.         public int ProMaterialUpdate()
  1281.         {
  1282.             int err = -1;
  1283.             DataView dv = new DataView();
  1284.             try
  1285.             {
  1286.                 dv = this.ProMaterialGetByMat();
  1287.             }
  1288.             catch (Exception ex)
  1289.             {
  1290.                 err = -2;
  1291.                 throw ex;
  1292.             }
  1293.             if (err == -2) return err;
  1294.             if (dv.Table.Rows.Count < 1)
  1295.             {
  1296.                 //ex.Message = "未找到要更新的内容,请查证后再试!";
  1297.                 err = 1;
  1298.                 return err;
  1299.             }
  1300.             bool bl = false;
  1301.             if (this.m_Bud != decimal.Parse(dv.Table.Rows[0]["BudGetPrice"].ToString())) bl = true;
  1302.             if (this.m_DiffSum != decimal.Parse(dv.Table.Rows[0]["DifferencePriceSum"].ToString())) bl = true;
  1303.             if (this.m_Mark != decimal.Parse(dv.Table.Rows[0]["MarketPrice"].ToString())) bl = true;
  1304.             if (this.m_Name.Trim() != dv.Table.Rows[0]["MeterialName"].ToString().Trim()) bl = true;
  1305.             if (this.m_Size.Trim() != dv.Table.Rows[0]["MeterialSize"].ToString().Trim()) bl = true;
  1306.             if (this.m_wz != Convert.ToInt32(dv.Table.Rows[0]["wz_id"].ToString())) bl = true;
  1307.             if (this.m_Num != Convert.ToInt32(dv.Table.Rows[0]["Number"].ToString())) bl = true;
  1308.             if (this.m_Unit.Trim() != dv.Table.Rows[0]["UnitName"].ToString().Trim()) bl = true;
  1309.             if (bl)
  1310.             {
  1311.                 string strSQL = "Update tb_Project_Material set sstatus=2 where MaterialID=" + this.m_ID;
  1312.                 MSDA.Open();
  1313.                 SqlTransaction tran = MSDA.BeginTransaction();
  1314.                 try
  1315.                 {
  1316.                     MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  1317.                     strSQL = "insert into tb_Project_Material values(" + this.m_Bud + "," + this.m_Diff + "," +
  1318.                     this.m_DiffSum + "," + this.m_Mark + ",'" + this.m_Name + "','" +
  1319.                     this.m_Size + "'," + this.m_wz + "," + this.m_Num + ",'" + this.m_Unit + "'," +
  1320.                     this.m_Prj + ",1," + this.m_status + ",'" + this.m_UserName + "')";
  1321.                     MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  1322.                     tran.Commit();
  1323.                     return err;
  1324.                 }
  1325.                 catch (Exception ex)
  1326.                 {
  1327.                     tran.Rollback();
  1328.                     err = -2;
  1329.                     throw ex;
  1330.                 }
  1331.                 finally
  1332.                 {
  1333.                     MSDA.Close();
  1334.                 }
  1335.             }
  1336.             else
  1337.             {
  1338.                 err = 2;
  1339.                 //ex.Message = "未发生变化无需更新,请查证后再试!";
  1340.             }
  1341.             return err;
  1342.         }
  1343.         public DataView ProMaterialGetByPrj()
  1344.         {
  1345.             string strSQL = "select * from tb_Project_Material where ProjectID=" + this.m_Prj + " order by wz_id";
  1346.             DataView dv = new DataView();
  1347.             try
  1348.             {
  1349.                 MSDA.Open();
  1350.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  1351.             }
  1352.             catch (Exception ex)
  1353.             {
  1354.                 throw ex;
  1355.             }
  1356.             finally
  1357.             {
  1358.                 MSDA.Close();
  1359.             }
  1360.             return dv;
  1361.         }
  1362.         public DataView ProMaterialGetByPrjId()
  1363.         {
  1364.             string strSQL = "select * from tb_Project_Material where ProjectID=" +
  1365.                 this.m_Prj + " and sstatus=" + this.sstatus + " order by wz_id";
  1366.             DataView dv = new DataView();
  1367.             try
  1368.             {
  1369.                 MSDA.Open();
  1370.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  1371.             }
  1372.             catch (Exception ex)
  1373.             {
  1374.                 throw ex;
  1375.             }
  1376.             finally
  1377.             {
  1378.                 MSDA.Close();
  1379.             }
  1380.             return dv;
  1381.         }
  1382.         public DataView ProMaterialGetByMat()
  1383.         {
  1384.             string strSQL = "select * from tb_Project_Material where MaterialID=" + this.CommID + " and sstatus=" + this.sstatus;
  1385.             DataView dv = new DataView();
  1386.             try
  1387.             {
  1388.                 MSDA.Open();
  1389.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  1390.             }
  1391.             catch (Exception ex)
  1392.             {
  1393.                 throw ex;
  1394.             }
  1395.             finally
  1396.             {
  1397.                 MSDA.Close();
  1398.             }
  1399.             return dv;
  1400.         }
  1401.         public string ProBudGetPriceGetByWzId()
  1402.         {
  1403.             string strSQL = "select wz_plan from material_name where wz_id=" + this.m_wz;
  1404.             MSDA2.Open();
  1405.             DataView dv = MSDA2.ExecuteDataView(CommandType.Text, strSQL, null);
  1406.             MSDA2.Close();
  1407.             string wz_plan = "";
  1408.             if (dv.Table.Rows.Count > 0) wz_plan = dv.Table.Rows[0][0].ToString();
  1409.             return wz_plan;
  1410.         }
  1411.         public void ProMaterialDelete()
  1412.         {
  1413.             int err = -1;
  1414.             DataView dv = new DataView();
  1415.             try
  1416.             {
  1417.                 dv = this.ProMaterialGetByMat();
  1418.             }
  1419.             catch (Exception ex)
  1420.             {
  1421.                 err = -2;
  1422.                 throw ex;
  1423.             }
  1424.             if (err == -2) return;
  1425.             if (dv.Table.Rows.Count < 1)
  1426.             {
  1427.                 //ex.Message = "未找到要更新的内容,请查证后再试!";
  1428.                 err = 1;
  1429.                 return;
  1430.             }
  1431.             string sSQL = "insert into tb_Project_Material values(" + decimal.Parse(dv.Table.Rows[0]["BudGetPrice"].ToString()) +
  1432.                 "," + decimal.Parse(dv.Table.Rows[0]["DifferencePrice"].ToString()) + "," + decimal.Parse(dv.Table.Rows[0]["DifferencePriceSum"].ToString()) +
  1433.                 "," + decimal.Parse(dv.Table.Rows[0]["MarketPrice"].ToString()) + ",'" + dv.Table.Rows[0]["MeterialName"].ToString().Trim() +
  1434.                 "','" + dv.Table.Rows[0]["MeterialSize"].ToString().Trim() + "'," + Convert.ToInt32(dv.Table.Rows[0]["wz_id"].ToString()) +
  1435.                 "," + Convert.ToInt32(dv.Table.Rows[0]["Number"].ToString()) + ",'" + dv.Table.Rows[0]["UnitName"].ToString().Trim() +
  1436.                 "'," + Convert.ToInt32(dv.Table.Rows[0]["ProjectID"].ToString()) +
  1437.                 ",2,3,'" + this.m_UserName + "')";
  1438.             MSDA.Open();
  1439.             SqlTransaction tran= MSDA.BeginTransaction();
  1440.             try
  1441.             {
  1442.                 MSDA.ExecuteNonQuery(CommandType.Text, sSQL, null);
  1443.                 sSQL = "Update tb_Project_Material set sstatus=2 where MaterialID=" + this.m_ID;
  1444.                 MSDA.ExecuteNonQuery(CommandType.Text, sSQL, null);
  1445.                 tran.Commit();
  1446.             }
  1447.             catch (Exception ex)
  1448.             {
  1449.                 tran.Rollback();
  1450.                 throw ex;
  1451.             }
  1452.             finally
  1453.             {
  1454.                 MSDA.Close();
  1455.             }
  1456.         }
  1457.         /// <summary>
  1458.         /// 其他费用
  1459.         /// </summary>
  1460.         public DataView ProOtherGetByPrj()
  1461.         {
  1462.             string strSQL = "select * from tb_Project_Other where ProjectID=" + this.m_Prj;
  1463.             DataView dv = new DataView();
  1464.             try
  1465.             {
  1466.                 MSDA.Open();
  1467.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  1468.             }
  1469.             catch (Exception ex)
  1470.             {
  1471.                 throw ex;
  1472.             }
  1473.             finally
  1474.             {
  1475.                 MSDA.Close();
  1476.             }
  1477.             return dv;
  1478.         }
  1479.         public DataView ProGetAllFee()
  1480.         {
  1481.             string strSQL = "select * from " + this.m_Table + " where " + this.m_Condition + "=" + this.m_Prj;
  1482.             DataView dv = new DataView();
  1483.             try
  1484.             {
  1485.                 MSDA.Open();
  1486.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  1487.             }
  1488.             catch (Exception ex)
  1489.             {
  1490.                 throw ex;
  1491.             }
  1492.             finally
  1493.             {
  1494.                 MSDA.Close();
  1495.             }
  1496.             return dv;
  1497.         }
  1498.         public DataView ProOtherByPrj()
  1499.         {
  1500.             string strSQL = "select * from tb_Project_Other where ProjectID=" + this.m_Prj + " and sstatus=" + this.m_sstatus;
  1501.             DataView dv = new DataView();
  1502.             try
  1503.             {
  1504.                 MSDA.Open();
  1505.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  1506.             }
  1507.             catch (Exception ex)
  1508.             {
  1509.                 throw ex;
  1510.             }
  1511.             finally
  1512.             {
  1513.                 MSDA.Close();
  1514.             }
  1515.             return dv;
  1516.         }
  1517.         public DataView ProOtherByOther()
  1518.         {
  1519.             string strSQL = "select * from tb_Project_Other where OtherID=" + this.m_ID + " and sstatus=" + this.m_sstatus;
  1520.             DataView dv = new DataView();
  1521.             try
  1522.             {
  1523.                 MSDA.Open();
  1524.                 dv = MSDA.ExecuteDataView(CommandType.Text, strSQL, null);
  1525.             }
  1526.             catch (Exception ex)
  1527.             {
  1528.                 throw ex;
  1529.             }
  1530.             finally
  1531.             {
  1532.                 MSDA.Close();
  1533.             }
  1534.             return dv;
  1535.         }
  1536.         public void ProOtherInsert()
  1537.         {
  1538.             string strSQL = "insert into tb_Project_Other values('" + this.m_Exp + "','" +
  1539.                 this.m_Name + "','" + this.m_Unit + "'," + this.m_DiffSum + "," + this.m_Prj +
  1540.                 ",1," + this.m_status + ",'" + this.m_UserName + "')";
  1541.             MSDA.Open();
  1542.             SqlTransaction tran = MSDA.BeginTransaction();
  1543.             try
  1544.             {
  1545.                 MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  1546.                 tran.Commit();
  1547.             }
  1548.             catch (Exception ex)
  1549.             {
  1550.                 tran.Rollback();
  1551.                 throw ex;
  1552.             }
  1553.             finally
  1554.             {
  1555.                 MSDA.Close();
  1556.             }
  1557.         }
  1558.         public int ProOtherUpdata()
  1559.         {
  1560.             int err = -1;
  1561.             DataView dv = new DataView();
  1562.             try
  1563.             {
  1564.                 dv = this.ProOtherByOther();
  1565.             }
  1566.             catch (Exception ex)
  1567.             {
  1568.                 err = -2;
  1569.                 throw ex;
  1570.             }
  1571.             if (err == -2) return err;
  1572.             if (dv.Table.Rows.Count < 1)
  1573.             {
  1574.                 //ex.Message = "未找到要更新的内容,请查证后再试!";
  1575.                 err = 1;
  1576.                 return err;
  1577.             }
  1578.             bool bl = false;
  1579.             if (this.Explain.Trim() != dv.Table.Rows[0]["Explain"].ToString().Trim()) bl = true;
  1580.             if (this.m_Name.Trim() != dv.Table.Rows[0]["OtherName"].ToString().Trim()) bl = true;
  1581.             if (this.m_Unit.Trim() != dv.Table.Rows[0]["Memo"].ToString().Trim()) bl = true;
  1582.             if (this.m_DiffSum != decimal.Parse(dv.Table.Rows[0]["Price"].ToString())) bl = true;
  1583.             if (bl)
  1584.             {
  1585.                 string strSQL = "Update tb_Project_Other set sstatus=2 where OtherID=" + this.m_ID;
  1586.                 MSDA.Open();
  1587.                 SqlTransaction tran = MSDA.BeginTransaction();
  1588.                 try
  1589.                 {
  1590.                     MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  1591.                     strSQL = "insert into tb_Project_Other values('" + this.m_Exp + "','" +
  1592.                     this.m_Name + "','" + this.m_Unit + "'," + this.m_DiffSum + "," + this.m_Prj +
  1593.                     ",1," + this.m_status + ",'" + this.m_UserName + "')";
  1594.                     MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  1595.                     tran.Commit();
  1596.                     return err;
  1597.                 }
  1598.                 catch (Exception ex)
  1599.                 {
  1600.                     tran.Rollback();
  1601.                     err = -2;
  1602.                     throw ex;
  1603.                 }
  1604.                 finally
  1605.                 {
  1606.                     MSDA.Close();
  1607.                 }
  1608.             }
  1609.             else
  1610.             {
  1611.                 err = 2;
  1612.                 //ex.Message = "未发生变化无需更新,请查证后再试!";
  1613.             }
  1614.             return err;
  1615.         }
  1616.         public void ProOtherDelete()
  1617.         {
  1618.             int err = -1;
  1619.             DataView dv = new DataView();
  1620.             try
  1621.             {
  1622.                 dv = this.ProOtherByOther();
  1623.             }
  1624.             catch (Exception ex)
  1625.             {
  1626.                 err = -2;
  1627.                 throw ex;
  1628.             }
  1629.             if (err == -2) return;
  1630.             if (dv.Table.Rows.Count < 1)
  1631.             {
  1632.                 //ex.Message = "未找到要更新的内容,请查证后再试!";
  1633.                 return ;
  1634.             }
  1635.             string sSQL = "insert into tb_Project_Other values('" + dv.Table.Rows[0]["Explain"].ToString().Trim() +
  1636.                 "','" + dv.Table.Rows[0]["OtherName"].ToString().Trim() + "','" + dv.Table.Rows[0]["Memo"].ToString().Trim() +
  1637.                 "'," + decimal.Parse(dv.Table.Rows[0]["Price"].ToString()) + "," + decimal.Parse(dv.Table.Rows[0]["ProjectID"].ToString()) +
  1638.                 ",2,3,'" + this.m_UserName + "')";
  1639.             MSDA.Open();
  1640.             SqlTransaction tran = MSDA.BeginTransaction();
  1641.             try
  1642.             {
  1643.                 MSDA.ExecuteNonQuery(CommandType.Text, sSQL, null);
  1644.                 sSQL = "Update tb_Project_Other set sstatus=2 where OtherID=" + this.m_ID;
  1645.                 MSDA.ExecuteNonQuery(CommandType.Text, sSQL, null);
  1646.                 tran.Commit();
  1647.             }
  1648.             catch (Exception ex)
  1649.             {
  1650.                 tran.Rollback();
  1651.                 throw ex;
  1652.             }
  1653.             finally
  1654.             {
  1655.                 MSDA.Close();
  1656.             }
  1657.         }
  1658.     }
  1659.     //组织机构和职工初始化
  1660.     public class EtongFlyChouInit
  1661.     {
  1662.         private int m_ID;               //组织机构ID        EmpID                                               UserID
  1663.         private int m_pDI;              //上级ID            PrimaryOrgID                                        EmpID
  1664.         private string m_Name;          //名称              EmpName
  1665.         private string m_Decs;          //OrgDesc           EMail                                               UserDecs
  1666.         private Int16 m_Inal;           //OrgInal           TempFlag(0、非临时,1、临时)                        IsLock
  1667.         private int m_Level;            //OrgLevel          EmpType(1、普通员工2、部门主管3、公司领导4、其他)   OrdInal
  1668.         private DateTime m_Edit;        //EditTime          EditDate                                            EditDate
  1669.         private string m_Type;          //OrgType(TYPE2)                                                        IPAddress
  1670.         private string m_Path;          //OrgPath           PhoneNumber                                         UserCode
  1671.         private string m_CID;           //OrgcID(DEPT_ID)                                                       UserAccount
  1672.         private string m_Pwd;           //                                                                      UserPwd
  1673.         private Int16 m_Bound;          //                                                                      IsIPBound
  1674.         public int ID
  1675.         {
  1676.             set { m_ID = value; }
  1677.             get { return m_ID; }
  1678.         }
  1679.         public int PID
  1680.         {
  1681.             set { m_pDI = value; }
  1682.             get { return m_pDI; }
  1683.         }
  1684.         public string Name
  1685.         {
  1686.             set {m_Name =value;}
  1687.             get { return m_Name; }
  1688.         }
  1689.         public string Decs
  1690.         {
  1691.             set { m_Decs = value; }
  1692.             get { return m_Decs; }
  1693.         }
  1694.         public Int16 Inal
  1695.         {
  1696.             set { m_Inal = value; }
  1697.             get { return m_Inal; }
  1698.         }
  1699.         public int Level
  1700.         {
  1701.             set { m_Level = value; }
  1702.             get { return m_Level; }
  1703.         }
  1704.         public DateTime Edit
  1705.         {
  1706.             set { m_Edit = value; }
  1707.             get { return m_Edit; }
  1708.         }
  1709.         public string Type
  1710.         {
  1711.             set { m_Type = value; }
  1712.             get { return m_Type; }
  1713.         }
  1714.         public string Path
  1715.         {
  1716.             set { m_Path = value; }
  1717.             get { return m_Path; }
  1718.         }
  1719.         public string CID
  1720.         {
  1721.             set { m_CID = value; }
  1722.             get { return m_CID; }
  1723.         }
  1724.         public string Pwd
  1725.         {
  1726.             set { m_Pwd = value; }
  1727.             get { return m_Pwd; }
  1728.         }
  1729.         public Int16 Bound
  1730.         {
  1731.             set { m_Bound = value; }
  1732.             get { return m_Bound; }
  1733.         }
  1734.         private MSSqlDataAccess MSDA2 = new MSSqlDataAccess(2);
  1735.         private MSSqlDataAccess MSDA = new MSSqlDataAccess(0);
  1736.         private QueryParameterCollection Params = new QueryParameterCollection();
  1737.         public void OrgInit()
  1738.         {
  1739.             string strSQL = "delete from Tb_Sys_Organization";
  1740.             string InSQL = "",SSQL="";
  1741.             MSDA.Open();
  1742.             SqlTransaction tran = MSDA.BeginTransaction();
  1743.             try
  1744.             {
  1745.                 MSDA2.Open();
  1746.                 MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  1747.                 strSQL = "insert into Tb_Sys_Organization values(1,-1,'供电公司','芜湖市供电公司',1,1,'2007-04-01','行政','1','0')";
  1748.                 MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  1749.                 strSQL = "select menuid,supermenuid,dept_name from usertype where actionpage1='#' and menuid>9999 order by supermenuid";
  1750.                 DataView dv = MSDA2.ExecuteDataView(CommandType.Text, strSQL, null);
  1751.                 int i = 1;
  1752.                 for (int j = 0; j < dv.Table.Rows.Count;j++ )
  1753.                 {
  1754.                     i++;
  1755.                     EtongFlyChouInit EFlyInit = new EtongFlyChouInit();
  1756.                     EFlyInit.m_ID = i;
  1757.                     if (dv.Table.Rows[j]["menuid"].ToString().Length == 6)
  1758.                     {
  1759.                         EFlyInit.m_pDI = 1;
  1760.                         EFlyInit.m_Level = 2;
  1761.                         EFlyInit.m_Path = "1/" + EFlyInit.m_ID.ToString();
  1762.                         switch (EFlyInit.m_ID)
  1763.                         {
  1764.                             case 2:
  1765.                                 EFlyInit.m_CID = "a";
  1766.                                 break;
  1767.                             case 3:
  1768.                                 EFlyInit.m_CID = "b";
  1769.                                 break;
  1770.                             case 4:
  1771.                                 EFlyInit.m_CID = "c";
  1772.                                 break;
  1773.                             case 5:
  1774.                                 EFlyInit.m_CID = "d";
  1775.                                 break;
  1776.                             case 6:
  1777.                                 EFlyInit.m_CID = "e";
  1778.                                 break;
  1779.                             default:
  1780.                                 EFlyInit.m_CID = "1";
  1781.                                 break;
  1782.                         }
  1783.                     }
  1784.                     else if (dv.Table.Rows[j]["menuid"].ToString().Length > 6)
  1785.                     {
  1786.                         Params.Clear();
  1787.                         SSQL = "P_GetOrgzationZF";
  1788.                         Params.Add("@param_menuid", Convert.ToInt32(dv.Table.Rows[j][1].ToString()));
  1789.                         DataView dv1=MSDA2.ExecuteDataView(CommandType.StoredProcedure, SSQL, Params);
  1790.                         //EFlyInit.m_pDI = Convert.ToInt32(dv.Table.Rows[0][0].ToString());
  1791.                         //if (dr["menuid"].ToString().Length == 8)
  1792.                         //{
  1793.                         EFlyInit.m_pDI = Convert.ToInt32(dv1.Table.Rows[0][0].ToString());
  1794.                         EFlyInit.m_Level = 3;
  1795.                         EFlyInit.m_Path = "1/" + EFlyInit.m_pDI.ToString() + "/" + EFlyInit.m_ID.ToString();
  1796.                         //}
  1797.                         //else
  1798.                         //{
  1799.                         //    EFlyInit.m_Level = 4;
  1800.                         //    EFlyInit.m_Path = "1/" + EFlyInit.m_pDI.ToString() + "/" + i.ToString();
  1801.                         //}
  1802.                         EFlyInit.m_CID = "1";
  1803.                     }
  1804.                     EFlyInit.m_Name = dv.Table.Rows[j]["dept_name"].ToString();
  1805.                     EFlyInit.m_Decs = "物资系统导入";
  1806.                     EFlyInit.m_Inal = 1;
  1807.                     EFlyInit.m_Edit = System.DateTime.Now;
  1808.                     EFlyInit.m_Type = dv.Table.Rows[j]["menuid"].ToString();
  1809.                     InSQL = "insert into Tb_Sys_Organization values(" + EFlyInit.m_ID + "," + EFlyInit.m_pDI + ",'" + EFlyInit.m_Name +
  1810.                         "','" + EFlyInit.m_Decs + "'," + EFlyInit.m_Inal + "," + EFlyInit.m_Level + ",'" + EFlyInit.m_Edit + "','" +
  1811.                         EFlyInit.m_Type + "','" + EFlyInit.m_Path + "','" + EFlyInit.m_CID + "')";
  1812.                     MSDA.ExecuteNonQuery(CommandType.Text, InSQL, null);
  1813.                 }
  1814.                 tran.Commit();
  1815.             }
  1816.             catch (Exception ex)
  1817.             {
  1818.                 tran.Rollback();
  1819.                 throw ex;
  1820.             }
  1821.             finally
  1822.             {
  1823.                 MSDA2.Close();
  1824.                 MSDA.Close();
  1825.             }
  1826.         }
  1827.         public void EmpInit()
  1828.         {
  1829.             string InSQL = "";
  1830.             string SSQL = "";
  1831.             string strSQL = "delete from Tb_Sys_Employee";
  1832.             MSDA.Open();
  1833.             SqlTransaction tran = MSDA.BeginTransaction();
  1834.             try
  1835.             {
  1836.                 MSDA2.Open();
  1837.                 MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  1838.                 strSQL = "delete from Tb_Sys_User";
  1839.                 MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  1840.                 strSQL = "insert into Tb_Sys_User values(NULL,'admin','NULL','系统用户',NULL,'111111',0,NULL,0,'2007-04-01','','')";
  1841.                 MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  1842.                 strSQL = "delete from Tb_Sys_UserRole";
  1843.                 MSDA.ExecuteNonQuery(CommandType.Text, strSQL, null);
  1844.                 strSQL = "select menuid,supermenuid,passwd,dept_name,pym from usertype where actionpage1='sys_person_main.asp' and pym<>''";
  1845.                 SqlDataReader dr = MSDA2.ExecuteReader(CommandType.Text, strSQL, null);
  1846.                 int i = 0;
  1847.                 while (dr.Read() == true)
  1848.                 {
  1849.                     EtongFlyChouInit EFlyInit = new EtongFlyChouInit();
  1850.                     i++;
  1851.                     EFlyInit.m_ID = i;
  1852.                     SSQL = "select OrgID from Tb_Sys_Organization where OrgType='" + dr["supermenuid"].ToString() + "'";
  1853.                     DataView dv = MSDA.ExecuteDataView(CommandType.Text, SSQL, null);
  1854.                     if (dv.Table.Rows.Count > 0) EFlyInit.m_pDI = Convert.ToInt32(dv.Table.Rows[0][0].ToString());
  1855.                     else EFlyInit.m_pDI = -1;
  1856.                     EFlyInit.m_Name = dr["dept_name"].ToString();
  1857.                     EFlyInit.m_Level = 1;
  1858.                     EFlyInit.m_Decs = "wz@wz.com";
  1859.                     EFlyInit.m_Path = "";
  1860.                     EFlyInit.m_Edit = System.DateTime.Now;
  1861.                     EFlyInit.m_Inal = 0;
  1862.                     InSQL = "insert into Tb_Sys_Employee values(" + EFlyInit.m_ID + ",'" + EFlyInit.m_Name + "'," + EFlyInit.m_pDI +
  1863.                         "," + EFlyInit.m_Level + ",'" + EFlyInit.m_Decs + "','" + EFlyInit.m_Path + "','" + EFlyInit.m_Edit + "'," +
  1864.                         EFlyInit.m_Inal + ")";
  1865.                     MSDA.ExecuteNonQuery(CommandType.Text, InSQL, null);
  1866.                     EFlyInit.m_pDI = i;
  1867.                     EFlyInit.m_CID = dr["pym"].ToString();
  1868.                     EFlyInit.m_Path = "";
  1869.                     EFlyInit.m_Decs = "物资系统导入";
  1870.                     EFlyInit.m_Level = 1;
  1871.                     EFlyInit.m_Pwd = dr["passwd"].ToString();
  1872.                     EFlyInit.m_Inal = 0;
  1873.                     EFlyInit.m_Type = "";
  1874.                     EFlyInit.m_Bound = 0;
  1875.                     InSQL = "insert into Tb_Sys_User values(" + EFlyInit.m_pDI +",'" + EFlyInit.m_CID + "','" +
  1876.                         EFlyInit.m_Path + "','" + EFlyInit.m_Decs + "','" + EFlyInit.m_Level + "','" +
  1877.                         EFlyInit.m_Pwd + "'," + EFlyInit.m_Inal + ",'" + EFlyInit.m_Type + "'," + 
  1878.                         EFlyInit.m_Bound + ",'" + EFlyInit.m_Edit + "','','')";
  1879.                     MSDA.ExecuteNonQuery(CommandType.Text, InSQL, null);
  1880.                 }
  1881.                 dr.Close();
  1882.                 tran.Commit();
  1883.             }
  1884.             catch (Exception ex)
  1885.             {
  1886.                 tran.Rollback();
  1887.                 throw ex;
  1888.             }
  1889.             finally
  1890.             {
  1891.                 MSDA.Close();
  1892.                 MSDA2.Close();
  1893.             }
  1894.         }
  1895.     }
  1896. }