Beispiel #1
0
        /// <summary>
        ///根据SQL语句获取集合
        /// </summary>
        private IList <Tbl_ProjectContract> getTbl_ProjectContractsBySql(string sql)
        {
            IList <Tbl_ProjectContract> list = new List <Tbl_ProjectContract>();
            DataSet ds = DBHelper.ExecuteDataset(this.connection, CommandType.Text, sql);

            if (ds.Tables.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                foreach (DataRow dr in dt.Rows)
                {
                    Tbl_ProjectContract tbl_projectcontract = new Tbl_ProjectContract();
                    tbl_projectcontract.ID              = Convert.ToInt32(dr["ID"]);
                    tbl_projectcontract.ProjectID       = Convert.ToInt32(dr["ProjectID"]);
                    tbl_projectcontract.PC_Name         = Convert.ToString(dr["PC_Name"]);
                    tbl_projectcontract.PC_File         = Convert.ToString(dr["PC_File"]);
                    tbl_projectcontract.PC_Price        = Convert.ToDouble(dr["PC_Price"]);
                    tbl_projectcontract.PC_MoneyReceive = Convert.ToDouble(dr["PC_MoneyReceive"]);
                    tbl_projectcontract.PC_MoneyBill    = Convert.ToDouble(dr["PC_MoneyBill"]);
                    tbl_projectcontract.PC_FeeType      = Convert.ToString(dr["PC_FeeType"]);
                    tbl_projectcontract.Status          = Convert.ToString(dr["Status"]);
                    tbl_projectcontract.AddDate         = Convert.ToDateTime(dr["AddDate"]);
                    tbl_projectcontract.DealFlag        = Convert.ToInt32(dr["DealFlag"]);
                    tbl_projectcontract.DealUser        = Convert.ToString(dr["DealUser"]);
                    tbl_projectcontract.DealTime        = Convert.ToDateTime(dr["DealTime"]);
                    list.Add(tbl_projectcontract);
                }
            }
            return(list);
        }
 public static int UpdateTbl_ProjectContract(Tbl_ProjectContract tbl_projectcontract)
 {
     WebCommon.Public.WriteLog("修改合同:" + tbl_projectcontract.ProjectID);
     tbl_projectcontract.DealUser = WebCommon.Public.GetUserName();
     tbl_projectcontract.DealTime = DateTime.Now;
     return(new Tbl_ProjectContractService().UpdateTbl_ProjectContractById(tbl_projectcontract));
 }
        public static int AddTbl_ProjectContract(Tbl_ProjectContract tbl_projectcontract)
        {
            WebCommon.Public.WriteLog("添加合同:" + tbl_projectcontract.ProjectID);
            int count = new Tbl_ProjectContractService().AddTbl_ProjectContract(tbl_projectcontract);

            if (count > 0)
            {
                //添加合同成功的时候更新项目的节点信息
                WebModels.Tbl_Project project = WebBLL.Tbl_ProjectManager.GetTbl_ProjectById(tbl_projectcontract.ProjectID);
                project.ProjectNo = tbl_projectcontract.PC_Name;                          //生成项目编号
                project.NodeNo    = "确认设总";
                project.NodeUser  = WebBLL.Tbl_ConfigManager.GetTbl_ConfigById(1).C_Set5; //技术副院长
                WebBLL.Tbl_ProjectManager.UpdateTbl_Project(project);
            }
            return(count);
        }
Beispiel #4
0
        public int AddTbl_ProjectContract(Tbl_ProjectContract tbl_projectcontract)
        {
            string sql = "insert into [Tbl_ProjectContract] ([ProjectID],[PC_Name],[PC_File],[PC_Price],[PC_MoneyReceive],[PC_MoneyBill],[PC_FeeType],[Status],[DealUser]) values (@ProjectID,@PC_Name,@PC_File,@PC_Price,@PC_MoneyReceive,@PC_MoneyBill,@PC_FeeType,@Status,@DealUser)";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@ProjectID", tbl_projectcontract.ProjectID),
                new SqlParameter("@PC_Name", tbl_projectcontract.PC_Name),
                new SqlParameter("@PC_File", tbl_projectcontract.PC_File),
                new SqlParameter("@PC_Price", tbl_projectcontract.PC_Price),
                new SqlParameter("@PC_MoneyReceive", tbl_projectcontract.PC_MoneyReceive),
                new SqlParameter("@PC_MoneyBill", tbl_projectcontract.PC_MoneyBill),
                new SqlParameter("@PC_FeeType", tbl_projectcontract.PC_FeeType),
                new SqlParameter("@Status", tbl_projectcontract.Status),
                new SqlParameter("@DealUser", tbl_projectcontract.DealUser)
            };
            return(DBHelper.ExecuteNonQuery(this.connection, CommandType.Text, sql, sp));
        }
Beispiel #5
0
        public int UpdateTbl_ProjectContractById(Tbl_ProjectContract tbl_projectcontract)
        {
            string sql = "update [Tbl_ProjectContract] set [ProjectID]=@ProjectID,[PC_Name]=@PC_Name,[PC_File]=@PC_File,[PC_MoneyBill]=@PC_MoneyBill,[PC_MoneyReceive]=@PC_MoneyReceive,[PC_Price]=@PC_Price,[PC_FeeType]=@PC_FeeType,[Status]=@Status,[DealUser]=@DealUser where DealFlag=0 and [ID]=@ID";

            SqlParameter[] sp = new SqlParameter[]
            {
                new SqlParameter("@ID", tbl_projectcontract.ID),
                new SqlParameter("@ProjectID", tbl_projectcontract.ProjectID),
                new SqlParameter("@PC_Name", tbl_projectcontract.PC_Name),
                new SqlParameter("@PC_File", tbl_projectcontract.PC_File),
                new SqlParameter("@PC_Price", tbl_projectcontract.PC_Price),
                new SqlParameter("@PC_MoneyReceive", tbl_projectcontract.PC_MoneyReceive),
                new SqlParameter("@PC_MoneyBill", tbl_projectcontract.PC_MoneyBill),
                new SqlParameter("@PC_FeeType", tbl_projectcontract.PC_FeeType),
                new SqlParameter("@Status", tbl_projectcontract.Status),
                new SqlParameter("@DealUser", tbl_projectcontract.DealUser)
            };
            return(DBHelper.ExecuteNonQuery(this.connection, CommandType.Text, sql, sp));
        }