hello

Thursday, 7 June 2012

Advance Search using dynamic colume and dynamic parameters






.aspx page :
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
            </asp:ToolkitScriptManager>
            <fieldset>
                <legend>***Advance Search***</legend>
                <fieldset>
                    <legend>****Select field****</legend>
                    <asp:CheckBoxList ID="CheckBoxList1" runat="server"  ForeColor="Black"
                        BackColor="White" BorderColor="Orange" BorderWidth="2" BorderStyle="Double" RepeatColumns="3"
                        Width="900">
                        <asp:ListItem Value="Ticket_No" Text="TICKET NO."></asp:ListItem>
                        <asp:ListItem Value="USER_NAME" Text="USER_NAME"></asp:ListItem>
                        <asp:ListItem Value="ISSUE_LOG_DATE_TIME" Text="ISSUE RAISE DATE TIME"></asp:ListItem>
                        <asp:ListItem Value="Issue_Title" Text="ISSUE TITLE "></asp:ListItem>
                        <asp:ListItem Value="Issue_Detail" Text="ISSUE DETAIL"></asp:ListItem>
                        <asp:ListItem Value="Issue_Type" Text="ISSUE TYPE"></asp:ListItem>
                        <asp:ListItem Value="EXPRESS_REMARKS" Text="EXPRESS REMARKS"></asp:ListItem>
                        <asp:ListItem Value="Issue_Resource" Text="ISSUE RESOURCE"></asp:ListItem>
                        <asp:ListItem Value="ALLOCATION_DATE_TIME" Text="ALLOCATION DATE TIME "></asp:ListItem>
                        <asp:ListItem Value="APPLICATION_TYPE" Text="APPLICATION TYPE"></asp:ListItem>
                        <asp:ListItem Value="APPLICATION" Text="ALLPICATION"></asp:ListItem>
                        <asp:ListItem Value="RESOURCE_ACCEPT" Text="ACCEPT BY RESOURCE"></asp:ListItem>
                        <asp:ListItem Value="RESOURCE_ACCEPT_DATE_TIME" Text="RESOURCE ACCEPT DATETIME"></asp:ListItem>
                        <asp:ListItem Value="ACTION" Text="ACTION"></asp:ListItem>
                        <asp:ListItem Value="ACTION_DETAL" Text="ACTION DETAIL"></asp:ListItem>
                        <asp:ListItem Value="RESOURCE_CLOSE_ISSUE_DATETIME" Text="RESOURCE CLOSE DATE TIME"></asp:ListItem>
                        <asp:ListItem Value="RESOURCE_ALLOCATOR" Text="RESOURCE ALLOCATOR"></asp:ListItem>
                        <asp:ListItem Value="USER_CLOSE_ISSUE_DATE_TIEM" Text="ISSUE CLOSE BY USER DATE TIME "></asp:ListItem>
                        <asp:ListItem Value="STATUS" Text="STATUS"></asp:ListItem>
                    </asp:CheckBoxList>
                </fieldset>
                <fieldset>
                    <legend>***Select Perameters</legend>
                    <table width="100%">
                        <tr>
                            <td>
                                ISSUE RAISE BY USER
                            </td>
                            <td>
                                FROM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp
                                <asp:TextBox ID="txtFromDate" runat="server"></asp:TextBox>
                                <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtFromDate">
                                </asp:CalendarExtender>
                                &nbsp&nbsp;&nbsp;&nbsp;&nbsp; TO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp:&nbsp&nbsp;&nbsp;
                                <asp:TextBox ID="txtTodate" runat="server"></asp:TextBox>
                                <asp:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtTodate">
                                </asp:CalendarExtender>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                ISSUE CLOSE BY RESOURCE
                            </td>
                            <td>
                                FROM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp
                                <asp:TextBox ID="txtICBRF" runat="server"></asp:TextBox>
                                <asp:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtICBRF">
                                </asp:CalendarExtender>
                                &nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp:&nbsp&nbsp;&nbsp;
                                <asp:TextBox ID="txtICBRT" runat="server"></asp:TextBox>
                                <asp:CalendarExtender ID="CalendarExtender4" runat="server" TargetControlID="txtICBRT">
                                </asp:CalendarExtender>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                ISSUE CLOSE BY USER
                            </td>
                            <td>
                                FROM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp
                                <asp:TextBox ID="txtICBUF" runat="server"></asp:TextBox>
                                <asp:CalendarExtender ID="CalendarExtender5" runat="server" TargetControlID="txtICBUF">
                                </asp:CalendarExtender>
                                &nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                &nbsp: &nbsp&nbsp;
                                <asp:TextBox ID="txtICBUT" runat="server"></asp:TextBox>
                                <asp:CalendarExtender ID="CalendarExtender6" runat="server" TargetControlID="txtICBUT">
                                </asp:CalendarExtender>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <br />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                APPLICATION TYPE WISE
                            </td>
                            <td>
                                &nbsp;<asp:DropDownList ID="DDLAPPTYPE2" runat="server" Width="168px" Height="35px">
                                </asp:DropDownList>
                                &nbsp;&nbsp;&nbsp; &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td>
                                APPLICATION WISE
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlApp" runat="server" Width="169px" Height="35px">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                RESOURCE WISE
                            </td>
                            <td>
                                <asp:DropDownList ID="DDLRES" runat="server" Width="171px" Height="35px">
                                </asp:DropDownList>
                            </td>
                        </tr>
                    </table>
                    <br />
                    <center>
                        <asp:Button ID="btnShow" runat="server" Text="Show" OnClick="btnShow_Click" /></center>
                </fieldset>
            </fieldset>
        </div>

