Exemplo n.º 1
0
        public int UpateXCJC(Entity.AccessReport entity)
        {
            int            iReturn = 0;
            DBOperatorBase db      = new DataBase();

            IDBTypeElementFactory dbFactory = db.GetDBTypeElementFactory();
            SqlTransactionHelper  thelper   = new SqlTransactionHelper(Config.constr);


            try
            {
                IDbDataParameter[] prams =
                {
                };
                string backstr = "";
                if (entity.StatusID == 3 || entity.StatusID == 1.5)
                {
                    backstr = ", xcjcbackremark='" + entity.Remark + "'";
                }
                if (entity.StatusID != 4 && entity.StatusID != 3 && entity.StatusID != 1.5)
                {
                    iReturn = db.ExecuteNonQuery(Config.constr, CommandType.Text, "update t_Y_FlowInfo set  updatedate=getdate(),updateuser='******',varman5='" + entity.CreateUser + "',vardate5='" + entity.CreateDate + "',varremark5='" + entity.Remark + "'" + backstr + " where id='" + entity.ID + "'", prams);
                    //. + " values('" + entity.CreateDate + "','" + entity.CreateUser + "','" + entity.WTDate + "','" + entity.TypeID + "','" + entity.WTNO + "','" + entity.level + "','" + entity.Remark + "','" + entity.WTMan + "','" + entity.lxMan + "','" + entity.lxtel + "','" + entity.lxEmail + "','" + entity.address + "','" + entity.Mode + "','" + entity.ProjectName + "','" + entity.StatusID + "','" + entity.chargeman + "')", prams);
                }
                else
                {
                    iReturn = db.ExecuteNonQuery(Config.constr, CommandType.Text, "update t_Y_FlowInfo set xcjcbackflag='" + entity.backflag + "',  updatedate=getdate(),updateuser='******',StatusID='" + entity.StatusID + "',varman5='" + entity.CreateUser + "',vardate5='" + entity.CreateDate + "',varremark5='" + entity.Remark + "' " + backstr + " where id='" + entity.ID + "'", prams);
                }

                //iReturn = db.ExecuteNonQuery(Config.constr, CommandType.Text, "update t_Y_FlowInfo set  rwclass='" + entity.classID + "', updatedate=getdate(),updateuser='******',ReportAccessDate='" + entity.WTDate + "',ItemType='" + entity.TypeID + "',ReportName='" + entity.WTNO + "',urgent='" + entity.Remark + "',wtdepart='" + entity.WTMan + "',lxman='" + entity.lxMan + "',lxtel='" + entity.lxtel + "',lxemail='" + entity.lxEmail + "',address='" + entity.address + "',jcmethod='" + entity.Mode + "',Projectname='" + entity.ProjectName + "',StatusID='" + entity.StatusID + "',,chargeman='" + entity.chargeman + "' ,ulevel='" + entity.level + "' where id='" + entity.ID + "'", prams);


                if (iReturn == 1 && (entity.StatusID == 3 || entity.StatusID == 1.5))
                {
                    string str = "";
                    if (entity.StatusID == 3)
                    {
                        str = "现场监测退回方案编写";
                    }
                    else if (entity.StatusID == 1.5)
                    {
                        str = "现场监测退回项目指派";
                    }
                    ItemObj backobj = new ItemObj(entity.CreateUser, entity.ID.ToString(), str, entity.CreateDate.ToString(), entity.Content);
                    backobj.save();
                }
            }
            catch (Exception ex)
            {
                iReturn = -1;
            }
            finally
            {
                if (db.Conn != null)
                {
                    db.Conn.Close();
                }
            }
            return(iReturn);
        }
