Пример #1
0
    public void BindOrders()
    {
        string query = @" select cl.emp_id,(select empname from employee where emp_id=cl.emp_id)[Employee Name],
(select company_name from company where company_id=cl.client)[Client Name],--cl.client,
(select ProjectName from empprojects where projid=cl.project)[Project Name],--cl.project,
(select DeliveryModel from Delivery_Model where deliverymodelid=cl.DeliveryModel)[Delivery Model],--cl.DeliveryModel,
(select SC_NAME from Delivery_Model_SubCla where sc_id=cl.SubClass)[Sub Classification],--cl.SubClass,
Case when ((select TOP 1 Revenue_Currency from RM_CtcRevMaster where emp_id=cl.EMP_ID order by EDateRev desc)=0) THEN 'INR'
ELSE (Case when ((select TOP 1 Revenue_Currency from RM_CtcRevMaster where emp_id=cl.EMP_ID order by EDateRev desc)=1) THEN 'USD' ELSE 'NULL' end) END as
RevenueCurrency,
(select TOP 1 Revenue from RM_CtcRevMaster where emp_id=cl.EMP_ID order by EDateRev desc)Revenue,
CASE WHEN (select TOP 1 Revenue_Currency from RM_CtcRevMaster where emp_id=cl.EMP_ID order by EDateRev desc)=0 then 
((select TOP 1 Revenue from RM_CtcRevMaster where emp_id=cl.EMP_ID order by EDateRev desc)) else 
((select TOP 1 Revenue from RM_CtcRevMaster where emp_id=cl.EMP_ID order by EDateRev desc)*65) end as [Revenue INR],
CASE WHEN (select TOP 1 Revenue_Currency from RM_CtcRevMaster where emp_id=cl.EMP_ID order by EDateRev desc)=1 then 
((select TOP 1 Revenue from RM_CtcRevMaster where emp_id=cl.EMP_ID order by EDateRev desc)) 
else ((select TOP 1 Revenue from RM_CtcRevMaster where emp_id=cl.EMP_ID order by EDateRev desc)/65) end as [Revenue USD], 
(select o.PONO from OB_POSOWMSA o where o.emp_id=cl.EMP_ID) [PONO],(select o.PO_StartDate from OB_POSOWMSA o where o.emp_id=cl.EMP_ID) [PO_StartDate], (select o.PO_EndDate from OB_POSOWMSA o where o.emp_id=cl.EMP_ID)  [PO_EndDate],
(select o.SOW from OB_POSOWMSA o where o.emp_id=cl.EMP_ID) [SOW],(select o.SOW_StartDate from OB_POSOWMSA o where o.emp_id=cl.EMP_ID) [SOW_StartDate], (select o.SOW_EndDate from OB_POSOWMSA o where o.emp_id=cl.EMP_ID) [SOW_EndDate],
(select o.MSA from OB_POSOWMSA o where o.emp_id=cl.EMP_ID) [MSA],(select o.MSA_StartDate from OB_POSOWMSA o where o.emp_id=cl.EMP_ID)  [MSA_StartDate],(select o.MSA_EndDate from OB_POSOWMSA o where o.emp_id=cl.EMP_ID)  [MSA_EndDate],
(select o.Status from OB_POSOWMSA o where o.emp_id=cl.EMP_ID) [Status]
from clntass cl where cl.RtnFrmClnt is null and cl.status in (0,1) and cl.FinanceStatus=1 and cl.SubClass<>4 order by [Employee Name]";

        DataTable dt = sqlDB.AdapterGetData(query, CommandType.Text, _sqlParameter);

        _sqlParameter             = null;
        RadGridaccount.DataSource = dt;
    }