/// <summary>
        /// 获得数据明细 通过ID
        /// </summary>
        public DataSet GetDetail(int ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select a.ID,a.ContractId,c.ProjName,d.PartnerName,b.ContractCode,e.CompanyName,b.ContractDate,b.ContractNat,a.InvoiceCode,a.InvoiceDate,a.InvoiceNat,a.TaxRate,a.Memo,a.AttachmentId_Invoice,f.PerName as SvcManagerName,g.PerName as ProjManagerName,a.OperaName,a.OperaTime ");
            strSql.Append("FROM proj_PurchaseInvoice a ");
            strSql.Append("left join proj_PartnerContract b on a.ContractId=b.ID ");
            strSql.Append("left join proj_Project c on b.ProjId=c.ID ");
            strSql.Append("left join base_Partner d on b.PartnerId=d.ID ");
            strSql.Append("left join base_Company e on b.CompanyId=e.ID ");
            strSql.Append("left join sys_Person f on c.SvcManagerId=f.ID ");
            strSql.Append("left join sys_Person g on c.ProjManagerId=g.ID ");
            strSql.Append("where a.FlagDel=0 and a.ID=@ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID", SqlDbType.Int, 4)
            };
            parameters[0].Value = ID;

            DataSet ds           = DbHelperSQL.Query(strSql.ToString(), parameters);
            string  AttachmentId = "";

            if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                AttachmentId = (ds.Tables[0].Rows[0]["AttachmentId_Invoice"].ToString() == "" ? "" : ds.Tables[0].Rows[0]["AttachmentId_Invoice"].ToString() + ",")
                ;
            }
            DataTable dt = new System.sys_Attachment().GetAttachment(AttachmentId);

            dt.TableName = "attachment";
            ds.Tables.Add(dt.Copy());
            return(ds);
        }
        /// <summary>
        /// 获得数据明细 通过ID
        /// </summary>
        public DataSet GetDetail(int ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select a.ID,a.SettlementCode,a.IntentionId,b.IntentionCode,b.CustTypeId,b.CustName,b.MachineCode,c.MachineModel,e.ID as SchemeId,a.SettlementTypeId,a.SettlementFee,a.FlagSX,a.SettlementFee_rebate,a.SettlementDate,a.Memo,a.OperaDepId,a.OperaId,a.OperaName,a.OperaTime,a.AttachmentId_Settlement,a.TimeFee,a.PartFee ");
            strSql.Append("FROM repair_SettlementList a ");
            strSql.Append("left join repair_Intention b on a.IntentionId=b.ID and b.FlagDel=0 ");
            strSql.Append("left join base_MachineModel c on b.MachineModelId=c.ID and c.FlagDel=0 ");
            strSql.Append("left join Repair_Scheme e on a.IntentionId=e.IntentionId and e.FlagDel=0 ");
            strSql.Append("where a.FlagDel=0 and a.ID=@ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID", SqlDbType.Int, 4)
            };
            parameters[0].Value = ID;

            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            string AttachmentId = "";

            if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                AttachmentId = (ds.Tables[0].Rows[0]["AttachmentId_Settlement"].ToString() == "" ? "" : ds.Tables[0].Rows[0]["AttachmentId_Settlement"].ToString() + ",")
                ;
            }
            DataTable dt = new System.sys_Attachment().GetAttachment(AttachmentId);

            dt.TableName = "attachment";
            ds.Tables.Add(dt.Copy());

            return(ds);
        }
        /// <summary>
        /// 获得数据明细 通过ID
        /// </summary>
        public DataSet GetDetail(int ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select a.ID,a.AssignmentId,a.Memo,a.AssignmentProcedureId,a.ProcedureId,a.ScheduleType,a.ScheduleDate,a.OperaDepId,a.OperaId,a.OperaName,a.OperaTime,a.AttachmentList_Schedule,a.PauseReason ");
            strSql.Append("FROM repair_Schedule a ");
            strSql.Append("where a.FlagDel=0 and a.ID=@ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID", SqlDbType.Int, 4)
            };
            parameters[0].Value = ID;

            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            string AttachmentId = "";

            if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                AttachmentId = (ds.Tables[0].Rows[0]["AttachmentList_Schedule"].ToString() == "" ? "" : ds.Tables[0].Rows[0]["AttachmentList_Schedule"].ToString() + ",");
            }
            DataTable dt = new System.sys_Attachment().GetAttachment(AttachmentId);

            dt.TableName = "attachment";
            ds.Tables.Add(dt.Copy());
            return(ds);
        }
        /// <summary>
        /// 获得数据明细 通过ID
        /// </summary>
        public DataSet GetDetail(int ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select a.ID,a.ApplyNo,a.CityAreaId,a.CityName,a.CountyName,a.MarketLevel,a.ShopName,a.ShopAddress,a.ShopType,a.ShopClass,a.DisplayArea,a.DisplayArea_CHG,a.DisplayArea_YG,a.BuildDate,a.DistributorName,a.DistributorTelephone,a.DistributorMobile,a.DistributorEmail,a.DistributorContext,a.Category,a.FranchiseFee,a.GuaranteeMoney,a.FirstPayment,a.AttachmentId_ZSRW,a.AttachmentId_GH,a.BillSign,a.AuditNextId,a.BillState,a.DepId,a.OperaId,a.OperaName,a.OperaTime,a.AuditEndTime ");
            strSql.Append("FROM shop_NewBuildApply a ");
            strSql.Append("where a.FlagDel=0 and ID=@ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID", SqlDbType.Int, 4)
            };
            parameters[0].Value = ID;

            DataSet ds           = DbHelperSQL.Query(strSql.ToString(), parameters);
            string  AttachmentId = "";

            if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                AttachmentId = (ds.Tables[0].Rows[0]["AttachmentId_ZSRW"].ToString() == "" ? "" : ds.Tables[0].Rows[0]["AttachmentId_ZSRW"].ToString() + ",") +
                               (ds.Tables[0].Rows[0]["AttachmentId_GH"].ToString() == "" ? "" : ds.Tables[0].Rows[0]["AttachmentId_GH"].ToString() + ",")
                ;
            }
            DataTable dt = new System.sys_Attachment().GetAttachment(AttachmentId);

            dt.TableName = "attachment";
            ds.Tables.Add(dt.Copy());
            return(ds);
        }
        /// <summary>
        /// 获得数据明细 通过ID
        /// </summary>
        public DataSet GetDetail(int ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select a.ID,a.IntentionId,a.SchemeCode,b.CustName,b.IntentionCode,b.RepairState,b.RepairAdress,b.MachineStatus,b.MachineCode,d.MachineModel,a.RepairContent,a.FlagENGKC,a.FlagPPMKC,a.FlagENG,a.FlagPPM,a.FlagMCV,a.FlagELE,a.FlagVM,a.FlagRM,a.FlagSM,a.FlagUM,a.FlagVR,a.FlagSP,a.FlagOther,a.SchemeDate,a.PromiseLeaveDate,b.ExpectLeaveDate,a.TimeFee,a.PartFee,a.SchemeFee,a.OperaDepId,a.OperaId,a.OperaName,a.OperaTime,a.AttachmentId_Scheme,(select PerName+',' from (select distinct bb.PerName from Repair_Assignment aa left join sys_Person bb on aa.MainRepair=bb.ID where aa.FlagDel=0 and aa.IntentionId=b.ID ) a for xml path('')) as MainRepairs,a.SchemeDate_predict,a.AttachmentId_Scheme_predict,a.SchemeFee_predict,a.Memo,b.AttachmentId_Agreement ");
            strSql.Append("FROM repair_Scheme a ");
            strSql.Append("left join repair_Intention b on a.IntentionId=b.ID and b.FlagDel=0 ");
            strSql.Append("left join base_RepairType c on b.RepairTypeId=c.ID and c.FlagDel=0 ");
            strSql.Append("left join base_MachineModel d on b.MachineModelId=d.ID and d.FlagDel=0 ");
            strSql.Append("where a.FlagDel=0 and a.ID=@ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID", SqlDbType.Int, 4)
            };
            parameters[0].Value = ID;

            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            string AttachmentId_Scheme_predict = "";

            if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                AttachmentId_Scheme_predict = (ds.Tables[0].Rows[0]["AttachmentId_Scheme_predict"].ToString() == "" ? "" : ds.Tables[0].Rows[0]["AttachmentId_Scheme_predict"].ToString() + ",")
                ;
            }
            DataTable dt4 = new System.sys_Attachment().GetAttachment(AttachmentId_Scheme_predict);

            dt4.TableName = "AttachmentId_Scheme_predict";
            ds.Tables.Add(dt4.Copy());

            string AttachmentId_Scheme = "";

            if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                AttachmentId_Scheme = (ds.Tables[0].Rows[0]["AttachmentId_Scheme"].ToString() == "" ? "" : ds.Tables[0].Rows[0]["AttachmentId_Scheme"].ToString() + ",")
                ;
            }
            DataTable dt3 = new System.sys_Attachment().GetAttachment(AttachmentId_Scheme);

            dt3.TableName = "AttachmentId_Scheme";
            ds.Tables.Add(dt3.Copy());

            string AttachmentId_Agreement = "";

            if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                AttachmentId_Agreement = (ds.Tables[0].Rows[0]["AttachmentId_Agreement"].ToString() == "" ? "" : ds.Tables[0].Rows[0]["AttachmentId_Agreement"].ToString() + ",")
                ;
            }
            DataTable dt2 = new System.sys_Attachment().GetAttachment(AttachmentId_Agreement);

            dt2.TableName = "AttachmentId_Agreement";
            ds.Tables.Add(dt2.Copy());

            return(ds);
        }