Exemplo n.º 2
0
        //验收方案编写保存相关
        public int UpateYSfanAn(Entity.AccessReport entity)
        {
            int            iReturn = 0;
            DBOperatorBase db      = new DataBase();

            IDBTypeElementFactory dbFactory = db.GetDBTypeElementFactory();
            SqlTransactionHelper  thelper   = new SqlTransactionHelper(Config.constr);
            IDbTransaction        trans     = thelper.StartTransaction();

            try
            {
                IDbDataParameter[] prams =
                {
                };


                //iReturn = db.ExecuteNonQuery(Config.constr, CommandType.Text, "update t_Y_FlowInfo set  rwclass='" + entity.classID + "', updatedate=getdate(),updateuser='******',ReportAccessDate='" + entity.WTDate + "',ItemType='" + entity.TypeID + "',ReportName='" + entity.WTNO + "',urgent='" + entity.Remark + "',wtdepart='" + entity.WTMan + "',lxman='" + entity.lxMan + "',lxtel='" + entity.lxtel + "',lxemail='" + entity.lxEmail + "',address='" + entity.address + "',jcmethod='" + entity.Mode + "',Projectname='" + entity.ProjectName + "',StatusID='" + entity.StatusID + "',,chargeman='" + entity.chargeman + "' ,ulevel='" + entity.level + "' where id='" + entity.ID + "'", prams);
                string backstr = "";
                if (entity.StatusID == 2)
                {
                    backstr = ",fanbackremark='" + entity.Content + "'";
                }
                iReturn = db.ExecuteNonQueryTrans(trans, CommandType.Text, "update t_Y_FlowInfo set backflag='" + entity.backflag + "', fanbackflag='" + entity.backflag + "',StatusID='" + entity.StatusID + "' ,updatedate=getdate(),updateuser='******',varman3='" + entity.CreateUser + "',vardate3='" + entity.CreateDate + "',varremark3='" + entity.Content + "'" + backstr + " where id='" + entity.ID + "'", prams);
                //. + " values('" + entity.CreateDate + "','" + entity.CreateUser + "','" + entity.WTDate + "','" + entity.TypeID + "','" + entity.WTNO + "','" + entity.level + "','" + entity.Remark + "','" + entity.WTMan + "','" + entity.lxMan + "','" + entity.lxtel + "','" + entity.lxEmail + "','" + entity.address + "','" + entity.Mode + "','" + entity.ProjectName + "','" + entity.StatusID + "','" + entity.chargeman + "')", prams);

                if (iReturn == 1)
                {
                    thelper.CommitTransaction(trans);

                    if (entity.StatusID == 2)
                    {
                        ItemObj backobj = new ItemObj(entity.CreateUser, entity.ID.ToString(), "验收方案编制退回踏勘", entity.CreateDate.ToString(), entity.Content);
                        backobj.save();
                    }
                }
                else
                {
                    thelper.RollTransaction(trans);
                }
            }
            catch (Exception ex)
            {
                thelper.RollTransaction(trans);

                iReturn = -1;
            }
            finally
            {
                if (db.Conn != null)
                {
                    db.Conn.Close();
                }
            }
            return(iReturn);
        }
Exemplo n.º 3
0
        public int UpateBack(Entity.AccessReport entity)
        {
            int            iReturn = 0;
            DBOperatorBase db      = new DataBase();

            IDBTypeElementFactory dbFactory = db.GetDBTypeElementFactory();
            SqlTransactionHelper  thelper   = new SqlTransactionHelper(Config.constr);


            try
            {
                IDbDataParameter[] prams =
                {
                };


                iReturn = db.ExecuteNonQuery(Config.constr, CommandType.Text, "update t_Y_FlowInfo set backflag='" + entity.backflag + "',StatusID='" + entity.StatusID + "',tkwether=null, updatedate=getdate(),updateuser='******',varremark2='" + entity.Remark + "' where id='" + entity.ID + "'", prams);

                if (iReturn == 1)
                {
                    ItemObj backobj = new ItemObj(entity.CreateUser, entity.ID.ToString(), "踏勘退回指派", entity.CreateDate.ToString(), entity.Remark);
                    backobj.save();
                }
            }
            catch (Exception ex)
            {
                iReturn = -1;
            }
            finally
            {
                if (db.Conn != null)
                {
                    db.Conn.Close();
                }
            }
            return(iReturn);
        }