.cs page:



    protected void btnShow_Click(object sender, EventArgs e)
    {
        string name = "";
        string str = "select  ";

        foreach (ListItem li in CheckBoxList1.Items)
        {
            if (li.Selected == true)
            {
                name = li.Value.ToString();
                str = str + name + ",";
            }
        }

        str = str.Substring(0, str.Length - 1);
        str = str + "" + " from showissuelog  where ";

        string[] filld = new string[6];
        string[] oper = new string[6];
        string[] val = new string[6];
        int k = 0;


        if (txtFromDate.Text != "" && txtTodate.Text != "")
        {
            filld[k] = "ISSUE_LOG_DATE_TIME";
            oper[k] = " between "; ;
            val[k] = "'" + txtFromDate.Text + "' and '" + txtTodate.Text + "'";
            k++;
        }

        if (txtICBRF.Text != "" && txtICBRT.Text != "")
        {
            filld[k] = "RESOURCE_CLOSE_ISSUE_DATETIME";
            oper[k] = " between "; ;
            val[k] = "'" + txtICBRF.Text + "' and '" + txtICBRT.Text + "'";
            k++;
        }


        if (txtICBUF.Text != "" && txtICBUT.Text != "")
        {
            filld[k] = "USER_CLOSE_ISSUE_DATE_TIEM";
            oper[k] = " between "; ;
            val[k] = "'" + txtICBUF.Text + "' and '" + txtICBUT.Text + "'";
            k++;
        }

        if (DDLAPPTYPE2.SelectedIndex > 0)
        {
            filld[k] = "Application_Type_Id";
            oper[k] = " = "; ;
            val[k] = "'" + DDLAPPTYPE2.SelectedValue + "' ";
            k++;
        }
        if (ddlApp.SelectedIndex > 0)
        {
            filld[k] = "Application_id";
            oper[k] = " = "; ;
            val[k] = "'" + ddlApp.SelectedValue + "' ";
            k++;
        }

        if (DDLRES.SelectedIndex > 0)
        {
            filld[k] = "Issue_Resource";
            oper[k] = " = "; ;
            val[k] = "'" + DDLRES.SelectedValue + "' ";
            k++;
        }
        for (int i = 0; i < k; i++)
        {
            str = str + filld[i] + oper[i] + val[i] + " and ";
        }


        str = str.Substring(0, str.Length - 4);
        ds = new DataSet();
        ds = objcls.selectds(str);
        ER.exlRet(ds);
    }

Wednesday, 30 May 2012

Conditional Cursur by anil kumar alwar rajasthan

create  proc [dbo].[RAIL_ALL_DATA_WITH_SUPPORT_EMP_ASSIGNER]
 @ASSIGNER2 as nvarchar(50)