Exemple #6
0
        /// <summary>
        /// 获得数据明细 通过ID
        /// </summary>
        public DataSet GetDetail(int ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select a.ID,a.ContractCode,a.ProjId,a.CompanyId,a.ProjType,a.ContractDate,a.ContractNat,a.StartDate,a.CompleteDate,a.Timescale,a.AttachmentId_Contract,a.AttachmentId_ControlCard,a.Memo,a.BillSign,a.BillState,a.OperaName,a.OperaTime,b.ProjName,c.CustName,d.PerName as SvcManagerName,e.PerName as ProjManagerName,f.CompanyName ");
            strSql.Append("FROM proj_Contract a ");
            strSql.Append("left join proj_Project b on a.ProjId=b.ID ");
            strSql.Append("left join base_Customer c on b.CustId=c.ID ");
            strSql.Append("left join sys_Person d on b.SvcManagerId=d.ID ");
            strSql.Append("left join sys_Person e on b.ProjManagerId=e.ID ");
            strSql.Append("left join base_Company f on a.CompanyId=f.ID ");
            strSql.Append("where a.FlagDel=0 and a.ID=@ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID", SqlDbType.Int, 4)
            };
            parameters[0].Value = ID;

            DataSet ds           = DbHelperSQL.Query(strSql.ToString(), parameters);
            string  AttachmentId = "";

            if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                AttachmentId = (ds.Tables[0].Rows[0]["AttachmentId_Contract"].ToString() == "" ? "" : ds.Tables[0].Rows[0]["AttachmentId_Contract"].ToString() + ",") +
                               (ds.Tables[0].Rows[0]["AttachmentId_ControlCard"].ToString() == "" ? "" : ds.Tables[0].Rows[0]["AttachmentId_ControlCard"].ToString() + ",")
                ;
            }
            DataTable dt = new System.sys_Attachment().GetAttachment(AttachmentId);

            dt.TableName = "attachment";
            ds.Tables.Add(dt.Copy());

            StringBuilder strSql2 = new StringBuilder();

            strSql2.Append("select a.ID,a.ContractId,a.Progress,a.ReceiveDate,a.ReceiveRate*100 as ReceiveRate,a.ReceiveNat,a.Memo ");
            strSql2.Append("FROM proj_ContractDetail a ");
            strSql2.Append("where a.FlagDel=0 and ContractId=@ContractId ");
            SqlParameter[] parameters2 =
            {
                new SqlParameter("@ContractId", SqlDbType.Int, 4)
            };
            parameters2[0].Value = ID;
            DataTable dt2 = DbHelperSQL.Query(strSql2.ToString(), parameters2).Tables[0];

            dt2.TableName = "ContractDetail";
            ds.Tables.Add(dt2.Copy());
            return(ds);
        }