Exemplo n.º 4
0
        //项目初审
        public int UpateYScs(Entity.AccessReport entity)
        {
            int            iReturn = 0;
            DBOperatorBase db      = new DataBase();

            IDBTypeElementFactory dbFactory = db.GetDBTypeElementFactory();
            SqlTransactionHelper  thelper   = new SqlTransactionHelper(Config.constr);
            IDbTransaction        trans     = thelper.StartTransaction();

            try
            {
                IDbDataParameter[] prams =
                {
                };
                if (entity.csflag == 1)// 初审不通过
                {
                    iReturn = db.ExecuteNonQueryTrans(trans, CommandType.Text, "update t_Y_FlowInfo set backflag='" + entity.backflag + "',  hanwether='" + entity.hanwether + "',csdate=getdate(), updatedate=getdate(),updateuser='******',Projectname='" + entity.ProjectName + "',StatusID='" + entity.StatusID + "',kschargeman='" + entity.chargeman + "' ,ulevel='" + entity.level + "',varman1='" + entity.CreateUser + "',vardate1='" + entity.CreateDate + "',varremark1='" + entity.Remark + "',wether='" + entity.csflag + "' where id='" + entity.ID + "'", prams);
                }

                else if (entity.backflag == 1)//一般的退回
                {
                    iReturn = db.ExecuteNonQueryTrans(trans, CommandType.Text, "update t_Y_FlowInfo set backflag='" + entity.backflag + "', hanwether='" + entity.hanwether + "',csdate=getdate(), updatedate=getdate(),updateuser='******',Projectname='" + entity.ProjectName + "',StatusID='" + entity.StatusID + "',kschargeman='" + entity.chargeman + "' ,ulevel='" + entity.level + "',varman1='" + entity.CreateUser + "',vardate1='" + entity.CreateDate + "',varremark1='" + entity.Remark + "' where id='" + entity.ID + "'", prams);
                }

                else if (entity.StatusID == 1.5)
                {
                    iReturn = db.ExecuteNonQueryTrans(trans, CommandType.Text, "update t_Y_FlowInfo set hanwether='" + entity.hanwether + "' ,  updatedate=getdate(),csdate=getdate(),updateuser='******',Projectname='" + entity.ProjectName + "',StatusID='" + entity.StatusID + "',kschargeman='" + entity.chargeman + "' ,ulevel='" + entity.level + "',varman1='" + entity.CreateUser + "',vardate1='" + entity.CreateDate + "',varremark1='" + entity.Remark + "',wether='" + entity.csflag + "' where id='" + entity.ID + "'", prams);
                }
                else
                {
                    iReturn = db.ExecuteNonQueryTrans(trans, CommandType.Text, "update t_Y_FlowInfo set hanwether='" + entity.hanwether + "' ,  updatedate=getdate(),csdate=getdate(),updateuser='******',Projectname='" + entity.ProjectName + "',kschargeman='" + entity.chargeman + "' ,ulevel='" + entity.level + "',varman1='" + entity.CreateUser + "',vardate1='" + entity.CreateDate + "',varremark1='" + entity.Remark + "',wether='" + entity.csflag + "' where id='" + entity.ID + "'", prams);
                }

                if (iReturn == 1)
                {
                    thelper.CommitTransaction(trans);
                    if (entity.backflag == 1)
                    {
                        ItemObj backobj = new ItemObj(entity.CreateUser, entity.ID.ToString(), "初审退回综合室受理", entity.CreateDate.ToString(), entity.Remark);
                        backobj.save();
                    }

                    else if (entity.StatusID == 0)
                    {
                        ItemObj backobj = new ItemObj(entity.CreateUser, entity.ID.ToString(), "初审不通过退回综合室受理", entity.CreateDate.ToString(), entity.Remark);
                        backobj.save();
                    }
                }
                else
                {
                    thelper.RollTransaction(trans);
                }
            }
            catch (Exception ex)
            {
                thelper.RollTransaction(trans);

                iReturn = -1;
            }
            finally
            {
                if (db.Conn != null)
                {
                    db.Conn.Close();
                }
            }
            return(iReturn);
        }