as
begin
declare @same as nvarchar(100)
set @same=''
DECLARE @ACTION_ID as nvarchar(100)
DECLARE @OWNERE as nvarchar(100)
DECLARE @SUPPORT_EMPLOYEE as nvarchar(50)
DECLARE @ACTION_DATE as nvarchar(50)
DECLARE @ACTION_TITLE as nvarchar(150)
DECLARE @ACTION_DESC as nvarchar(max)
DECLARE @ASSIGNER as nvarchar(50)
DECLARE @PROJECT as nvarchar(50)
DECLARE @EXPECT_COM_DATE as nvarchar(50)
DECLARE @SOURCE_DESC as nvarchar(50)
DECLARE @FLAG_DESC as nvarchar(50)
DECLARE @ACC_REJ_DATE as nvarchar(50)
DECLARE @REJECT_REMARKS as nvarchar(50)
DECLARE @TARGET_DATE as nvarchar(50)
DECLARE @REMINDER_DESC as nvarchar(50)
DECLARE @FORWARD_TO as nvarchar(50)
DECLARE @FORWARD_DATE as nvarchar(50)
DECLARE @ACCEPT as nvarchar(50)
DECLARE CURSOR1 cursor for



select ACTION_ID,ACTION_DATE,OWNERE,SUPPORT_EMPLOYEE,ACTION_TITLE,ACTION_DESC,ASSIGNER,PROJECT,EXPECT_COM_DATE,SOURCE_DESC,FLAG_DESC,ACC_REJ_DATE,REJECT_REMARKS,TARGET_DATE,REMINDER_DESC,FORWARD_TO,FORWARD_DATE,ACCEPT from RAIL_ALL_DATA2 WHERE ASSIGNER=@ASSIGNER2

OPEN CURSOR1
FETCH NEXT FROM CURSOR1 INTO @ACTION_ID,@ACTION_DATE,@OWNERE,@SUPPORT_EMPLOYEE,@ACTION_TITLE,@ACTION_DESC,@ASSIGNER,@PROJECT,@EXPECT_COM_DATE,@SOURCE_DESC,@FLAG_DESC,@ACC_REJ_DATE,@REJECT_REMARKS,@TARGET_DATE,@REMINDER_DESC,@FORWARD_TO,@FORWARD_DATE,@ACCEPT
WHILE @@FETCH_STATUS <> -1
BEGIN
if(@ACTION_ID!=@same)
begin
insert into temp_dtt(ACTION_ID,ACTION_DATE,OWNERE,SUPPORT_EMPLOYEE,ACTION_TITLE,ACTION_DESC,ASSIGNER,PROJECT,EXPECT_COM_DATE,SOURCE_DESC,FLAG_DESC,ACC_REJ_DATE,REJECT_REMARKS,TARGET_DATE,REMINDER_DESC,FORWARD_TO,FORWARD_DATE,ACCEPT)values(@ACTION_ID,@ACTION_DATE,@OWNERE,@SUPPORT_EMPLOYEE,@ACTION_TITLE,@ACTION_DESC,@ASSIGNER,@PROJECT,@EXPECT_COM_DATE,@SOURCE_DESC,@FLAG_DESC,@ACC_REJ_DATE,@REJECT_REMARKS,@TARGET_DATE,@REMINDER_DESC,@FORWARD_TO,@FORWARD_DATE,@ACCEPT)
set @same=@ACTION_ID
end
else
begin
insert into temp_dtt(ACTION_ID,ACTION_DATE,OWNERE,SUPPORT_EMPLOYEE,ACTION_TITLE,ACTION_DESC,ASSIGNER,PROJECT,EXPECT_COM_DATE,SOURCE_DESC,FLAG_DESC,ACC_REJ_DATE,REJECT_REMARKS,TARGET_DATE,REMINDER_DESC,FORWARD_TO,FORWARD_DATE,ACCEPT)values('','','',@SUPPORT_EMPLOYEE,'','','','','','','','','','','','','','')
end

FETCH NEXT FROM CURSOR1 INTO @ACTION_ID,@ACTION_DATE,@OWNERE,@SUPPORT_EMPLOYEE,@ACTION_TITLE,@ACTION_DESC,@ASSIGNER,@PROJECT,@EXPECT_COM_DATE,@SOURCE_DESC,@FLAG_DESC,@ACC_REJ_DATE,@REJECT_REMARKS,@TARGET_DATE,@REMINDER_DESC,@FORWARD_TO,@FORWARD_DATE,@ACCEPT
END
CLOSE CURSOR1
DEALLOCATE CURSOR1
select * from temp_dtt
truncate table temp_dtt

end

Thursday, 24 May 2012