Exemplo n.º 5
0
        //项目指派
        public int UpateYSzp(Entity.AccessReport entity)
        {
            int            iReturn = 0;
            DBOperatorBase db      = new DataBase();

            IDBTypeElementFactory dbFactory = db.GetDBTypeElementFactory();
            SqlTransactionHelper  thelper   = new SqlTransactionHelper(Config.constr);
            IDbTransaction        trans     = thelper.StartTransaction();

            try
            {
                IDbDataParameter[] prams =
                {
                };
                string upstr = "";
                if (entity.StatusID == 2 || entity.StatusID == 3.5 || entity.StatusID == 1)
                {
                    upstr = "StatusID='" + entity.StatusID + "',";
                }

                iReturn = db.ExecuteNonQueryTrans(trans, CommandType.Text, "update t_Y_FlowInfo set backflag='" + entity.backflag + "', hanwether='" + entity.hanwether + "' ,zpremark='" + entity.Remark + "',  updatedate=getdate(),updateuser='******'," + upstr + " chargeman='" + entity.chargeman + "' ,ulevel='" + entity.level + "',zpdate=getdate() where id='" + entity.ID + "'", prams);

                if (iReturn == 1)
                {
                    //提交
                    if (entity.StatusID == 2 || entity.StatusID == 3.5)
                    {
                        IDataReader sr = db.ExecuteReader(Config.constr, CommandType.Text, "select * from t_M_ReporInfo where syID='" + entity.ID + "'", prams);
                        DataTable   dt = new DataTable();
                        dt.Load(sr);
                        if (dt.Rows.Count > 0)
                        {
                            iReturn = db.ExecuteNonQueryTrans(trans, CommandType.Text, "update t_M_ReporInfo set rwclass='" + entity.classID + "', CreateDate='" + entity.CreateDate + "',UserID='" + entity.CreateUser + "',ReportAccessDate='" + entity.WTDate + "',ItemType='" + entity.TypeID + "',ReportName='" + entity.WTNO + "',Ulevel='" + entity.level + "',urgent='" + entity.Remark + "',wtdepart='" + entity.WTMan + "',lxman='" + entity.lxMan + "',lxtel='" + entity.lxtel + "',lxemail='" + entity.lxEmail + "',address='" + entity.address + "',jcmethod='" + entity.Mode + "',Projectname='" + entity.ProjectName + "',Green='" + entity.Green + "',chargeman='" + entity.chargeman + "' where syID='" + entity.ID + "'", prams);
                        }
                        else
                        {
                            iReturn = db.ExecuteNonQueryTrans(trans, CommandType.Text, "insert into t_M_ReporInfo (rwclass,CreateDate,UserID,ReportAccessDate,ItemType,ReportName,Ulevel,urgent,wtdepart,lxman,lxtel,lxemail,address,jcmethod,Projectname,StatusID,syID,Green,chargeman)values('" + entity.classID + "','" + entity.CreateDate + "','" + entity.CreateUser + "','" + entity.WTDate + "','" + entity.TypeID + "','" + entity.WTNO + "','" + entity.level + "','" + entity.Remark + "','" + entity.WTMan + "','" + entity.lxMan + "','" + entity.lxtel + "','" + entity.lxEmail + "','" + entity.address + "','" + entity.Mode + "','" + entity.ProjectName2 + "','1','" + entity.ID + "','" + entity.Green + "','" + entity.chargeman + "')", prams);
                        }
                    }
                    if (iReturn == 1)
                    {
                        thelper.CommitTransaction(trans);
                        if (entity.backflag == 1)
                        {
                            ItemObj backobj = new ItemObj(entity.CreateUser, entity.ID.ToString(), "指派退回初审", entity.CreateDate.ToString(), entity.Remark);
                            backobj.save();
                        }
                    }
                    else
                    {
                        thelper.RollTransaction(trans);
                    }
                }
                else
                {
                    thelper.RollTransaction(trans);
                }
            }
            catch (Exception ex)
            {
                thelper.RollTransaction(trans);

                iReturn = -1;
            }
            finally
            {
                if (db.Conn != null)
                {
                    db.Conn.Close();
                }
            }
            return(iReturn);
        }