nesting of gridview by kumaranilaggarwal

.aspx
<fieldset>
                    <legend style="color: #669900; font-size: medium; font-weight: bold">Factor</legend>
                    <div style="height: 600px; overflow: scroll;">
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
                            Width="100%" ForeColor="#333333" GridLines="None">
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" CssClass="ll" />
                            <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <Columns>
                                <asp:TemplateField HeaderText="Factor" HeaderStyle-CssClass="ll">
                                    <ItemTemplate>
                                        <asp:HiddenField ID="Label2" runat="server" Value='<%# Eval("fact_id") %>'></asp:HiddenField>
                                        <asp:Label ID="lblfactor" runat="server" Text='<%# Eval("fact_desc") %>' Width="200"></asp:Label>
                                        <asp:TextBox ID="txtFactor" runat="server" Width="70"></asp:TextBox>
                                    </ItemTemplate>
                                    <HeaderStyle CssClass="ll"></HeaderStyle>
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:GridView ID="GridView2" runat="server" CssClass="ll" AutoGenerateColumns="false"
                                            Width="100%" ShowHeader="true">
                                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                            <Columns>
                                                <asp:TemplateField HeaderText="SubFactor" HeaderStyle-CssClass="ll">
                                                    <ItemTemplate>
                                                        <asp:HiddenField ID="Label21" runat="server" Value='<%# Eval("fact_dtl_id") %>' />
                                                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("fact_dtl_desc") %>' Width="200"></asp:Label>
                                                        <asp:TextBox ID="txtSubFactor" runat="server" Width="70"></asp:TextBox>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <asp:GridView ID="GridView3" CssClass="ll" runat="server" AutoGenerateColumns="false"
                                                            Width="100%" ShowHeader="true">
                                                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                                            <Columns>
                                                                <asp:TemplateField HeaderText="SubFactorDetail" HeaderStyle-CssClass="ll">
                                                                    <ItemTemplate>
                                                                        <asp:HiddenField ID="Label2id" runat="server" Value='<%# Eval("fact_subdtl_id") %>' />
                                                                        <asp:Label ID="Label111" runat="server" Text='<%# Eval("fact_subdtl_desc") %>' Width="200"></asp:Label>
                                                                        <asp:TextBox ID="txtCalculation" runat="server" Width="70"></asp:TextBox>
                                                                    </ItemTemplate>
                                                                </asp:TemplateField>
                                                            </Columns>
                                                        </asp:GridView>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                        </asp:GridView>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EditRowStyle BackColor="#999999" />
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        </asp:GridView>
                    </div>
                </fieldset>


.cs
 public void fill()
    {
        string s = "select * from fact_mst";
        ds = c1.selectds(s);
        GridView1.DataSource = ds;
        GridView1.DataBind();
        SecondGridBind();
    }

    protected void SecondGridBind()
    {
        foreach (GridViewRow row in GridView1.Rows)
        {
            HiddenField lblid = row.FindControl("Label2") as HiddenField;
            GridView GridView2 = row.FindControl("GridView2") as GridView;
            string str = "select * from  fact_dtl_mst where fact_id='" + lblid.Value + "'";
            ds = c1.selectds(str);
            GridView2.DataSource = ds;
            GridView2.DataBind();
            foreach (GridViewRow rows in GridView2.Rows)
            {
                HiddenField lblid3 = rows.FindControl("Label21") as HiddenField;
                GridView GridView3 = rows.FindControl("GridView3") as GridView;
                string str3 = "select * from  fact_subdtl_mst where fact_dtl_id='" + lblid3.Value + "'";
                ds = c1.selectds(str3);
                GridView3.DataSource = ds;
                GridView3.DataBind();

            }
        }
    }

Wednesday, 4 April 2012

Friday, 23 September 2011

My Project

N=BUSSNESS ERP
MARKETING MANAGMENT
ENVENTORY MANAGMENT
STOCK MANAGMENT
IN ERICSSON
(OEE FOR RADIOUS TESTING, DPL,ISS,OMS,HRMDB,VMS,OIL,RAIL,ASR,HR TRAINING MODUAL)
HOTEL PORTAL
HOTEL MANAGMENT

Thursday, 18 August 2011

how stop cut copy pest

<asp:TextBox ID="TextBox1" runat="server"
oncopy="return false"
onpaste="return false"
oncut="return false">
</asp:TextBox>