Showing posts with label users. Show all posts
Showing posts with label users. Show all posts

Saturday, March 31, 2012

Session time-out,when the page breaks?

Hi..

I had published a website in the server( I am using VS 2005,ASP.NET2.0, With C#) . I tried testing the site by asking several users to login to the website and do unit testing. At one instance of time, the page breaks for a particular user. When the page breaks, the other users who are tesing in their machine are getting a session time-out and are forced to log out.

Why is such a session-time out issue happening, when one of the users page breaks. I have set the session variable to 20 minutes,which is the default. But what's confusing is , when one of the user's page breaks, the others get a session time-out? Why is such a session-time out occuring?

Please help.

Thanks.

What do you mean when you say "the page breaks?" If an app pool cycles you might see this effect. Have you diagnosed the "page break" to see what happens?

Jeff


Thank you very much for the reply.

The page break, I referred is the page crashing(asp.net error page) .I have customized the error page to show, An Unexpected error occurred, please try after some time.

But when the user tries the same steps to find the page crash, he is not able to, as the page works well. This is a kind of absurd. The page is not crashing always, but it is random. I checked the log, but it was not providing much information. I also could not re-trace the page crash, as the page worked well.

But why is the session getting timed out for the other users, when one of the users page crashes?

Thanks.


Hi..

I am sorry that I forgot to include a scenario in my web page,which i am doing. I have written a code to delete a folder in the session end in global.asax. When i commented the code, and tried testing, the session time out was not occuring.

I searched in the google, and came out with this:

http://www.velocityreviews.com/forums/t116975-all-session-are-getting-down-when-i-delete-sessions-folders.html

Is this the reason for all sessions getting timed-out, when a page crashes?

Thanks


Hi Venkatzeus,

As far as i know, if you delete a folder which is in your application directory, the appDomain will restart, and you will lose your session.

I hope this helps.


This happens as your worker process memory limits get full and asp.net worker process gets restarted. how to do this setting you can find at

http://www.asp.net/faq/AspNetAndIIS6.aspx

But I think you needs to findout why its getting full.

When you get this error check server CPU Usage what it shows?

then debug.


HI,,

Thank you very much for the reply. I will try with it and provide the results.

Thanks

Session Timeout.

Friends,
We have a simple application which has login page, users login to it
and enter their contact details and all other stuff. It is working
fine. Now we have moved to new windows 2003 server. The page works
but it gets refreshed every 5 mintues and goes back to login.aspx page.
How do I fix this.
Thanks for any help.
KAdd this in your Web.config file to elongate Session to 60min for example:
<sessionState cookieless="UseCookies" mode="InProc" timeout="60" />
but add it between
<system.web> </system.web>
--
Bishoy George
bishoy@.bishoy.com
20102550399
"Sai" <kumar877@.gmail.com> wrote in message
news:1145074352.770881.44720@.u72g2000cwu.googlegroups.com...
> Friends,
> We have a simple application which has login page, users login to it
> and enter their contact details and all other stuff. It is working
> fine. Now we have moved to new windows 2003 server. The page works
> but it gets refreshed every 5 mintues and goes back to login.aspx page.
> How do I fix this.
> Thanks for any help.
> K
>
no that did not help. same thing is happening again.
Do you have code in your page to redirect to your login page? Sounds like
your session is timing out and your code is kicking in to repost. Write some
code in your session_end event handler to dump a file with a time-stamp to
tell you when the session is dying. You can trouble-shoot from there.
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
----
"Sai" <kumar877@.gmail.com> wrote in message
news:1145116360.101576.258960@.i40g2000cwc.googlegroups.com...
> no that did not help. same thing is happening again.
>
Hi Alvin,
thanks for the advise. Iam inputting the values to a text file when
session times out. It is coming as 60 seconds. So the session is
timing out at every 60 seconds, but I could not find where to change
these value. I checked the web.config and machine.config and
application pools .
Let me know specific place to change this value.
thanks,
K
So you have an override somewhere in your code because the timeout value is
20 minutes by default. Search your code for that value. Alternatively, it
may be overridden in the web.config file. As a quick test, you can set
session.timeout = 10 minutes. It should stick otherwise, you have something
funky going on in your app that you either don't know about or aren't
sharing.
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
----
"Sai" <kumar877@.gmail.com> wrote in message
news:1145288352.456543.4650@.t31g2000cwb.googlegroups.com...
> Hi Alvin,
> thanks for the advise. Iam inputting the values to a text file when
> session times out. It is coming as 60 seconds. So the session is
> timing out at every 60 seconds, but I could not find where to change
> these value. I checked the web.config and machine.config and
> application pools .
> Let me know specific place to change this value.
> thanks,
> K
>
Nothing in the code, nothing in the web.config. It has to be some
other place. I have seen all my code and no where I am setting these
values.
I tried changing session timeout to 10 minutes and still nothing
happens. So it got to be some where, not that simple.
Where else it can be.?
Thanks.
K
you need that check. go back and put it in there so that your application
can be resilient to memory issues. However, raise the limit to around 1gig
or so. The reason for this is that the application pool should be recycled
if an errant application (your code) decides to hog memory. Removing that
check prevents detection of this and other conditions.
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
----
"Sai" <kumar877@.gmail.com> wrote in message
news:1145306983.181641.177810@.i40g2000cwc.googlegroups.com...
> Thanks for all your help. It got fixed just now. The problem is
> Virtual memory was so low (250MB), so every time a worker process
> initiates it goes to 250 MB and it recycles, so what we did was, we
> just removed the check box next to virtual memory of application pool.
> that's it. It works...great relief.
> Thanks,
> K
>
Thanks for all your help. It got fixed just now. The problem is
Virtual memory was so low (250MB), so every time a worker process
initiates it goes to 250 MB and it recycles, so what we did was, we
just removed the check box next to virtual memory of application pool.
that's it. It works...great relief.
Thanks,
K
Where is the Virtual memory checked/set? Somewhere in IIS?
Ron

Session Timeout.

Friends,

We have a simple application which has login page, users login to it
and enter their contact details and all other stuff. It is working
fine. Now we have moved to new windows 2003 server. The page works
but it gets refreshed every 5 mintues and goes back to login.aspx page.
How do I fix this.

Thanks for any help.

KAdd this in your Web.config file to elongate Session to 60min for example:

<sessionState cookieless="UseCookies" mode="InProc" timeout="60" /
but add it between
<system.web> </system.web>
--

Bishoy George
bishoy@.bishoy.com
20102550399

--------

"Sai" <kumar877@.gmail.com> wrote in message
news:1145074352.770881.44720@.u72g2000cwu.googlegro ups.com...
> Friends,
> We have a simple application which has login page, users login to it
> and enter their contact details and all other stuff. It is working
> fine. Now we have moved to new windows 2003 server. The page works
> but it gets refreshed every 5 mintues and goes back to login.aspx page.
> How do I fix this.
> Thanks for any help.
> K
no that did not help. same thing is happening again.
Do you have code in your page to redirect to your login page? Sounds like
your session is timing out and your code is kicking in to repost. Write some
code in your session_end event handler to dump a file with a time-stamp to
tell you when the session is dying. You can trouble-shoot from there.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
-----------------

"Sai" <kumar877@.gmail.com> wrote in message
news:1145116360.101576.258960@.i40g2000cwc.googlegr oups.com...
> no that did not help. same thing is happening again.
Hi Alvin,

thanks for the advise. Iam inputting the values to a text file when
session times out. It is coming as 60 seconds. So the session is
timing out at every 60 seconds, but I could not find where to change
these value. I checked the web.config and machine.config and
application pools .

Let me know specific place to change this value.

thanks,
K
So you have an override somewhere in your code because the timeout value is
20 minutes by default. Search your code for that value. Alternatively, it
may be overridden in the web.config file. As a quick test, you can set
session.timeout = 10 minutes. It should stick otherwise, you have something
funky going on in your app that you either don't know about or aren't
sharing.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
-----------------

"Sai" <kumar877@.gmail.com> wrote in message
news:1145288352.456543.4650@.t31g2000cwb.googlegrou ps.com...
> Hi Alvin,
> thanks for the advise. Iam inputting the values to a text file when
> session times out. It is coming as 60 seconds. So the session is
> timing out at every 60 seconds, but I could not find where to change
> these value. I checked the web.config and machine.config and
> application pools .
> Let me know specific place to change this value.
> thanks,
> K
Nothing in the code, nothing in the web.config. It has to be some
other place. I have seen all my code and no where I am setting these
values.
I tried changing session timeout to 10 minutes and still nothing
happens. So it got to be some where, not that simple.
Where else it can be.?

Thanks.
K
Thanks for all your help. It got fixed just now. The problem is
Virtual memory was so low (250MB), so every time a worker process
initiates it goes to 250 MB and it recycles, so what we did was, we
just removed the check box next to virtual memory of application pool.
that's it. It works...great relief.

Thanks,
K
you need that check. go back and put it in there so that your application
can be resilient to memory issues. However, raise the limit to around 1gig
or so. The reason for this is that the application pool should be recycled
if an errant application (your code) decides to hog memory. Removing that
check prevents detection of this and other conditions.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
-----------------

"Sai" <kumar877@.gmail.com> wrote in message
news:1145306983.181641.177810@.i40g2000cwc.googlegr oups.com...
> Thanks for all your help. It got fixed just now. The problem is
> Virtual memory was so low (250MB), so every time a worker process
> initiates it goes to 250 MB and it recycles, so what we did was, we
> just removed the check box next to virtual memory of application pool.
> that's it. It works...great relief.
> Thanks,
> K
Where is the Virtual memory checked/set? Somewhere in IIS?

Ron
it's under one of the application pool health monitoring tabs in IIS

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
-----------------

"RonL" <sal_paradise_93@.yahoo.com> wrote in message
news:1145322157.561147.218050@.j33g2000cwa.googlegr oups.com...
> Where is the Virtual memory checked/set? Somewhere in IIS?
> Ron
I couldn't find it. I see you're talking about Windows 2003 and I'm
looking at IIS 5 and XP Pro on my local machine.

Ron
IIS 5 doesn't have these characteristics. sorry.

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Professional VSTO.NET - Wrox/Wiley 2006
-----------------

"RonL" <sal_paradise_93@.yahoo.com> wrote in message
news:1145411388.245339.46900@.i40g2000cwc.googlegro ups.com...
>I couldn't find it. I see you're talking about Windows 2003 and I'm
> looking at IIS 5 and XP Pro on my local machine.
> Ron

Session Time-out?

Hi,
I know this is an old problem and I've googled for it, but I've not really gotten wiser ...
My problem is the following:
I want my users to log on and then edit or add data via web forms. Sofar, so good. But I want to prevent time-outs so they don't have to logon continuously nor do I want to risk them to lose their data if thesession has expired before they could save it.
What's the best way to do that?
I've set the time-out in my web.config to 60, but that doesn't really change a thing.
Thanks a lot.
you can increase the timeout period as much as you want, but you'll be in rist of overloading your server's memory with sessions

Session users

How i can show all current session users like

Session("UserName")What do u mean ? u mean how to display or print a session variable ?

Response.Write(Session("UserName"))

Good Luck.
the Session is only for the context of the current user.

if you want all current users that happen to have a session open, youd need to keep track of that at the application level or in a DB.

perhaps add an entry at session start and remove it at session end.

Thursday, March 29, 2012

Session variable are shared between users

Hi,
I keep several variables in a statevalue like:
Dim session As SessionState.HttpSessionState =
System.Web.HttpContext.Current.Session

session("connect") = " FKHFSF "

I thought that these variables would be the exclusive use of one connected
user/connection. But it looks like that in a multiuser enviroment some
variables are shared. So I end on the page somenone else was editing.

What am I missing here. (I have not modified any property of the session
variable)

TonNo other code than that ? It looks like it should work (of course all users
will have the same connect value if you store always FKHFSF for all users).
What if you are using directly System.Web.HttpContext.Current.Session.

Other than that , it would like as if you were using a shared property
somewhere...

Patrice

"ton" <vrs@.REMOVEhome.nl> a crit dans le message de
news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
> Hi,
> I keep several variables in a statevalue like:
> Dim session As SessionState.HttpSessionState =
> System.Web.HttpContext.Current.Session
> session("connect") = " FKHFSF "
> I thought that these variables would be the exclusive use of one connected
> user/connection. But it looks like that in a multiuser enviroment some
> variables are shared. So I end on the page somenone else was editing.
> What am I missing here. (I have not modified any property of the session
> variable)
> Ton
No other code than that ! I save the logged in user, the page where I, the
details, the recordID of the record they asked.

but when 2 users connect via internet with my page, the values get mixed up.
I have to say that I've developed a Customserver control and that is using
the state variable

Ton

"Patrice" <nobody@.nowhere.com> schreef in bericht
news:eZGEnYLGEHA.1720@.tk2msftngp13.phx.gbl...
> No other code than that ? It looks like it should work (of course all
users
> will have the same connect value if you store always FKHFSF for all
users).
> What if you are using directly System.Web.HttpContext.Current.Session.
> Other than that , it would like as if you were using a shared property
> somewhere...
> Patrice
>
> "ton" <vrs@.REMOVEhome.nl> a crit dans le message de
> news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
> > Hi,
> > I keep several variables in a statevalue like:
> > Dim session As SessionState.HttpSessionState =
> > System.Web.HttpContext.Current.Session
> > session("connect") = " FKHFSF "
> > I thought that these variables would be the exclusive use of one
connected
> > user/connection. But it looks like that in a multiuser enviroment some
> > variables are shared. So I end on the page somenone else was editing.
> > What am I missing here. (I have not modified any property of the session
> > variable)
> > Ton
No other code than that ! I save the logged in user, the page where I, the
details, the recordID of the record they asked.

but when 2 users connect via internet with my page, the values get mixed up.
I have to say that I've developed a Customserver control and that is using
the state variable

Ton

"Patrice" <nobody@.nowhere.com> schreef in bericht
news:eZGEnYLGEHA.1720@.tk2msftngp13.phx.gbl...
> No other code than that ? It looks like it should work (of course all
users
> will have the same connect value if you store always FKHFSF for all
users).
> What if you are using directly System.Web.HttpContext.Current.Session.
> Other than that , it would like as if you were using a shared property
> somewhere...
> Patrice
>
> "ton" <vrs@.REMOVEhome.nl> a crit dans le message de
> news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
> > Hi,
> > I keep several variables in a statevalue like:
> > Dim session As SessionState.HttpSessionState =
> > System.Web.HttpContext.Current.Session
> > session("connect") = " FKHFSF "
> > I thought that these variables would be the exclusive use of one
connected
> > user/connection. But it looks like that in a multiuser enviroment some
> > variables are shared. So I end on the page somenone else was editing.
> > What am I missing here. (I have not modified any property of the session
> > variable)
> > Ton

Session variable are shared between users

Hi,
I keep several variables in a statevalue like:
Dim session As SessionState.HttpSessionState =
System.Web.HttpContext.Current.Session

session("connect") = " FKHFSF "

I thought that these variables would be the exclusive use of one connected
user/connection. But it looks like that in a multiuser enviroment some
variables are shared. So I end on the page somenone else was editing.

What am I missing here. (I have not modified any property of the session
variable)

TonNo other code than that ? It looks like it should work (of course all users
will have the same connect value if you store always FKHFSF for all users).
What if you are using directly System.Web.HttpContext.Current.Session.

Other than that , it would like as if you were using a shared property
somewhere...

Patrice

"ton" <vrs@.REMOVEhome.nl> a crit dans le message de
news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
> Hi,
> I keep several variables in a statevalue like:
> Dim session As SessionState.HttpSessionState =
> System.Web.HttpContext.Current.Session
> session("connect") = " FKHFSF "
> I thought that these variables would be the exclusive use of one connected
> user/connection. But it looks like that in a multiuser enviroment some
> variables are shared. So I end on the page somenone else was editing.
> What am I missing here. (I have not modified any property of the session
> variable)
> Ton
No other code than that ! I save the logged in user, the page where I, the
details, the recordID of the record they asked.

but when 2 users connect via internet with my page, the values get mixed up.
I have to say that I've developed a Customserver control and that is using
the state variable

Ton

"Patrice" <nobody@.nowhere.com> schreef in bericht
news:eZGEnYLGEHA.1720@.tk2msftngp13.phx.gbl...
> No other code than that ? It looks like it should work (of course all
users
> will have the same connect value if you store always FKHFSF for all
users).
> What if you are using directly System.Web.HttpContext.Current.Session.
> Other than that , it would like as if you were using a shared property
> somewhere...
> Patrice
>
> "ton" <vrs@.REMOVEhome.nl> a crit dans le message de
> news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
> > Hi,
> > I keep several variables in a statevalue like:
> > Dim session As SessionState.HttpSessionState =
> > System.Web.HttpContext.Current.Session
> > session("connect") = " FKHFSF "
> > I thought that these variables would be the exclusive use of one
connected
> > user/connection. But it looks like that in a multiuser enviroment some
> > variables are shared. So I end on the page somenone else was editing.
> > What am I missing here. (I have not modified any property of the session
> > variable)
> > Ton
No other code than that ! I save the logged in user, the page where I, the
details, the recordID of the record they asked.

but when 2 users connect via internet with my page, the values get mixed up.
I have to say that I've developed a Customserver control and that is using
the state variable

Ton

"Patrice" <nobody@.nowhere.com> schreef in bericht
news:eZGEnYLGEHA.1720@.tk2msftngp13.phx.gbl...
> No other code than that ? It looks like it should work (of course all
users
> will have the same connect value if you store always FKHFSF for all
users).
> What if you are using directly System.Web.HttpContext.Current.Session.
> Other than that , it would like as if you were using a shared property
> somewhere...
> Patrice
>
> "ton" <vrs@.REMOVEhome.nl> a crit dans le message de
> news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
> > Hi,
> > I keep several variables in a statevalue like:
> > Dim session As SessionState.HttpSessionState =
> > System.Web.HttpContext.Current.Session
> > session("connect") = " FKHFSF "
> > I thought that these variables would be the exclusive use of one
connected
> > user/connection. But it looks like that in a multiuser enviroment some
> > variables are shared. So I end on the page somenone else was editing.
> > What am I missing here. (I have not modified any property of the session
> > variable)
> > Ton
Ho do you test the multi-user environment?
Do you just open up the second browser?
If you opening it by using new window then you get the same session.
It's by design (of Browser).

Try to do the real test. From 2 different machines for example.

I can assure you that it works (unless your system is messed up big time)

George.

"ton" <vrs@.REMOVEhome.nl> wrote in message
news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
> Hi,
> I keep several variables in a statevalue like:
> Dim session As SessionState.HttpSessionState =
> System.Web.HttpContext.Current.Session
> session("connect") = " FKHFSF "
> I thought that these variables would be the exclusive use of one connected
> user/connection. But it looks like that in a multiuser enviroment some
> variables are shared. So I end on the page somenone else was editing.
> What am I missing here. (I have not modified any property of the session
> variable)
> Ton
it does not work on a second system.
But I've solved it allready. It looks that using sessionstate variables in a
customserver control is not reliable.
I've changed it to viewstate and now it works. Allthough I have to save de
logon values in a sessionstate, then when opening the second page (with
another customservercontrol) I read the sessionstate variable and save them
in viewstate. With these variabele I keep on using without any problem when
other users are opening the same page.

ton

"George Ter-Saakov" <nospam@.hotmail.com> schreef in bericht
news:eiLqniwGEHA.3068@.TK2MSFTNGP11.phx.gbl...
> Ho do you test the multi-user environment?
> Do you just open up the second browser?
> If you opening it by using new window then you get the same session.
> It's by design (of Browser).
> Try to do the real test. From 2 different machines for example.
> I can assure you that it works (unless your system is messed up big time)
> George.
> "ton" <vrs@.REMOVEhome.nl> wrote in message
> news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
> > Hi,
> > I keep several variables in a statevalue like:
> > Dim session As SessionState.HttpSessionState =
> > System.Web.HttpContext.Current.Session
> > session("connect") = " FKHFSF "
> > I thought that these variables would be the exclusive use of one
connected
> > user/connection. But it looks like that in a multiuser enviroment some
> > variables are shared. So I end on the page somenone else was editing.
> > What am I missing here. (I have not modified any property of the session
> > variable)
> > Ton

Session variable are shared between users

Hi,
I keep several variables in a statevalue like:
Dim session As SessionState.HttpSessionState =
System.Web.HttpContext.Current.Session

session("connect") = " FKHFSF "

I thought that these variables would be the exclusive use of one connected
user/connection. But it looks like that in a multiuser enviroment some
variables are shared. So I end on the page somenone else was editing.

What am I missing here. (I have not modified any property of the session
variable)

TonNo other code than that ? It looks like it should work (of course all users
will have the same connect value if you store always FKHFSF for all users).
What if you are using directly System.Web.HttpContext.Current.Session.

Other than that , it would like as if you were using a shared property
somewhere...

Patrice

"ton" <vrs@.REMOVEhome.nl> a crit dans le message de
news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
> Hi,
> I keep several variables in a statevalue like:
> Dim session As SessionState.HttpSessionState =
> System.Web.HttpContext.Current.Session
> session("connect") = " FKHFSF "
> I thought that these variables would be the exclusive use of one connected
> user/connection. But it looks like that in a multiuser enviroment some
> variables are shared. So I end on the page somenone else was editing.
> What am I missing here. (I have not modified any property of the session
> variable)
> Ton
No other code than that ! I save the logged in user, the page where I, the
details, the recordID of the record they asked.

but when 2 users connect via internet with my page, the values get mixed up.
I have to say that I've developed a Customserver control and that is using
the state variable

Ton

"Patrice" <nobody@.nowhere.com> schreef in bericht
news:eZGEnYLGEHA.1720@.tk2msftngp13.phx.gbl...
> No other code than that ? It looks like it should work (of course all
users
> will have the same connect value if you store always FKHFSF for all
users).
> What if you are using directly System.Web.HttpContext.Current.Session.
> Other than that , it would like as if you were using a shared property
> somewhere...
> Patrice
>
> "ton" <vrs@.REMOVEhome.nl> a crit dans le message de
> news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
> > Hi,
> > I keep several variables in a statevalue like:
> > Dim session As SessionState.HttpSessionState =
> > System.Web.HttpContext.Current.Session
> > session("connect") = " FKHFSF "
> > I thought that these variables would be the exclusive use of one
connected
> > user/connection. But it looks like that in a multiuser enviroment some
> > variables are shared. So I end on the page somenone else was editing.
> > What am I missing here. (I have not modified any property of the session
> > variable)
> > Ton
No other code than that ! I save the logged in user, the page where I, the
details, the recordID of the record they asked.

but when 2 users connect via internet with my page, the values get mixed up.
I have to say that I've developed a Customserver control and that is using
the state variable

Ton

"Patrice" <nobody@.nowhere.com> schreef in bericht
news:eZGEnYLGEHA.1720@.tk2msftngp13.phx.gbl...
> No other code than that ? It looks like it should work (of course all
users
> will have the same connect value if you store always FKHFSF for all
users).
> What if you are using directly System.Web.HttpContext.Current.Session.
> Other than that , it would like as if you were using a shared property
> somewhere...
> Patrice
>
> "ton" <vrs@.REMOVEhome.nl> a crit dans le message de
> news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
> > Hi,
> > I keep several variables in a statevalue like:
> > Dim session As SessionState.HttpSessionState =
> > System.Web.HttpContext.Current.Session
> > session("connect") = " FKHFSF "
> > I thought that these variables would be the exclusive use of one
connected
> > user/connection. But it looks like that in a multiuser enviroment some
> > variables are shared. So I end on the page somenone else was editing.
> > What am I missing here. (I have not modified any property of the session
> > variable)
> > Ton
Ho do you test the multi-user environment?
Do you just open up the second browser?
If you opening it by using new window then you get the same session.
It's by design (of Browser).

Try to do the real test. From 2 different machines for example.

I can assure you that it works (unless your system is messed up big time)

George.

"ton" <vrs@.REMOVEhome.nl> wrote in message
news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
> Hi,
> I keep several variables in a statevalue like:
> Dim session As SessionState.HttpSessionState =
> System.Web.HttpContext.Current.Session
> session("connect") = " FKHFSF "
> I thought that these variables would be the exclusive use of one connected
> user/connection. But it looks like that in a multiuser enviroment some
> variables are shared. So I end on the page somenone else was editing.
> What am I missing here. (I have not modified any property of the session
> variable)
> Ton
it does not work on a second system.
But I've solved it allready. It looks that using sessionstate variables in a
customserver control is not reliable.
I've changed it to viewstate and now it works. Allthough I have to save de
logon values in a sessionstate, then when opening the second page (with
another customservercontrol) I read the sessionstate variable and save them
in viewstate. With these variabele I keep on using without any problem when
other users are opening the same page.

ton

"George Ter-Saakov" <nospam@.hotmail.com> schreef in bericht
news:eiLqniwGEHA.3068@.TK2MSFTNGP11.phx.gbl...
> Ho do you test the multi-user environment?
> Do you just open up the second browser?
> If you opening it by using new window then you get the same session.
> It's by design (of Browser).
> Try to do the real test. From 2 different machines for example.
> I can assure you that it works (unless your system is messed up big time)
> George.
> "ton" <vrs@.REMOVEhome.nl> wrote in message
> news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
> > Hi,
> > I keep several variables in a statevalue like:
> > Dim session As SessionState.HttpSessionState =
> > System.Web.HttpContext.Current.Session
> > session("connect") = " FKHFSF "
> > I thought that these variables would be the exclusive use of one
connected
> > user/connection. But it looks like that in a multiuser enviroment some
> > variables are shared. So I end on the page somenone else was editing.
> > What am I missing here. (I have not modified any property of the session
> > variable)
> > Ton

Session variable are shared between users

Hi,
I keep several variables in a statevalue like:
Dim session As SessionState.HttpSessionState =
System.Web.HttpContext.Current.Session
session("connect") = " FKHFSF "
I thought that these variables would be the exclusive use of one connected
user/connection. But it looks like that in a multiuser enviroment some
variables are shared. So I end on the page somenone else was editing.
What am I missing here. (I have not modified any property of the session
variable)
TonNo other code than that ? It looks like it should work (of course all users
will have the same connect value if you store always FKHFSF for all users).
What if you are using directly System.Web.HttpContext.Current.Session.
Other than that , it would like as if you were using a shared property
somewhere...
Patrice
"ton" <vrs@.REMOVEhome.nl> a crit dans le message de
news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
> Hi,
> I keep several variables in a statevalue like:
> Dim session As SessionState.HttpSessionState =
> System.Web.HttpContext.Current.Session
> session("connect") = " FKHFSF "
> I thought that these variables would be the exclusive use of one connected
> user/connection. But it looks like that in a multiuser enviroment some
> variables are shared. So I end on the page somenone else was editing.
> What am I missing here. (I have not modified any property of the session
> variable)
> Ton
>
No other code than that ! I save the logged in user, the page where I, the
details, the recordID of the record they asked.
but when 2 users connect via internet with my page, the values get mixed up.
I have to say that I've developed a Customserver control and that is using
the state variable
Ton
"Patrice" <nobody@.nowhere.com> schreef in bericht
news:eZGEnYLGEHA.1720@.tk2msftngp13.phx.gbl...
> No other code than that ? It looks like it should work (of course all
users
> will have the same connect value if you store always FKHFSF for all
users).
> What if you are using directly System.Web.HttpContext.Current.Session.
> Other than that , it would like as if you were using a shared property
> somewhere...
> Patrice
>
> "ton" <vrs@.REMOVEhome.nl> a crit dans le message de
> news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
connected
>
No other code than that ! I save the logged in user, the page where I, the
details, the recordID of the record they asked.
but when 2 users connect via internet with my page, the values get mixed up.
I have to say that I've developed a Customserver control and that is using
the state variable
Ton
"Patrice" <nobody@.nowhere.com> schreef in bericht
news:eZGEnYLGEHA.1720@.tk2msftngp13.phx.gbl...
> No other code than that ? It looks like it should work (of course all
users
> will have the same connect value if you store always FKHFSF for all
users).
> What if you are using directly System.Web.HttpContext.Current.Session.
> Other than that , it would like as if you were using a shared property
> somewhere...
> Patrice
>
> "ton" <vrs@.REMOVEhome.nl> a crit dans le message de
> news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
connected
>
Ho do you test the multi-user environment?
Do you just open up the second browser?
If you opening it by using new window then you get the same session.
It's by design (of Browser).
Try to do the real test. From 2 different machines for example.
I can assure you that it works (unless your system is messed up big time)
George.
"ton" <vrs@.REMOVEhome.nl> wrote in message
news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
> Hi,
> I keep several variables in a statevalue like:
> Dim session As SessionState.HttpSessionState =
> System.Web.HttpContext.Current.Session
> session("connect") = " FKHFSF "
> I thought that these variables would be the exclusive use of one connected
> user/connection. But it looks like that in a multiuser enviroment some
> variables are shared. So I end on the page somenone else was editing.
> What am I missing here. (I have not modified any property of the session
> variable)
> Ton
>
it does not work on a second system.
But I've solved it allready. It looks that using sessionstate variables in a
customserver control is not reliable.
I've changed it to viewstate and now it works. Allthough I have to save de
logon values in a sessionstate, then when opening the second page (with
another customservercontrol) I read the sessionstate variable and save them
in viewstate. With these variabele I keep on using without any problem when
other users are opening the same page.
ton
"George Ter-Saakov" <nospam@.hotmail.com> schreef in bericht
news:eiLqniwGEHA.3068@.TK2MSFTNGP11.phx.gbl...
> Ho do you test the multi-user environment?
> Do you just open up the second browser?
> If you opening it by using new window then you get the same session.
> It's by design (of Browser).
> Try to do the real test. From 2 different machines for example.
> I can assure you that it works (unless your system is messed up big time)
> George.
> "ton" <vrs@.REMOVEhome.nl> wrote in message
> news:c4jor3$68l$1@.news1.tilbu1.nb.home.nl...
connected
>

Saturday, March 24, 2012

Session Variable References Incorrect

I have a fairly large application with about 200 users that uses Session
variables. It would seem that occasionally these variables are being
referenced incorrectly to the extent that different users are updating
information and it is being saved to the wrong user. Is there any problem
with Session Variables that would cause this?not with session. more likley a coding bug where you store session values in
a shared (static) member, or vb module (whose members are all shared).

-- bruce (sqlwork.com)

"GHawley" <GHawley@.discussions.microsoft.com> wrote in message
news:F4501EA5-07FB-49CB-8E38-C5078D66BC9F@.microsoft.com...
>I have a fairly large application with about 200 users that uses Session
> variables. It would seem that occasionally these variables are being
> referenced incorrectly to the extent that different users are updating
> information and it is being saved to the wrong user. Is there any problem
> with Session Variables that would cause this?
The application simply references the Session["variable"] where ever it wants
to use it. The variable isn't stored, just referenced.

Thanks for the speedy response though.

"bruce barker (sqlwork.com)" wrote:

> not with session. more likley a coding bug where you store session values in
> a shared (static) member, or vb module (whose members are all shared).
> -- bruce (sqlwork.com)
> "GHawley" <GHawley@.discussions.microsoft.com> wrote in message
> news:F4501EA5-07FB-49CB-8E38-C5078D66BC9F@.microsoft.com...
> >I have a fairly large application with about 200 users that uses Session
> > variables. It would seem that occasionally these variables are being
> > referenced incorrectly to the extent that different users are updating
> > information and it is being saved to the wrong user. Is there any problem
> > with Session Variables that would cause this?
>
I would like to retract my previous statement and thank Bruce Barker for the
insight. I believe this is exactly the problem.

1 thousand times, thank you!!!!

"GHawley" wrote:

> The application simply references the Session["variable"] where ever it wants
> to use it. The variable isn't stored, just referenced.
> Thanks for the speedy response though.
> "bruce barker (sqlwork.com)" wrote:
> > not with session. more likley a coding bug where you store session values in
> > a shared (static) member, or vb module (whose members are all shared).
> > -- bruce (sqlwork.com)
> > "GHawley" <GHawley@.discussions.microsoft.com> wrote in message
> > news:F4501EA5-07FB-49CB-8E38-C5078D66BC9F@.microsoft.com...
> > >I have a fairly large application with about 200 users that uses Session
> > > variables. It would seem that occasionally these variables are being
> > > referenced incorrectly to the extent that different users are updating
> > > information and it is being saved to the wrong user. Is there any problem
> > > with Session Variables that would cause this?

Session Variable References Incorrect

I have a fairly large application with about 200 users that uses Session
variables. It would seem that occasionally these variables are being
referenced incorrectly to the extent that different users are updating
information and it is being saved to the wrong user. Is there any problem
with Session Variables that would cause this?not with session. more likley a coding bug where you store session values in
a shared (static) member, or vb module (whose members are all shared).
-- bruce (sqlwork.com)
"GHawley" <GHawley@.discussions.microsoft.com> wrote in message
news:F4501EA5-07FB-49CB-8E38-C5078D66BC9F@.microsoft.com...
>I have a fairly large application with about 200 users that uses Session
> variables. It would seem that occasionally these variables are being
> referenced incorrectly to the extent that different users are updating
> information and it is being saved to the wrong user. Is there any problem
> with Session Variables that would cause this?
The application simply references the Session["variable"] where ever it want
s
to use it. The variable isn't stored, just referenced.
Thanks for the speedy response though.
"bruce barker (sqlwork.com)" wrote:

> not with session. more likley a coding bug where you store session values
in
> a shared (static) member, or vb module (whose members are all shared).
> -- bruce (sqlwork.com)
> "GHawley" <GHawley@.discussions.microsoft.com> wrote in message
> news:F4501EA5-07FB-49CB-8E38-C5078D66BC9F@.microsoft.com...
>
>
I would like to retract my previous statement and thank Bruce Barker for the
insight. I believe this is exactly the problem.
1 thousand times, thank you!!!!
"GHawley" wrote:
> The application simply references the Session["variable"] where ever it wa
nts
> to use it. The variable isn't stored, just referenced.
> Thanks for the speedy response though.
> "bruce barker (sqlwork.com)" wrote:
>

Session variable trouble

Hi,
I am facing a trouble. I have some Session variables in my code and
somehow my session variables are getting mixed up with other users.
For example User A has access to 10 companies and User B has access to
5, now when both of us hits to the server at the same time then their
session variables gets mixedup means either User A and USer B will have
now 5 companies or both have 10 companies. Now again when User A hits
to the server he will have again his session variables setting.
I have initialsed my session variables in session_Onstart event.
Now and clue why it is happening.
Regards,
Amit AroraHi, how are you simulating the two different users? Same/differenr machine?
Same/different browser?
diffrent machine and diffrent browser...
diffrent machine and same browser...
> Hi,
> I am facing a trouble. I have some Session variables in my code and
> somehow my session variables are getting mixed up with other users.
> For example User A has access to 10 companies and User B has access to
> 5, now when both of us hits to the server at the same time then their
> session variables gets mixedup means either User A and USer B will have
> now 5 companies or both have 10 companies. Now again when User A hits
> to the server he will have again his session variables setting.
> I have initialsed my session variables in session_Onstart event.
> Now and clue why it is happening.
> Regards,
> Amit Arora
By any chance using *static* members in those objects that you put in
session?
Hans Kesting
Nopes, infact earlier I was using static variables but later on I
changed it to Sessions.......
Have you checked that you don't store a static variable in your session
objet ? What matters is not really that you use session variables, but
rather what exactly you store in those session variables.
It should be fairly easy to repro the problem or not with just a small piece
of code so that you can make sure it works in the trivial case. From there
you'll make sure if this is a problem in your code (I would expect this) or
if you have really a big problem with sessions.
--
Patrice
<aroraamit81@.gmail.com> a crit dans le message de news:
1144930643.742818.170670@.g10g2000cwb.googlegroups.com...
> Nopes, infact earlier I was using static variables but later on I
> changed it to Sessions.......
>
Patric Here goes my long code, if you could check it out, then I would
be more than obliged to you...............
namespace CMS
{
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Configuration;
using Properties;
//using UserContorls;
/// <summary>
/// Summary description for DisplayCompanyContacts.
/// </summary>
public class DisplayCompanyContacts : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.PlaceHolder plcompany;
LiteralControl litcontrol;
protected System.Web.UI.WebControls.CheckBox CheckBox1;
LiteralControl litcontrol2;
string roleid,userid;
protected System.Web.UI.WebControls.Button btn;
protected System.Web.UI.WebControls.LinkButton ClearLink;
protected System.Web.UI.HtmlControls.HtmlInputHidden CheckBoxFlag;
protected System.Web.UI.HtmlControls.HtmlInputHidden CompanyID;
protected System.Web.UI.WebControls.LinkButton SelectLink;
private void Page_Load(object sender, System.EventArgs e)
{
//DisplayConversationFromCalander();
if (Session["Userid"].ToString()=="")
{
Session.Abandon();
Response.Redirect("Login.aspx");
}
Session["ContactCheckBoxIDsInLeftMenu"]="";
Session["CompaniesCheckBoxIDsInLeftMenu"]="";
//CommonProperties.ContactCheckBoxIDsInLeftMenu="";
//CommonProperties.CompaniesCheckBoxIDsInLeftMenu="";
roleid=Session["Roleid"].ToString().Trim();
userid=Session["Userid"].ToString().Trim();
//if(!IsPostBack)
bindleftpanel();
///Removing these Common Properties and Placing Sessions Instead
if(Session["CompaniesCheckBoxIDsInLeftMenu"].ToString().Length>0)
Session["CompaniesCheckBoxIDsInLeftMenu"]=
Session["CompaniesCheckBoxIDsInLeftMenu"].ToString().Substring
(0,Session["CompaniesCheckBoxIDsInLeftMenu"].ToString().Length-1);
if(Session["ContactCheckBoxIDsInLeftMenu"].ToString().Length>0)
Session["ContactCheckBoxIDsInLeftMenu"]=
Session["ContactCheckBoxIDsInLeftMenu"].ToString().Substring
(0,Session["ContactCheckBoxIDsInLeftMenu"].ToString().Length-1);
/* if(CommonProperties.CompaniesCheckBoxIDsInLeftMenu.Length>0)
CommonProperties.CompaniesCheckBoxIDsInLeftMenu=
CommonProperties.CompaniesCheckBoxIDsInLeftMenu.Substring
(0,CommonProperties.CompaniesCheckBoxIDsInLeftMenu.Length-1);
if(CommonProperties.ContactCheckBoxIDsInLeftMenu.Length>0)
CommonProperties.ContactCheckBoxIDsInLeftMenu=
CommonProperties.ContactCheckBoxIDsInLeftMenu.Substring
(0,CommonProperties.ContactCheckBoxIDsInLeftMenu.Length-1); */
/* if (Request.Url!=null)
{
string _pageurl=Request.Url.ToString();
char[] splitter = {'/'};
string[] arInfo = _pageurl.Split(splitter);
for(int x = 0; x < arInfo.Length; x++)
{
_pageurl=arInfo[x];
}
if (_pageurl=="ViewContact.aspx")
{
UserContorls.ViewContact viewcontact=new
CMS.UserContorls.ViewContact();
viewcontact.BindViewDetails();
}
} */
}
public void bindleftpanel()
{
using( SqlConnection strcon=new SqlConnection
(ConfigurationSettings.AppSettings["CMSConnection"]))
{
SqlCommand objcomm;
SqlDataReader objread;
strcon.Open();
//string sql;
/*if (roleid=="1" || roleid=="2")
{
if (CommonProperties.FilterCompanyId==null)
{
sql="select * from company where COMPANY_ID in (Select COMPANY_ID
from COMPANYALLOCATION where COMPANYALLOCATEDTO='"+userid+"' and
USERROLEID="+roleid+" Union Select Company_id from Company where
COMPANY_ADDEDBY='"+userid+"') order by company_name";
}
else
{
sql="select * from company where COMPANY_ID in (Select COMPANY_ID
from COMPANYALLOCATION where COMPANYALLOCATEDTO='"+userid+"' and
USERROLEID="+Session["Roleid"]+" Union Select Company_id from Company
where COMPANY_ADDEDBY='"+userid+"') and
company_id='"+CommonProperties.FilterCompanyId.ToString()+"' order by
company_name";
}
}
else
{
sql="select * from company order by company_name";
}*/
//objcomm=new SqlCommand(sql,strcon);
//kapil kalra 20-mar-2006 permission check
int permission=0;
if((CommonRules.CommonLogic.isValidServiceItem(Convert.ToInt32(Session["Role
ID"]),"Allow
all Companies")))
{
permission=1;//full pemission
}
objcomm=new SqlCommand("Usp_LeftMenu_Company",strcon);
objcomm.CommandType = CommandType.StoredProcedure;
objcomm.Parameters.Clear();
objcomm.Parameters.Add( "@.SESSION_ROLEID", roleid );
objcomm.Parameters.Add( "@.SESSION_USERID", userid );
objcomm.Parameters.Add( "@.permission", permission );
/* objcomm.Parameters.Add(
"@.FILTER_ROLEID",CommonProperties.Filterroleid);
objcomm.Parameters.Add(
"@.FILTER_USERID",CommonProperties.Filteruserid);
objcomm.Parameters.Add(
"@.FILTER_COMPANYID",CommonProperties.FilterCompanyId);
objcomm.Parameters.Add(
"@.FILTER_INVERTICALID",CommonProperties.FilterIV);
objcomm.Parameters.Add(
"@.FILTER_DOMAINID",CommonProperties.FilterDomain);
objcomm.Parameters.Add(
"@.FILTER_SOURCEID",CommonProperties.FilterSource);
objcomm.Parameters.Add(
"@.FILTER_WORKTYPEID",CommonProperties.FilterWorkType);
objcomm.Parameters.Add(
"@.FILTER_DISPOSITIONID",CommonProperties.FilterDisposition);
objcomm.Parameters.Add(
"@.FILTER_DESIGNATION",CommonProperties.FilterDesignation);
objcomm.Parameters.Add(
"@.FILTER_EMAILID",CommonProperties.Filteremail);
objcomm.Parameters.Add(
"@.FILTER_PHONENO",CommonProperties.Filterphone);*/
try
{
objcomm.Parameters.Add(
"@.FILTER_ROLEID",Convert.ToInt32(Session["Filterroleid"]));
objcomm.Parameters.Add(
"@.FILTER_USERID",Convert.ToInt32(Session["Filteruserid"]));
objcomm.Parameters.Add(
"@.FILTER_COMPANYID",Session["FilterCompanyId"].ToString());
objcomm.Parameters.Add(
"@.FILTER_INVERTICALID",Convert.ToInt32(Session["FilterIV"]));
objcomm.Parameters.Add(
"@.FILTER_DOMAINID",Convert.ToInt32(Session["FilterDomain"]));
objcomm.Parameters.Add(
"@.FILTER_SOURCEID",Convert.ToInt32(Session["FilterSource"]));
objcomm.Parameters.Add(
"@.FILTER_WORKTYPEID",Convert.ToInt32(Session["FilterWorkType"]));
objcomm.Parameters.Add(
"@.FILTER_DISPOSITIONID",Convert.ToInt32(Session["FilterDisposition"]));
objcomm.Parameters.Add(
"@.FILTER_DESIGNATION",Session["FilterDesignation"].ToString());
objcomm.Parameters.Add(
"@.FILTER_EMAILID",Session["Filteremail"].ToString());
objcomm.Parameters.Add(
"@.FILTER_PHONENO",Session["Filterphone"].ToString());
}
catch
{}
objread=objcomm.ExecuteReader();
//CommonProperties.CompaniesCheckBoxIDsInLeftMenu="";
//Session["CompaniesCheckBoxIDsInLeftMenu"]="";
if (objread.HasRows)
{
while (objread.Read())
{
CheckBox chkbox=new CheckBox();
chkbox.ID="chkcompany"+objread["company_id"].ToString();
//Response.Write(objread["company_id"]);
chkbox.AutoPostBack=true;
chkbox.EnableViewState=true;
chkbox.Attributes.Add("onClick","java script:Foo(this);");
chkbox.EnableViewState=true;
//CommonProperties.CompaniesCheckBoxIDsInLeftMenu+=chkbox.ID+",";
Session["CompaniesCheckBoxIDsInLeftMenu"]+=chkbox.ID+",";
//if (CommonProperties.SelectedCompany!=null)
if (Session["SelectedCompany"].ToString()!="" )
{
//string info_company =
CommonProperties.SelectedCompany;
string info_company =
Session["SelectedCompany"].ToString();
char[] splitter = {','};
string[] arInfo = info_company.Split(splitter);
for(int x = 0; x < arInfo.Length; x++)
{
if (chkbox.ID==arInfo[x])
{
chkbox.Checked=true;
}
}
}
chkbox.CheckedChanged+=new
System.EventHandler(this.ASSIGN_CHECKED);
plcompany.Controls.Add(chkbox);
litcontrol=new LiteralControl();
litcontrol.Text="<span
class=FilterListCompany>"+objread["company_name"].ToString()+"</span><br>";
plcompany.Controls.Add(litcontrol );
subcontact(objread["company_id"].ToString());
}
}
objcomm.Cancel();
objread.Close();
}
}
public void subcontact(string company_id)
{
using(SqlConnection strcon2=new SqlConnection
(ConfigurationSettings.AppSettings["CMSConnection"]))
{
SqlCommand objcomm2;
SqlDataReader objread2;
strcon2.Open();
//string sql2;
int permission=0;
if((CommonRules.CommonLogic.isValidServiceItem(Convert.ToInt32(Session["Role
ID"]),"Allow
all Companies")))
{
permission=1;//full pemission
}
objcomm2=new SqlCommand("Usp_LeftMenu_Contact",strcon2);
objcomm2.CommandType = CommandType.StoredProcedure;
objcomm2.Parameters.Clear();
objcomm2.Parameters.Add( "@.SESSION_ROLEID", roleid );
objcomm2.Parameters.Add( "@.SESSION_USERID", userid );
objcomm2.Parameters.Add( "@.permission", permission );
/* objcomm2.Parameters.Add(
"@.FILTER_ROLEID",CommonProperties.Filterroleid);
objcomm2.Parameters.Add(
"@.FILTER_USERID",CommonProperties.Filteruserid);
objcomm2.Parameters.Add(
"@.FILTER_COMPANYID",CommonProperties.FilterCompanyId);
objcomm2.Parameters.Add(
"@.FILTER_INVERTICALID",CommonProperties.FilterIV);
objcomm2.Parameters.Add(
"@.FILTER_DOMAINID",CommonProperties.FilterDomain);
objcomm2.Parameters.Add(
"@.FILTER_SOURCEID",CommonProperties.FilterSource);
objcomm2.Parameters.Add(
"@.FILTER_WORKTYPEID",CommonProperties.FilterWorkType);
objcomm2.Parameters.Add(
"@.FILTER_DISPOSITIONID",CommonProperties.FilterDisposition);
objcomm2.Parameters.Add(
"@.FILTER_DESIGNATION",CommonProperties.FilterDesignation);
objcomm2.Parameters.Add(
"@.FILTER_EMAILID",CommonProperties.Filteremail);
objcomm2.Parameters.Add(
"@.FILTER_PHONENO",CommonProperties.Filterphone);
objcomm2.Parameters.Add( "@.FILTER_CONTACTCOMPANYID",company_id);*/
objcomm2.Parameters.Add( "@.FILTER_ROLEID",Session["Filterroleid"]);
objcomm2.Parameters.Add( "@.FILTER_USERID",Session["Filteruserid"]);
objcomm2.Parameters.Add(
"@.FILTER_COMPANYID",Session["FilterCompanyId"]);
objcomm2.Parameters.Add(
"@.FILTER_INVERTICALID",Session["FilterIV"]);
objcomm2.Parameters.Add(
"@.FILTER_DOMAINID",Session["FilterDomain"]);
objcomm2.Parameters.Add(
"@.FILTER_SOURCEID",Session["FilterSource"]);
objcomm2.Parameters.Add(
"@.FILTER_WORKTYPEID",Session["FilterWorkType"]);
objcomm2.Parameters.Add(
"@.FILTER_DISPOSITIONID",Session["FilterDisposition"]);
objcomm2.Parameters.Add(
"@.FILTER_DESIGNATION",Session["FilterDesignation"]);
objcomm2.Parameters.Add( "@.FILTER_EMAILID",Session["Filteremail"]);
objcomm2.Parameters.Add( "@.FILTER_PHONENO",Session["Filterphone"]);
objcomm2.Parameters.Add( "@.FILTER_CONTACTCOMPANYID",company_id);
objread2=objcomm2.ExecuteReader();
//CommonProperties.ContactCheckBoxIDsInLeftMenu="";
//Session["ContactCheckBoxIDsInLeftMenu"]="";
if (objread2.HasRows)
{
while(objread2.Read())
{
litcontrol2=new LiteralControl();
litcontrol2.Text=" ";
plcompany.Controls.Add(litcontrol2 );
CheckBox chkbox=new CheckBox();
chkbox.ID="chkcontact"+objread2["contact_id"].ToString();
//CommonProperties.ContactCheckBoxIDsInLeftMenu+=chkbox.ID+",";
Session["ContactCheckBoxIDsInLeftMenu"]+=chkbox.ID+",";
chkbox.AutoPostBack=true;
chkbox.EnableViewState=true;
//if (CommonProperties.SelectedContact!=null)
if (Session["SelectedContact"].ToString()!="")
{
//string info_company =
CommonProperties.SelectedContact;
string info_company =
Session["SelectedContact"].ToString();
char[] splitter = {','};
string[] arInfo = info_company.Split(splitter);
for(int x = 0; x < arInfo.Length; x++)
{
if (chkbox.ID==arInfo[x])
{
chkbox.Checked=true;
}
}
}
chkbox.CheckedChanged+=new
System.EventHandler(this.Contact_Checked);
plcompany.Controls.Add(chkbox);
litcontrol2=new LiteralControl();
if(roleid=="4" ||roleid=="5"||roleid=="6"||roleid=="7" )
{
int flag=ColorSeg(company_id,objread2["contact_id"].ToString());
if(flag==0)//not alloted
{
litcontrol2.Text="<span
class=FilterListContact>"+objread2["contact_name"].ToString()+"</span><br>";
}
else if(flag==1)//alloted to RA
{
litcontrol2.Text="<span
class=FilterListContactRA>"+objread2["contact_name"].ToString()+"</span><br>
";
}
else if(flag==2)// alloted to SR
{
litcontrol2.Text="<span
class=FilterListContactSR>"+objread2["contact_name"].ToString()+"</span><br>
";
}
else// alloted to both
{
litcontrol2.Text="<span
class=FilterListContactBoth>"+objread2["contact_name"].ToString()+"</span><b
r>";
}
}
else
{
litcontrol2.Text="<span
class=FilterListContact>"+objread2["contact_name"].ToString()+"</span><br>";
}
plcompany.Controls.Add(litcontrol2 );
}
}
objcomm2.Cancel();
objread2.Close();
strcon2.Close();
}
}
private int ColorSeg(string company_id,string contactid)
{
int flag=0;
string kk;
string sql="SELECT userroleid FROM
dbo.CONTACTSALLOCATION where CONTACT_ID="+contactid+" and userroleid
in(1,2)";
SqlConnection conn=new SqlConnection
(ConfigurationSettings.AppSettings["CMSConnection"]);
SqlCommand cmd=new SqlCommand();
cmd.Parameters.Clear();
cmd.CommandText="dbo.[Usp_LeftPanelColor]";
cmd.CommandType=CommandType.StoredProcedure;
cmd.Connection=conn;
cmd.Parameters.Add("@.contactid",Convert.ToInt32(contactid));
DataSet ds=new DataSet();
SqlDataAdapter adpter=new SqlDataAdapter(cmd);
adpter.Fill(ds);
if(ds.Tables[0].Rows.Count>0)
{
kk= ds.Tables[0].Rows[0]["userroleid"].ToString();
flag=Convert.ToInt32(kk);
if(ds.Tables[0].Rows.Count>1)
{
flag=3;
}
}
return flag;
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.SelectLink.Click += new
System.EventHandler(this.SelectLink_Click);
this.ClearLink.Click += new
System.EventHandler(this.ClearLink_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
public void ASSIGN_CHECKED(object sender, System.EventArgs e)
{
//CommonProperties.SelectedCompany=null;
Session["SelectedCompany"]="";
using( SqlConnection strcon=new SqlConnection
(ConfigurationSettings.AppSettings["CMSConnection"]))
{
SqlCommand objcomm;
SqlDataReader objread;
strcon.Open();
/*string sql;
if (roleid=="1" || roleid=="2")
{
sql="select * from company where COMPANY_ID in (Select COMPANY_ID
from COMPANYALLOCATION where COMPANYALLOCATEDTO='"+userid+"' and
USERROLEID="+Session["Roleid"]+" Union Select Company_id from Company
where COMPANY_ADDEDBY='"+userid+"') order by company_name";
}
else
{
sql="select * from company order by company_name";
}
objcomm=new SqlCommand(sql,strcon);*/
int permission=0;
if((CommonRules.CommonLogic.isValidServiceItem(Convert.ToInt32(Session["Role
ID"]),"Allow
all Companies")))
{
permission=1;//full pemission
}
objcomm=new SqlCommand("Usp_LeftMenu_Company",strcon);
objcomm.CommandType = CommandType.StoredProcedure;
objcomm.Parameters.Clear();
objcomm.Parameters.Add( "@.SESSION_ROLEID", roleid );
objcomm.Parameters.Add( "@.SESSION_USERID", userid );
objcomm.Parameters.Add( "@.permission", permission );
/*objcomm.Parameters.Add(
"@.FILTER_ROLEID",CommonProperties.Filterroleid);
objcomm.Parameters.Add(
"@.FILTER_USERID",CommonProperties.Filteruserid);
objcomm.Parameters.Add(
"@.FILTER_COMPANYID",CommonProperties.FilterCompanyId);
objcomm.Parameters.Add(
"@.FILTER_INVERTICALID",CommonProperties.FilterIV);
objcomm.Parameters.Add(
"@.FILTER_DOMAINID",CommonProperties.FilterDomain);
objcomm.Parameters.Add(
"@.FILTER_SOURCEID",CommonProperties.FilterSource);
objcomm.Parameters.Add(
"@.FILTER_WORKTYPEID",CommonProperties.FilterWorkType);
objcomm.Parameters.Add(
"@.FILTER_DISPOSITIONID",CommonProperties.FilterDisposition);
objcomm.Parameters.Add(
"@.FILTER_DESIGNATION",CommonProperties.FilterDesignation);
objcomm.Parameters.Add(
"@.FILTER_EMAILID",CommonProperties.Filteremail);
objcomm.Parameters.Add(
"@.FILTER_PHONENO",CommonProperties.Filterphone);*/
objcomm.Parameters.Add( "@.FILTER_ROLEID",Session["Filterroleid"]);
objcomm.Parameters.Add( "@.FILTER_USERID",Session["Filteruserid"]);
objcomm.Parameters.Add(
"@.FILTER_COMPANYID",Session["FilterCompanyId"]);
objcomm.Parameters.Add(
"@.FILTER_INVERTICALID",Session["FilterIV"]);
objcomm.Parameters.Add(
"@.FILTER_DOMAINID",Session["FilterDomain"]);
objcomm.Parameters.Add(
"@.FILTER_SOURCEID",Session["FilterSource"]);
objcomm.Parameters.Add(
"@.FILTER_WORKTYPEID",Session["FilterWorkType"]);
objcomm.Parameters.Add(
"@.FILTER_DISPOSITIONID",Session["FilterDisposition"]);
objcomm.Parameters.Add(
"@.FILTER_DESIGNATION",Session["FilterDesignation"]);
objcomm.Parameters.Add( "@.FILTER_EMAILID",Session["Filteremail"]);
objcomm.Parameters.Add( "@.FILTER_PHONENO",Session["Filterphone"]);
objread=objcomm.ExecuteReader();
if (objread.HasRows)
{
while (objread.Read())
{
CheckBox check =
(CheckBox)plcompany.FindControl("chkcompany"+objread["company_id"].ToString(
));
string _unchkdcompanyid=check.ID;
if (check.Checked==true)
{
string _chkdcompanyid=check.ID;
//if (CommonProperties.SelectedCompany!=null)
if (Session["SelectedCompany"].ToString().Trim()!="" )
{
//CommonProperties.SelectedCompany=CommonProperties.SelectedCompany+","+_chk
dcompanyid;
Session["SelectedCompany"]=Session["SelectedCompany"]+","+_chkdcompanyid;
ChkContact(_chkdcompanyid);
}
else
{
//CommonProperties.SelectedCompany=_chkdcompanyid;
Session["SelectedCompany"]=_chkdcompanyid;
ChkContact(_chkdcompanyid);
}
}
else
{
// UnChkContatct(_unchkdcompanyid);
}
}
}
if(Session["SelectedCompany"].ToString().StartsWith(","))
{
Session["SelectedCompany"]=Session["SelectedCompany"].ToString().Substring(1
,Session["SelectedCompany"].ToString().Length);
}
if(Session["SelectedCompany"].ToString().EndsWith(","))
{
Session["SelectedCompany"]=Session["SelectedCompany"].ToString().Substring(0
,Session["SelectedCompany"].ToString().Length-1);
}
if(Session["SelectedContact"].ToString().StartsWith(","))
{
Session["SelectedContact"]=Session["SelectedContact"].ToString().Substring(1
,Session["SelectedContact"].ToString().Length);
}
if(Session["SelectedContact"].ToString().EndsWith(","))
{
Session["SelectedContact"]=Session["SelectedContact"].ToString().Substring(0
,Session["SelectedContact"].ToString().Length-1);
}
objcomm.Cancel();
objread.Close();
}
string FlagStatus=CheckBoxFlag.Value.ToString();
string strCompanyID=CompanyID.Value.ToString();
strCompanyID=strCompanyID.Substring(strCompanyID.LastIndexOf("_")+1);
if(!Convert.ToBoolean(FlagStatus))
UnChkContatct(strCompanyID);
}
public void ChkContact(string chkedCmpy)
{
chkedCmpy=chkedCmpy.Replace("chkcompany","");
SqlConnection conn=new
SqlConnection(ConfigurationSettings.AppSettings["CMSConnection"]);
conn.Open();
// SqlCommand cmdcontact=new SqlCommand("Select CONTACT_ID from
Contacts where CONTACT_COMPANY_ID='"+chkedCmpy+"'", conn);
int permission=0;
if((CommonRules.CommonLogic.isValidServiceItem(Convert.ToInt32(Session["Role
ID"]),"Allow
all Companies")))
{
permission=1;//full pemission
}
SqlCommand cmdcontact=new SqlCommand("AutoChkContacts",conn);
cmdcontact.CommandType = CommandType.StoredProcedure;
cmdcontact.Parameters.Add( "@.SESSION_ROLEID", roleid );
cmdcontact.Parameters.Add( "@.SESSION_USERID", userid );
cmdcontact.Parameters.Add( "@.permission", permission );
/*cmdcontact.Parameters.Add(
"@.FILTER_ROLEID",CommonProperties.Filterroleid);
cmdcontact.Parameters.Add(
"@.FILTER_USERID",CommonProperties.Filteruserid);
cmdcontact.Parameters.Add(
"@.FILTER_COMPANYID",CommonProperties.FilterCompanyId);
cmdcontact.Parameters.Add(
"@.FILTER_INVERTICALID",CommonProperties.FilterIV);
cmdcontact.Parameters.Add(
"@.FILTER_DOMAINID",CommonProperties.FilterDomain);
cmdcontact.Parameters.Add(
"@.FILTER_SOURCEID",CommonProperties.FilterSource);
cmdcontact.Parameters.Add(
"@.FILTER_WORKTYPEID",CommonProperties.FilterWorkType);
cmdcontact.Parameters.Add(
"@.FILTER_DISPOSITIONID",CommonProperties.FilterDisposition);
cmdcontact.Parameters.Add(
"@.FILTER_DESIGNATION",CommonProperties.FilterDesignation);
cmdcontact.Parameters.Add(
"@.FILTER_EMAILID",CommonProperties.Filteremail);
cmdcontact.Parameters.Add(
"@.FILTER_PHONENO",CommonProperties.Filterphone);*/
cmdcontact.Parameters.Add(
"@.FILTER_ROLEID",Session["Filterroleid"]);
cmdcontact.Parameters.Add(
"@.FILTER_USERID",Session["Filteruserid"]);
cmdcontact.Parameters.Add(
"@.FILTER_COMPANYID",Session["FilterCompanyId"]);
cmdcontact.Parameters.Add(
"@.FILTER_INVERTICALID",Session["FilterIV"]);
cmdcontact.Parameters.Add(
"@.FILTER_DOMAINID",Session["FilterDomain"]);
cmdcontact.Parameters.Add(
"@.FILTER_SOURCEID",Session["FilterSource"]);
cmdcontact.Parameters.Add(
"@.FILTER_WORKTYPEID",Session["FilterWorkType"]);
cmdcontact.Parameters.Add(
"@.FILTER_DISPOSITIONID",Session["FilterDisposition"]);
cmdcontact.Parameters.Add(
"@.FILTER_DESIGNATION",Session["FilterDesignation"]);
cmdcontact.Parameters.Add(
"@.FILTER_EMAILID",Session["Filteremail"]);
cmdcontact.Parameters.Add(
"@.FILTER_PHONENO",Session["Filterphone"]);
cmdcontact.Parameters.Add( "@.FILTER_CONTACTCOMPANYID", chkedCmpy );
SqlDataReader rdr=cmdcontact.ExecuteReader();
if(rdr.HasRows)
{
while(rdr.Read())
{
CheckBox check =
(CheckBox)plcompany.FindControl("chkcontact"+rdr["CONTACT_ID"].ToString());
check.Checked=true;
string _chkdcontactid=check.ID;
//if (CommonProperties.SelectedContact!=null)
if (Session["SelectedContact"].ToString()!="")
{
int flag=AldyInsertCont(_chkdcontactid);
if(flag==0)
//CommonProperties.SelectedContact=CommonProperties.SelectedContact+","+_chk
dcontactid;
Session["SelectedContact"]=Session["SelectedContact"]+","+_chkdcontactid;
}
else
{
//CommonProperties.SelectedContact=_chkdcontactid;
Session["SelectedContact"]=_chkdcontactid;
}
}
}
}
private int AldyInsertCont(string contid)
{
int flag=0;
string[] Cont=Session["SelectedContact"].ToString().Split(new char[]
{','});
for(int i=0;i<Cont.Length;i++)
{
if(contid==Cont[i].ToString())
{
flag=1;
break;
}
}
return flag;
}
public void UnChkContatct(string chkedCmpy)
{
string chkedCmpy1=chkedCmpy;
chkedCmpy=chkedCmpy.Replace("chkcompany","");
SqlConnection conn=new
SqlConnection(ConfigurationSettings.AppSettings["CMSConnection"]);
conn.Open();
int permission=0;
if((CommonRules.CommonLogic.isValidServiceItem(Convert.ToInt32(Session["Role
ID"]),"Allow
all Companies")))
{
permission=1;//full pemission
}
SqlCommand cmdcontact=new SqlCommand("AutoChkContacts",conn);
cmdcontact.CommandType = CommandType.StoredProcedure;
cmdcontact.Parameters.Clear();
cmdcontact.Parameters.Add( "@.SESSION_ROLEID", roleid );
cmdcontact.Parameters.Add( "@.SESSION_USERID", userid );
cmdcontact.Parameters.Add( "@.permission", permission );
/*cmdcontact.Parameters.Add(
"@.FILTER_ROLEID",CommonProperties.Filterroleid);
cmdcontact.Parameters.Add(
"@.FILTER_USERID",CommonProperties.Filteruserid);
cmdcontact.Parameters.Add(
"@.FILTER_COMPANYID",CommonProperties.FilterCompanyId);
cmdcontact.Parameters.Add(
"@.FILTER_INVERTICALID",CommonProperties.FilterIV);
cmdcontact.Parameters.Add(
"@.FILTER_DOMAINID",CommonProperties.FilterDomain);
cmdcontact.Parameters.Add(
"@.FILTER_SOURCEID",CommonProperties.FilterSource);
cmdcontact.Parameters.Add(
"@.FILTER_WORKTYPEID",CommonProperties.FilterWorkType);
cmdcontact.Parameters.Add(
"@.FILTER_DISPOSITIONID",CommonProperties.FilterDisposition);
cmdcontact.Parameters.Add(
"@.FILTER_DESIGNATION",CommonProperties.FilterDesignation);
cmdcontact.Parameters.Add(
"@.FILTER_EMAILID",CommonProperties.Filteremail);
cmdcontact.Parameters.Add(
"@.FILTER_PHONENO",CommonProperties.Filterphone);*/
cmdcontact.Parameters.Add(
"@.FILTER_ROLEID",Session["Filterroleid"]);
cmdcontact.Parameters.Add(
"@.FILTER_USERID",Session["Filteruserid"]);
cmdcontact.Parameters.Add(
"@.FILTER_COMPANYID",Session["FilterCompanyId"]);
cmdcontact.Parameters.Add(
"@.FILTER_INVERTICALID",Session["FilterIV"]);
cmdcontact.Parameters.Add(
"@.FILTER_DOMAINID",Session["FilterDomain"]);
cmdcontact.Parameters.Add(
"@.FILTER_SOURCEID",Session["FilterSource"]);
cmdcontact.Parameters.Add(
"@.FILTER_WORKTYPEID",Session["FilterWorkType"]);
cmdcontact.Parameters.Add(
"@.FILTER_DISPOSITIONID",Session["FilterDisposition"]);
cmdcontact.Parameters.Add(
"@.FILTER_DESIGNATION",Session["FilterDesignation"]);
cmdcontact.Parameters.Add(
"@.FILTER_EMAILID",Session["Filteremail"]);
cmdcontact.Parameters.Add(
"@.FILTER_PHONENO",Session["Filterphone"]);
cmdcontact.Parameters.Add( "@.FILTER_CONTACTCOMPANYID", chkedCmpy );
SqlDataReader rdr=cmdcontact.ExecuteReader();
// string[] ChkContacts=CommonProperties.SelectedContact.Split(new
char[] {','});
// CommonProperties.SelectedContact=null;
if(rdr.HasRows)
{
while(rdr.Read())
{
CheckBox check1 = (CheckBox)plcompany.FindControl(chkedCmpy1);
CheckBox check =
(CheckBox)plcompany.FindControl("chkcontact"+rdr["CONTACT_ID"].ToString());
//if(CommonProperties.SelectedContact!=null)
if(Session["SelectedContact"].ToString()!="")
{
/* if(CommonProperties.SelectedContact.IndexOf(check.ID.ToString()+",")>-1)
CommonProperties.SelectedContact=CommonProperties.SelectedContact.Replace(ch
eck.ID.ToString()+",","");
else
if(CommonProperties.SelectedContact.IndexOf(check.ID.ToString())>-1)
CommonProperties.SelectedContact=CommonProperties.SelectedContact.Replace(ch
eck.ID.ToString(),"");*/
if(Session["SelectedContact"].ToString().IndexOf(check.ID.ToString()+",")>-1
)
Session["SelectedContact"]=Session["SelectedContact"].ToString().Replace(che
ck.ID.ToString()+",","");
else
if(Session["SelectedContact"].ToString().IndexOf(check.ID.ToString())>-1)
Session["SelectedContact"]=Session["SelectedContact"].ToString().Replace(che
ck.ID.ToString(),"");
}
// CommonProperties.SelectedContact=null;
check.Checked=false;
}
}
}
public void Contact_Checked(object sender, System.EventArgs e)
{
// CommonProperties.SelectedContact=null;
Session["SelectedContact"]="";
using( SqlConnection strcon=new SqlConnection
(ConfigurationSettings.AppSettings["CMSConnection"]))
{
SqlCommand objcomm;
SqlDataReader objread;
strcon.Open();
/*string sql;
if ( roleid=="2")
{
sql="select * from contacts where CONTACT_ID IN (Select CONTACT_ID
from Contacts where CONTACT_UPDATE_BY_ID='"+userid+"' UNION Select
CONTACT_ID from CONTACTSALLOCATION where
CONTACTSALLOCATEDTO='"+userid+"' and USERROLEID="+Session["Roleid"]+")
order by contact_name";
}
else if(roleid=="1" )
{
sql="select * from contacts where CONTACT_ID IN (Select CONTACT_ID
from Contacts where CONTACT_UPDATE_BY_ID='"+userid+"' UNION Select
CONTACT_ID from CONTACTSALLOCATION where
CONTACTSALLOCATEDTO='"+userid+"' and USERROLEID="+Session["Roleid"]+"
Union Select CONTACT_ID from Contacts where contact_company_id in
(select COMPANY_ID from company where COMPANY_ID in (Select COMPANY_ID
from COMPANYALLOCATION where COMPANYALLOCATEDTO='"+userid+"' and
USERROLEID="+Session["Roleid"]+" Union Select Company_id from Company
where COMPANY_ADDEDBY='"+userid+"'))) order by contact_name";
}
else
{
sql="select * from contacts order by contact_name";
}
//Response.Write (sql);
//Response.End();
objcomm=new SqlCommand(sql,strcon);*/
int permission=0;
if((CommonRules.CommonLogic.isValidServiceItem(Convert.ToInt32(Session["Role
ID"]),"Allow
all Companies")))
{
permission=1;//full pemission
}
objcomm=new SqlCommand("Usp_LeftMenu_Contact_Checked",strcon);
objcomm.CommandType = CommandType.StoredProcedure;
objcomm.Parameters.Add( "@.SESSION_ROLEID", roleid );
objcomm.Parameters.Add( "@.SESSION_USERID", userid );
objcomm.Parameters.Add( "@.permission", permission );
/* objcomm.Parameters.Add(
"@.FILTER_ROLEID",CommonProperties.Filterroleid);
objcomm.Parameters.Add(
"@.FILTER_USERID",CommonProperties.Filteruserid);
objcomm.Parameters.Add(
"@.FILTER_COMPANYID",CommonProperties.FilterCompanyId);
objcomm.Parameters.Add(
"@.FILTER_INVERTICALID",CommonProperties.FilterIV);
objcomm.Parameters.Add(
"@.FILTER_DOMAINID",CommonProperties.FilterDomain);
objcomm.Parameters.Add(
"@.FILTER_SOURCEID",CommonProperties.FilterSource);
objcomm.Parameters.Add(
"@.FILTER_WORKTYPEID",CommonProperties.FilterWorkType);
objcomm.Parameters.Add(
"@.FILTER_DISPOSITIONID",CommonProperties.FilterDisposition);
objcomm.Parameters.Add(
"@.FILTER_DESIGNATION",CommonProperties.FilterDesignation);
objcomm.Parameters.Add(
"@.FILTER_EMAILID",CommonProperties.Filteremail);
objcomm.Parameters.Add(
"@.FILTER_PHONENO",CommonProperties.Filterphone);
objcomm.Parameters.Add(
"@.FILTER_ROLEID",CommonProperties.Filterroleid);
objcomm.Parameters.Add(
"@.FILTER_USERID",CommonProperties.Filteruserid);
objcomm.Parameters.Add(
"@.FILTER_COMPANYID",CommonProperties.FilterCompanyId);
objcomm.Parameters.Add(
"@.FILTER_INVERTICALID",CommonProperties.FilterIV);
objcomm.Parameters.Add(
"@.FILTER_DOMAINID",CommonProperties.FilterDomain);
objcomm.Parameters.Add(
"@.FILTER_SOURCEID",CommonProperties.FilterSource);
objcomm.Parameters.Add(
"@.FILTER_WORKTYPEID",CommonProperties.FilterWorkType);
objcomm.Parameters.Add(
"@.FILTER_DISPOSITIONID",CommonProperties.FilterDisposition);
objcomm.Parameters.Add(
"@.FILTER_DESIGNATION",CommonProperties.FilterDesignation);
objcomm.Parameters.Add(
"@.FILTER_EMAILID",CommonProperties.Filteremail);
objcomm.Parameters.Add(
"@.FILTER_PHONENO",CommonProperties.Filterphone);*/
objcomm.Parameters.Add( "@.FILTER_ROLEID",Session["Filterroleid"]);
objcomm.Parameters.Add( "@.FILTER_USERID",Session["Filteruserid"]);
objcomm.Parameters.Add(
"@.FILTER_COMPANYID",Session["FilterCompanyId"].ToString());
objcomm.Parameters.Add(
"@.FILTER_INVERTICALID",Session["FilterIV"]);
objcomm.Parameters.Add(
"@.FILTER_DOMAINID",Session["FilterDomain"]);
objcomm.Parameters.Add(
"@.FILTER_SOURCEID",Session["FilterSource"]);
objcomm.Parameters.Add(
"@.FILTER_WORKTYPEID",Session["FilterWorkType"]);
objcomm.Parameters.Add(
"@.FILTER_DISPOSITIONID",Session["FilterDisposition"]);
objcomm.Parameters.Add(
"@.FILTER_DESIGNATION",Session["FilterDesignation"]);
objcomm.Parameters.Add( "@.FILTER_EMAILID",Session["Filteremail"]);
objcomm.Parameters.Add( "@.FILTER_PHONENO",Session["Filterphone"]);
objread=objcomm.ExecuteReader();
if (objread.HasRows)
{
while (objread.Read())
{
CheckBox check =
(CheckBox)plcompany.FindControl("chkcontact"+objread["contact_id"].ToString(
));
if (check.Checked==true)
{
string _chkdcompanyid=check.ID;
// if (CommonProperties.SelectedContact!=null)
if (Session["SelectedContact"].ToString()!="")
{
// CommonProperties.SelectedContact=CommonProperties.SelectedContact+","+_ch
kdcompanyid;
Session["SelectedContact"]=Session["SelectedContact"]+","+_chkdcompanyid;
}
else
{
//CommonProperties.SelectedContact=_chkdcompanyid;
Session["SelectedContact"]=_chkdcompanyid;
}
}
}
}
objcomm.Cancel();
objread.Close();
}
}
private void SelectLink_Click(object sender, System.EventArgs e)
{
CheckAllCompaniesContact();
}
private void CheckAllCompaniesContact()
{
try
{
// string []
CompanyCheckBoxIds=CommonProperties.CompaniesCheckBoxIDsInLeftMenu.Split(new
char[] {','});
string []
CompanyCheckBoxIds=Session["CompaniesCheckBoxIDsInLeftMenu"].ToString().Spli
t(new
char[] {','});
foreach (string temp in CompanyCheckBoxIds)
{
CheckBox check = (CheckBox)plcompany.FindControl(temp);
check.Checked=true;
}
Session["SelectedCompany"]=Session["CompaniesCheckBoxIDsInLeftMenu"];
}
catch{}
try
{
//string []
ContactCheckBoxIds=CommonProperties.ContactCheckBoxIDsInLeftMenu.Split(new
char[] {','});
string []
ContactCheckBoxIds=Session["ContactCheckBoxIDsInLeftMenu"].ToString().Split(
new
char[] {','});
foreach (string temp in ContactCheckBoxIds)
{
CheckBox check = (CheckBox)plcompany.FindControl(temp);
check.Checked=true;
}
// CommonProperties.SelectedCompany=CommonProperties.CompaniesCheckBoxIDsIn
LeftMenu;
// CommonProperties.SelectedContact=CommonProperties.ContactCheckBoxIDsInLe
ftMenu;
Session["SelectedContact"]=Session["ContactCheckBoxIDsInLeftMenu"];
}
catch{}
}
private void ClearLink_Click(object sender, System.EventArgs e)
{
ClearAllCompaniesContact();
}
private void ClearAllCompaniesContact()
{
try
{
//string []
CompanyCheckBoxIds=CommonProperties.CompaniesCheckBoxIDsInLeftMenu.Split(new
char[] {','});
string []
CompanyCheckBoxIds=Session["CompaniesCheckBoxIDsInLeftMenu"].ToString().Spli
t(new
char[] {','});
foreach (string temp in CompanyCheckBoxIds)
{
CheckBox check = (CheckBox)plcompany.FindControl(temp);
check.Checked=false;
}
Session["SelectedCompany"]=Session["CompaniesCheckBoxIDsInLeftMenu"]="";
//string []
ContactCheckBoxIds=CommonProperties.ContactCheckBoxIDsInLeftMenu.Split(new
char[] {','});
string []
ContactCheckBoxIds=Session["ContactCheckBoxIDsInLeftMenu"].ToString().Split(
new
char[] {','});
foreach (string temp in ContactCheckBoxIds)
{
CheckBox check = (CheckBox)plcompany.FindControl(temp);
check.Checked=false;
}
//CommonProperties.SelectedCompany=CommonProperties.CompaniesCheckBoxIDsInLe
ftMenu="";
//CommonProperties.SelectedContact=CommonProperties.ContactCheckBoxIDsInLeft
Menu="";
Session["SelectedContact"]=Session["ContactCheckBoxIDsInLeftMenu"]="";
}
catch{}
}
}
}
Ummm, no one is going to read this. Can you please attach the code that
is causing the problem?
aroraamit81@.gmail.com wrote:
> Patric Here goes my long code, if you could check it out, then I would
> be more than obliged to you...............
> namespace CMS
> {
> using System;
> using System.Collections;
> using System.ComponentModel;
> using System.Data;
> using System.Drawing;
> using System.Web;
> using System.Web.SessionState;
> using System.Web.UI;
> using System.Web.UI.WebControls;
> using System.Web.UI.HtmlControls;
> using System.Data.SqlClient;
> using System.Configuration;
> using Properties;
> //using UserContorls;
> /// <summary>
> /// Summary description for DisplayCompanyContacts.
> /// </summary>
> public class DisplayCompanyContacts : System.Web.UI.UserControl
> {
> protected System.Web.UI.WebControls.PlaceHolder plcompany;
> LiteralControl litcontrol;
> protected System.Web.UI.WebControls.CheckBox CheckBox1;
> LiteralControl litcontrol2;
> string roleid,userid;
> protected System.Web.UI.WebControls.Button btn;
> protected System.Web.UI.WebControls.LinkButton ClearLink;
> protected System.Web.UI.HtmlControls.HtmlInputHidden CheckBoxFlag;
> protected System.Web.UI.HtmlControls.HtmlInputHidden CompanyID;
> protected System.Web.UI.WebControls.LinkButton SelectLink;
> private void Page_Load(object sender, System.EventArgs e)
> {
> //DisplayConversationFromCalander();
> if (Session["Userid"].ToString()=="")
> {
> Session.Abandon();
> Response.Redirect("Login.aspx");
> }
> Session["ContactCheckBoxIDsInLeftMenu"]="";
> Session["CompaniesCheckBoxIDsInLeftMenu"]="";
> //CommonProperties.ContactCheckBoxIDsInLeftMenu="";
> //CommonProperties.CompaniesCheckBoxIDsInLeftMenu="";
> roleid=Session["Roleid"].ToString().Trim();
> userid=Session["Userid"].ToString().Trim();
> //if(!IsPostBack)
> bindleftpanel();
>
> ///Removing these Common Properties and Placing Sessions Instead
> if(Session["CompaniesCheckBoxIDsInLeftMenu"].ToString().Length>0)
> Session["CompaniesCheckBoxIDsInLeftMenu"]=
> Session["CompaniesCheckBoxIDsInLeftMenu"].ToString().Substring
> (0,Session["CompaniesCheckBoxIDsInLeftMenu"].ToString().Length-1);
> if(Session["ContactCheckBoxIDsInLeftMenu"].ToString().Length>0)
> Session["ContactCheckBoxIDsInLeftMenu"]=
> Session["ContactCheckBoxIDsInLeftMenu"].ToString().Substring
> (0,Session["ContactCheckBoxIDsInLeftMenu"].ToString().Length-1);
> /* if(CommonProperties.CompaniesCheckBoxIDsInLeftMenu.Length>0)
> CommonProperties.CompaniesCheckBoxIDsInLeftMenu=
> CommonProperties.CompaniesCheckBoxIDsInLeftMenu.Substring
> (0,CommonProperties.CompaniesCheckBoxIDsInLeftMenu.Length-1);
> if(CommonProperties.ContactCheckBoxIDsInLeftMenu.Length>0)
> CommonProperties.ContactCheckBoxIDsInLeftMenu=
> CommonProperties.ContactCheckBoxIDsInLeftMenu.Substring
> (0,CommonProperties.ContactCheckBoxIDsInLeftMenu.Length-1); */
>
> /* if (Request.Url!=null)
> {
> string _pageurl=Request.Url.ToString();
> char[] splitter = {'/'};
> string[] arInfo = _pageurl.Split(splitter);
> for(int x = 0; x < arInfo.Length; x++)
> {
> _pageurl=arInfo[x];
> }
> if (_pageurl=="ViewContact.aspx")
> {
> UserContorls.ViewContact viewcontact=new
> CMS.UserContorls.ViewContact();
> viewcontact.BindViewDetails();
> }
> } */
> }
> public void bindleftpanel()
> {
> using( SqlConnection strcon=new SqlConnection
> (ConfigurationSettings.AppSettings["CMSConnection"]))
> {
> SqlCommand objcomm;
> SqlDataReader objread;
> strcon.Open();
> //string sql;
> /*if (roleid=="1" || roleid=="2")
> {
> if (CommonProperties.FilterCompanyId==null)
> {
> sql="select * from company where COMPANY_ID in (Select COMPANY_ID
> from COMPANYALLOCATION where COMPANYALLOCATEDTO='"+userid+"' and
> USERROLEID="+roleid+" Union Select Company_id from Company where
> COMPANY_ADDEDBY='"+userid+"') order by company_name";
> }
> else
> {
> sql="select * from company where COMPANY_ID in (Select COMPANY_ID
> from COMPANYALLOCATION where COMPANYALLOCATEDTO='"+userid+"' and
> USERROLEID="+Session["Roleid"]+" Union Select Company_id from Company
> where COMPANY_ADDEDBY='"+userid+"') and
> company_id='"+CommonProperties.FilterCompanyId.ToString()+"' order by
> company_name";
> }
> }
> else
> {
> sql="select * from company order by company_name";
> }*/
> //objcomm=new SqlCommand(sql,strcon);
> //kapil kalra 20-mar-2006 permission check
> int permission=0;
> if((CommonRules.CommonLogic.isValidServiceItem(Convert.ToInt32(Session
["RoleID"]),"Allow
> all Companies")))
> {
> permission=1;//full pemission
> }
> objcomm=new SqlCommand("Usp_LeftMenu_Company",strcon);
> objcomm.CommandType = CommandType.StoredProcedure;
> objcomm.Parameters.Clear();
> objcomm.Parameters.Add( "@.SESSION_ROLEID", roleid );
> objcomm.Parameters.Add( "@.SESSION_USERID", userid );
> objcomm.Parameters.Add( "@.permission", permission );
> /* objcomm.Parameters.Add(
> "@.FILTER_ROLEID",CommonProperties.Filterroleid);
> objcomm.Parameters.Add(
> "@.FILTER_USERID",CommonProperties.Filteruserid);
> objcomm.Parameters.Add(
> "@.FILTER_COMPANYID",CommonProperties.FilterCompanyId);
> objcomm.Parameters.Add(
> "@.FILTER_INVERTICALID",CommonProperties.FilterIV);
> objcomm.Parameters.Add(
> "@.FILTER_DOMAINID",CommonProperties.FilterDomain);
> objcomm.Parameters.Add(
> "@.FILTER_SOURCEID",CommonProperties.FilterSource);
> objcomm.Parameters.Add(
> "@.FILTER_WORKTYPEID",CommonProperties.FilterWorkType);
> objcomm.Parameters.Add(
> "@.FILTER_DISPOSITIONID",CommonProperties.FilterDisposition);
> objcomm.Parameters.Add(
> "@.FILTER_DESIGNATION",CommonProperties.FilterDesignation);
> objcomm.Parameters.Add(
> "@.FILTER_EMAILID",CommonProperties.Filteremail);
> objcomm.Parameters.Add(
> "@.FILTER_PHONENO",CommonProperties.Filterphone);*/
> try
> {
> objcomm.Parameters.Add(
> "@.FILTER_ROLEID",Convert.ToInt32(Session["Filterroleid"]));
> objcomm.Parameters.Add(
> "@.FILTER_USERID",Convert.ToInt32(Session["Filteruserid"]));
> objcomm.Parameters.Add(
> "@.FILTER_COMPANYID",Session["FilterCompanyId"].ToString());
> objcomm.Parameters.Add(
> "@.FILTER_INVERTICALID",Convert.ToInt32(Session["FilterIV"]));
> objcomm.Parameters.Add(
> "@.FILTER_DOMAINID",Convert.ToInt32(Session["FilterDomain"]));
> objcomm.Parameters.Add(
> "@.FILTER_SOURCEID",Convert.ToInt32(Session["FilterSource"]));
> objcomm.Parameters.Add(
> "@.FILTER_WORKTYPEID",Convert.ToInt32(Session["FilterWorkType"]));
> objcomm.Parameters.Add(
> "@.FILTER_DISPOSITIONID",Convert.ToInt32(Session["FilterDisposition"]));
> objcomm.Parameters.Add(
> "@.FILTER_DESIGNATION",Session["FilterDesignation"].ToString());
> objcomm.Parameters.Add(
> "@.FILTER_EMAILID",Session["Filteremail"].ToString());
> objcomm.Parameters.Add(
> "@.FILTER_PHONENO",Session["Filterphone"].ToString());
> }
> catch
> {}
> objread=objcomm.ExecuteReader();
> //CommonProperties.CompaniesCheckBoxIDsInLeftMenu="";
> //Session["CompaniesCheckBoxIDsInLeftMenu"]="";
> if (objread.HasRows)
> {
> while (objread.Read())
> {
> CheckBox chkbox=new CheckBox();
> chkbox.ID="chkcompany"+objread["company_id"].ToString();
> //Response.Write(objread["company_id"]);
> chkbox.AutoPostBack=true;
> chkbox.EnableViewState=true;
> chkbox.Attributes.Add("onClick","java script:Foo(this);");
> chkbox.EnableViewState=true;
> //CommonProperties.CompaniesCheckBoxIDsInLeftMenu+=chkbox.ID+",";
> Session["CompaniesCheckBoxIDsInLeftMenu"]+=chkbox.ID+",";
> //if (CommonProperties.SelectedCompany!=null)
> if (Session["SelectedCompany"].ToString()!="" )
> {
> //string info_company =
> CommonProperties.SelectedCompany;
> string info_company =
> Session["SelectedCompany"].ToString();
> char[] splitter = {','};
> string[] arInfo = info_company.Split(splitter);
> for(int x = 0; x < arInfo.Length; x++)
> {
> if (chkbox.ID==arInfo[x])
> {
> chkbox.Checked=true;
> }
> }
> }
> chkbox.CheckedChanged+=new
> System.EventHandler(this.ASSIGN_CHECKED);
> plcompany.Controls.Add(chkbox);
> litcontrol=new LiteralControl();
> litcontrol.Text="<span
> class=FilterListCompany>"+objread["company_name"].ToString()+"</span><br>"
;
> plcompany.Controls.Add(litcontrol );
> subcontact(objread["company_id"].ToString());
> }
> }
> objcomm.Cancel();
> objread.Close();
> }
> }
>
> public void subcontact(string company_id)
> {
> using(SqlConnection strcon2=new SqlConnection
> (ConfigurationSettings.AppSettings["CMSConnection"]))
> {
> SqlCommand objcomm2;
> SqlDataReader objread2;
> strcon2.Open();
> //string sql2;
> int permission=0;
> if((CommonRules.CommonLogic.isValidServiceItem(Convert.ToInt32(Session
["RoleID"]),"Allow
> all Companies")))
> {
> permission=1;//full pemission
> }
> objcomm2=new SqlCommand("Usp_LeftMenu_Contact",strcon2);
> objcomm2.CommandType = CommandType.StoredProcedure;
> objcomm2.Parameters.Clear();
> objcomm2.Parameters.Add( "@.SESSION_ROLEID", roleid );
> objcomm2.Parameters.Add( "@.SESSION_USERID", userid );
> objcomm2.Parameters.Add( "@.permission", permission );
> /* objcomm2.Parameters.Add(
> "@.FILTER_ROLEID",CommonProperties.Filterroleid);
> objcomm2.Parameters.Add(
> "@.FILTER_USERID",CommonProperties.Filteruserid);
> objcomm2.Parameters.Add(
> "@.FILTER_COMPANYID",CommonProperties.FilterCompanyId);
> objcomm2.Parameters.Add(
> "@.FILTER_INVERTICALID",CommonProperties.FilterIV);
> objcomm2.Parameters.Add(
> "@.FILTER_DOMAINID",CommonProperties.FilterDomain);
> objcomm2.Parameters.Add(
> "@.FILTER_SOURCEID",CommonProperties.FilterSource);
> objcomm2.Parameters.Add(
> "@.FILTER_WORKTYPEID",CommonProperties.FilterWorkType);
> objcomm2.Parameters.Add(
> "@.FILTER_DISPOSITIONID",CommonProperties.FilterDisposition);
> objcomm2.Parameters.Add(
> "@.FILTER_DESIGNATION",CommonProperties.FilterDesignation);
> objcomm2.Parameters.Add(
> "@.FILTER_EMAILID",CommonProperties.Filteremail);
> objcomm2.Parameters.Add(
> "@.FILTER_PHONENO",CommonProperties.Filterphone);
> objcomm2.Parameters.Add( "@.FILTER_CONTACTCOMPANYID",company_id);*/
> objcomm2.Parameters.Add( "@.FILTER_ROLEID",Session["Filterroleid"]);
> objcomm2.Parameters.Add( "@.FILTER_USERID",Session["Filteruserid"]);
> objcomm2.Parameters.Add(
> "@.FILTER_COMPANYID",Session["FilterCompanyId"]);
> objcomm2.Parameters.Add(
> "@.FILTER_INVERTICALID",Session["FilterIV"]);
> objcomm2.Parameters.Add(
> "@.FILTER_DOMAINID",Session["FilterDomain"]);
> objcomm2.Parameters.Add(
> "@.FILTER_SOURCEID",Session["FilterSource"]);
> objcomm2.Parameters.Add(
> "@.FILTER_WORKTYPEID",Session["FilterWorkType"]);
> objcomm2.Parameters.Add(
> "@.FILTER_DISPOSITIONID",Session["FilterDisposition"]);
> objcomm2.Parameters.Add(
> "@.FILTER_DESIGNATION",Session["FilterDesignation"]);
> objcomm2.Parameters.Add( "@.FILTER_EMAILID",Session["Filteremail"]);
> objcomm2.Parameters.Add( "@.FILTER_PHONENO",Session["Filterphone"]);
> objcomm2.Parameters.Add( "@.FILTER_CONTACTCOMPANYID",company_id);
> objread2=objcomm2.ExecuteReader();
> //CommonProperties.ContactCheckBoxIDsInLeftMenu="";
> //Session["ContactCheckBoxIDsInLeftMenu"]="";
> if (objread2.HasRows)
> {
> while(objread2.Read())
> {
> litcontrol2=new LiteralControl();
> litcontrol2.Text=" ";
> plcompany.Controls.Add(litcontrol2 );
> CheckBox chkbox=new CheckBox();
> chkbox.ID="chkcontact"+objread2["contact_id"].ToString();
> //CommonProperties.ContactCheckBoxIDsInLeftMenu+=chkbox.ID+",";
> Session["ContactCheckBoxIDsInLeftMenu"]+=chkbox.ID+",";
> chkbox.AutoPostBack=true;
> chkbox.EnableViewState=true;
> //if (CommonProperties.SelectedContact!=null)
> if (Session["SelectedContact"].ToString()!="")
> {
> //string info_company =
> CommonProperties.SelectedContact;
> string info_company =
> Session["SelectedContact"].ToString();
> char[] splitter = {','};
> string[] arInfo = info_company.Split(splitter);
> for(int x = 0; x < arInfo.Length; x++)
> {
> if (chkbox.ID==arInfo[x])
> {
> chkbox.Checked=true;
> }
> }
> }
> chkbox.CheckedChanged+=new
> System.EventHandler(this.Contact_Checked);
> plcompany.Controls.Add(chkbox);
> litcontrol2=new LiteralControl();
> if(roleid=="4" ||roleid=="5"||roleid=="6"||roleid=="7" )
> {
> int flag=ColorSeg(company_id,objread2["contact_id"].ToString());
> if(flag==0)//not alloted
> {
> litcontrol2.Text="<span
> class=FilterListContact>"+objread2["contact_name"].ToString()+"</span><br>
";
> }
> else if(flag==1)//alloted to RA
> {
> litcontrol2.Text="<span
> class=FilterListContactRA>"+objread2["contact_name"].ToString()+"</span><b
r>";
> }
> else if(flag==2)// alloted to SR
> {
> litcontrol2.Text="<span
> class=FilterListContactSR>"+objread2["contact_name"].ToString()+"</span><b
r>";
> }
> else// alloted to both
> {
> litcontrol2.Text="<span
> class=FilterListContactBoth>"+objread2["contact_name"].ToString()+"</span>
<br>";
> }
> }
> else
> {
> litcontrol2.Text="<span
> class=FilterListContact>"+objread2["contact_name"].ToString()+"</span><br>
";
> }
> plcompany.Controls.Add(litcontrol2 );
> }
> }
>
> objcomm2.Cancel();
> objread2.Close();
> strcon2.Close();
> }
> }
> private int ColorSeg(string company_id,string contactid)
> {
> int flag=0;
> string kk;
> string sql="SELECT userroleid FROM
> dbo.CONTACTSALLOCATION where CONTACT_ID="+contactid+" and userroleid
> in(1,2)";
> SqlConnection conn=new SqlConnection
> (ConfigurationSettings.AppSettings["CMSConnection"]);
> SqlCommand cmd=new SqlCommand();
> cmd.Parameters.Clear();
> cmd.CommandText="dbo.[Usp_LeftPanelColor]";
> cmd.CommandType=CommandType.StoredProcedure;
> cmd.Connection=conn;
> cmd.Parameters.Add("@.contactid",Convert.ToInt32(contactid));
> DataSet ds=new DataSet();
> SqlDataAdapter adpter=new SqlDataAdapter(cmd);
> adpter.Fill(ds);
> if(ds.Tables[0].Rows.Count>0)
> {
> kk= ds.Tables[0].Rows[0]["userroleid"].ToString();
> flag=Convert.ToInt32(kk);
> if(ds.Tables[0].Rows.Count>1)
> {
> flag=3;
> }
> }
> return flag;
> }
> #region Web Form Designer generated code
> override protected void OnInit(EventArgs e)
> {
> //
> // CODEGEN: This call is required by the ASP.NET Web Form Designer.
> //
> InitializeComponent();
> base.OnInit(e);
> }
> /// <summary>
> /// Required method for Designer support - do not modify
> /// the contents of this method with the code editor.
> /// </summary>
> private void InitializeComponent()
> {
> this.SelectLink.Click += new
> System.EventHandler(this.SelectLink_Click);
> this.ClearLink.Click += new
> System.EventHandler(this.ClearLink_Click);
> this.Load += new System.EventHandler(this.Page_Load);
> }
> #endregion
> public void ASSIGN_CHECKED(object sender, System.EventArgs e)
> {
> //CommonProperties.SelectedCompany=null;
> Session["SelectedCompany"]="";
> using( SqlConnection strcon=new SqlConnection
> (ConfigurationSettings.AppSettings["CMSConnection"]))
> {
> SqlCommand objcomm;
> SqlDataReader objread;
> strcon.Open();
> /*string sql;
> if (roleid=="1" || roleid=="2")
> {
> sql="select * from company where COMPANY_ID in (Select COMPANY_ID
> from COMPANYALLOCATION where COMPANYALLOCATEDTO='"+userid+"' and
> USERROLEID="+Session["Roleid"]+" Union Select Company_id from Company
> where COMPANY_ADDEDBY='"+userid+"') order by company_name";
> }
> else
> {
> sql="select * from company order by company_name";
> }
> objcomm=new SqlCommand(sql,strcon);*/
> int permission=0;
> if((CommonRules.CommonLogic.isValidServiceItem(Convert.ToInt32(Session
["RoleID"]),"Allow
> all Companies")))
> {
> permission=1;//full pemission
> }
> objcomm=new SqlCommand("Usp_LeftMenu_Company",strcon);
> objcomm.CommandType = CommandType.StoredProcedure;
> objcomm.Parameters.Clear();
> objcomm.Parameters.Add( "@.SESSION_ROLEID", roleid );
> objcomm.Parameters.Add( "@.SESSION_USERID", userid );
> objcomm.Parameters.Add( "@.permission", permission );
> /*objcomm.Parameters.Add(
> "@.FILTER_ROLEID",CommonProperties.Filterroleid);
> objcomm.Parameters.Add(
> "@.FILTER_USERID",CommonProperties.Filteruserid);
> objcomm.Parameters.Add(
> "@.FILTER_COMPANYID",CommonProperties.FilterCompanyId);
> objcomm.Parameters.Add(
> "@.FILTER_INVERTICALID",CommonProperties.FilterIV);
> objcomm.Parameters.Add(
> "@.FILTER_DOMAINID",CommonProperties.FilterDomain);
> objcomm.Parameters.Add(
> "@.FILTER_SOURCEID",CommonProperties.FilterSource);
> objcomm.Parameters.Add(
> "@.FILTER_WORKTYPEID",CommonProperties.FilterWorkType);
> objcomm.Parameters.Add(
> "@.FILTER_DISPOSITIONID",CommonProperties.FilterDisposition);
> objcomm.Parameters.Add(
> "@.FILTER_DESIGNATION",CommonProperties.FilterDesignation);
> objcomm.Parameters.Add(
> "@.FILTER_EMAILID",CommonProperties.Filteremail);
> objcomm.Parameters.Add(
> "@.FILTER_PHONENO",CommonProperties.Filterphone);*/
> objcomm.Parameters.Add( "@.FILTER_ROLEID",Session["Filterroleid"]);
> objcomm.Parameters.Add( "@.FILTER_USERID",Session["Filteruserid"]);
> objcomm.Parameters.Add(
> "@.FILTER_COMPANYID",Session["FilterCompanyId"]);
> objcomm.Parameters.Add(
> "@.FILTER_INVERTICALID",Session["FilterIV"]);
> objcomm.Parameters.Add(
> "@.FILTER_DOMAINID",Session["FilterDomain"]);
> objcomm.Parameters.Add(
> "@.FILTER_SOURCEID",Session["FilterSource"]);
> objcomm.Parameters.Add(
> "@.FILTER_WORKTYPEID",Session["FilterWorkType"]);
> objcomm.Parameters.Add(
> "@.FILTER_DISPOSITIONID",Session["FilterDisposition"]);
> objcomm.Parameters.Add(
> "@.FILTER_DESIGNATION",Session["FilterDesignation"]);
> objcomm.Parameters.Add( "@.FILTER_EMAILID",Session["Filteremail"]);
> objcomm.Parameters.Add( "@.FILTER_PHONENO",Session["Filterphone"]);
> objread=objcomm.ExecuteReader();
> if (objread.HasRows)
> {
> while (objread.Read())
> {
> CheckBox check =
> (CheckBox)plcompany.FindControl("chkcompany"+objread["company_id"].ToStrin
g());
> string _unchkdcompanyid=check.ID;
> if (check.Checked==true)
> {
> string _chkdcompanyid=check.ID;
> //if (CommonProperties.SelectedCompany!=null)
> if (Session["SelectedCompany"].ToString().Trim()!="" )
> {
> //CommonProperties.SelectedCompany=CommonProperties.SelectedCompan
y+","+_chkdcompanyid;
> Session["SelectedCompany"]=Session["SelectedCompany"]+","+_chkdcom
panyid;
> ChkContact(_chkdcompanyid);
> }
> else
> {
> //CommonProperties.SelectedCompany=_chkdcompanyid;
> Session["SelectedCompany"]=_chkdcompanyid;
> ChkContact(_chkdcompanyid);
> }
> }
> else
> {
> // UnChkContatct(_unchkdcompanyid);
> }
>
> }
> }
> if(Session["SelectedCompany"].ToString().StartsWith(","))
> {
> Session["SelectedCompany"]=Session["SelectedCompany"].ToString().Subs
tring(1,Session["SelectedCompany"].ToString().Length);
> }
> if(Session["SelectedCompany"].ToString().EndsWith(","))
> {
> Session["SelectedCompany"]=Session["SelectedCompany"].ToString().Subs
tring(0,Session["SelectedCompany"].ToString().Length-1);
> }
> if(Session["SelectedContact"].ToString().StartsWith(","))
> {
> Session["SelectedContact"]=Session["SelectedContact"].ToString().Subs
tring(1,Session["SelectedContact"].ToString().Length);
> }
> if(Session["SelectedContact"].ToString().EndsWith(","))
> {
> Session["SelectedContact"]=Session["SelectedContact"].ToString().Subs
tring(0,Session["SelectedContact"].ToString().Length-1);
> }
> objcomm.Cancel();
> objread.Close();
> }
> string FlagStatus=CheckBoxFlag.Value.ToString();
> string strCompanyID=CompanyID.Value.ToString();
> strCompanyID=strCompanyID.Substring(strCompanyID.LastIndexOf("_")+1);
>
> if(!Convert.ToBoolean(FlagStatus))
> UnChkContatct(strCompanyID);
>
> }
>
> public void ChkContact(string chkedCmpy)
> {
> chkedCmpy=chkedCmpy.Replace("chkcompany","");
>
> SqlConnection conn=new
> SqlConnection(ConfigurationSettings.AppSettings["CMSConnection"]);
> conn.Open();
> // SqlCommand cmdcontact=new SqlCommand("Select CONTACT_ID from
> Contacts where CONTACT_COMPANY_ID='"+chkedCmpy+"'", conn);
> int permission=0;
> if((CommonRules.CommonLogic.isValidServiceItem(Convert.ToInt32(Session[
"RoleID"]),"Allow
> all Companies")))
> {
> permission=1;//full pemission
> }
> SqlCommand cmdcontact=new SqlCommand("AutoChkContacts",conn);
> cmdcontact.CommandType = CommandType.StoredProcedure;
> cmdcontact.Parameters.Add( "@.SESSION_ROLEID", roleid );
> cmdcontact.Parameters.Add( "@.SESSION_USERID", userid );
> cmdcontact.Parameters.Add( "@.permission", permission );
> /*cmdcontact.Parameters.Add(
> "@.FILTER_ROLEID",CommonProperties.Filterroleid);
> cmdcontact.Parameters.Add(
> "@.FILTER_USERID",CommonProperties.Filteruserid);
> cmdcontact.Parameters.Add(
> "@.FILTER_COMPANYID",CommonProperties.FilterCompanyId);
> cmdcontact.Parameters.Add(
> "@.FILTER_INVERTICALID",CommonProperties.FilterIV);
> cmdcontact.Parameters.Add(
> "@.FILTER_DOMAINID",CommonProperties.FilterDomain);
> cmdcontact.Parameters.Add(
> "@.FILTER_SOURCEID",CommonProperties.FilterSource);
> cmdcontact.Parameters.Add(
> "@.FILTER_WORKTYPEID",CommonProperties.FilterWorkType);
> cmdcontact.Parameters.Add(
> "@.FILTER_DISPOSITIONID",CommonProperties.FilterDisposition);
> cmdcontact.Parameters.Add(
> "@.FILTER_DESIGNATION",CommonProperties.FilterDesignation);
> cmdcontact.Parameters.Add(
> "@.FILTER_EMAILID",CommonProperties.Filteremail);
> cmdcontact.Parameters.Add(
> "@.FILTER_PHONENO",CommonProperties.Filterphone);*/
> cmdcontact.Parameters.Add(
> "@.FILTER_ROLEID",Session["Filterroleid"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_USERID",Session["Filteruserid"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_COMPANYID",Session["FilterCompanyId"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_INVERTICALID",Session["FilterIV"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_DOMAINID",Session["FilterDomain"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_SOURCEID",Session["FilterSource"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_WORKTYPEID",Session["FilterWorkType"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_DISPOSITIONID",Session["FilterDisposition"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_DESIGNATION",Session["FilterDesignation"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_EMAILID",Session["Filteremail"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_PHONENO",Session["Filterphone"]);
> cmdcontact.Parameters.Add( "@.FILTER_CONTACTCOMPANYID", chkedCmpy );
> SqlDataReader rdr=cmdcontact.ExecuteReader();
> if(rdr.HasRows)
> {
> while(rdr.Read())
> {
> CheckBox check =
> (CheckBox)plcompany.FindControl("chkcontact"+rdr["CONTACT_ID"].ToString())
;
> check.Checked=true;
>
> string _chkdcontactid=check.ID;
>
> //if (CommonProperties.SelectedContact!=null)
> if (Session["SelectedContact"].ToString()!="")
> {
> int flag=AldyInsertCont(_chkdcontactid);
> if(flag==0)
> //CommonProperties.SelectedContact=CommonProperties.SelectedContact
+","+_chkdcontactid;
> Session["SelectedContact"]=Session["SelectedContact"]+","+_chkdcont
actid;
> }
> else
> {
> //CommonProperties.SelectedContact=_chkdcontactid;
> Session["SelectedContact"]=_chkdcontactid;
> }
> }
> }
> }
> private int AldyInsertCont(string contid)
> {
> int flag=0;
> string[] Cont=Session["SelectedContact"].ToString().Split(new char[]
> {','});
> for(int i=0;i<Cont.Length;i++)
> {
> if(contid==Cont[i].ToString())
> {
> flag=1;
> break;
> }
> }
> return flag;
> }
> public void UnChkContatct(string chkedCmpy)
> {
> string chkedCmpy1=chkedCmpy;
> chkedCmpy=chkedCmpy.Replace("chkcompany","");
> SqlConnection conn=new
> SqlConnection(ConfigurationSettings.AppSettings["CMSConnection"]);
> conn.Open();
> int permission=0;
> if((CommonRules.CommonLogic.isValidServiceItem(Convert.ToInt32(Session[
"RoleID"]),"Allow
> all Companies")))
> {
> permission=1;//full pemission
> }
> SqlCommand cmdcontact=new SqlCommand("AutoChkContacts",conn);
> cmdcontact.CommandType = CommandType.StoredProcedure;
> cmdcontact.Parameters.Clear();
> cmdcontact.Parameters.Add( "@.SESSION_ROLEID", roleid );
> cmdcontact.Parameters.Add( "@.SESSION_USERID", userid );
> cmdcontact.Parameters.Add( "@.permission", permission );
> /*cmdcontact.Parameters.Add(
> "@.FILTER_ROLEID",CommonProperties.Filterroleid);
> cmdcontact.Parameters.Add(
> "@.FILTER_USERID",CommonProperties.Filteruserid);
> cmdcontact.Parameters.Add(
> "@.FILTER_COMPANYID",CommonProperties.FilterCompanyId);
> cmdcontact.Parameters.Add(
> "@.FILTER_INVERTICALID",CommonProperties.FilterIV);
> cmdcontact.Parameters.Add(
> "@.FILTER_DOMAINID",CommonProperties.FilterDomain);
> cmdcontact.Parameters.Add(
> "@.FILTER_SOURCEID",CommonProperties.FilterSource);
> cmdcontact.Parameters.Add(
> "@.FILTER_WORKTYPEID",CommonProperties.FilterWorkType);
> cmdcontact.Parameters.Add(
> "@.FILTER_DISPOSITIONID",CommonProperties.FilterDisposition);
> cmdcontact.Parameters.Add(
> "@.FILTER_DESIGNATION",CommonProperties.FilterDesignation);
> cmdcontact.Parameters.Add(
> "@.FILTER_EMAILID",CommonProperties.Filteremail);
> cmdcontact.Parameters.Add(
> "@.FILTER_PHONENO",CommonProperties.Filterphone);*/
>
> cmdcontact.Parameters.Add(
> "@.FILTER_ROLEID",Session["Filterroleid"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_USERID",Session["Filteruserid"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_COMPANYID",Session["FilterCompanyId"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_INVERTICALID",Session["FilterIV"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_DOMAINID",Session["FilterDomain"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_SOURCEID",Session["FilterSource"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_WORKTYPEID",Session["FilterWorkType"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_DISPOSITIONID",Session["FilterDisposition"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_DESIGNATION",Session["FilterDesignation"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_EMAILID",Session["Filteremail"]);
> cmdcontact.Parameters.Add(
> "@.FILTER_PHONENO",Session["Filterphone"]);
>
> cmdcontact.Parameters.Add( "@.FILTER_CONTACTCOMPANYID", chkedCmpy );
> SqlDataReader rdr=cmdcontact.ExecuteReader();
>
> // string[] ChkContacts=CommonProperties.SelectedContact.Split(new
> char[] {','});
> // CommonProperties.SelectedContact=null;
> if(rdr.HasRows)
> {
> while(rdr.Read())
> {
> CheckBox check1 = (CheckBox)plcompany.FindControl(chkedCmpy1);
>
> CheckBox check =
> (CheckBox)plcompany.FindControl("chkcontact"+rdr["CONTACT_ID"].ToString())
;
>
> //if(CommonProperties.SelectedContact!=null)
> if(Session["SelectedContact"].ToString()!="")
> {
> /* if(CommonProperties.SelectedContact.IndexOf(check.ID.ToString()+"
,")>-1)
> CommonProperties.SelectedContact=CommonProperties.SelectedContact.
Replace(check.ID.ToString()+",","");
> else
> if(CommonProperties.SelectedContact.IndexOf(check.ID.ToString())>-1)
> CommonProperties.SelectedContact=CommonProperties.SelectedContact.
Replace(check.ID.ToString(),"");*/
> if(Session["SelectedContact"].ToString().IndexOf(check.ID.ToString()
+",")>-1)
> Session["SelectedContact"]=Session["SelectedContact"].ToString().Re
place(check.ID.ToString()+",","");
> else
> if(Session["SelectedContact"].ToString().IndexOf(check.ID.ToString())>-1)
> Session["SelectedContact"]=Session["SelectedContact"].ToString().Re
place(check.ID.ToString(),"");
>
> }
>
> // CommonProperties.SelectedContact=null;
>
> check.Checked=false;
> }
>
> }
> }
>
>
> public void Contact_Checked(object sender, System.EventArgs e)
> {
> // CommonProperties.SelectedContact=null;
> Session["SelectedContact"]="";
>
> using( SqlConnection strcon=new SqlConnection
> (ConfigurationSettings.AppSettings["CMSConnection"]))
> {
> SqlCommand objcomm;
> SqlDataReader objread;
> strcon.Open();
> /*string sql;
> if ( roleid=="2")
> {
> sql="select * from contacts where CONTACT_ID IN (Select CONTACT_ID
> from Contacts where CONTACT_UPDATE_BY_ID='"+userid+"' UNION Select
> CONTACT_ID from CONTACTSALLOCATION where
> CONTACTSALLOCATEDTO='"+userid+"' and USERROLEID="+Session["Roleid"]+")
> order by contact_name";
> }
> else if(roleid=="1" )
> {
> sql="select * from contacts where CONTACT_ID IN (Select CONTACT_ID
> from Contacts where CONTACT_UPDATE_BY_ID='"+userid+"' UNION Select
> CONTACT_ID from CONTACTSALLOCATION where
> CONTACTSALLOCATEDTO='"+userid+"' and USERROLEID="+Session["Roleid"]+"
> Union Select CONTACT_ID from Contacts where contact_company_id in
> (select COMPANY_ID from company where COMPANY_ID in (Select COMPANY_ID
> from COMPANYALLOCATION where COMPANYALLOCATEDTO='"+userid+"' and
> USERROLEID="+Session["Roleid"]+" Union Select Company_id from Company
> where COMPANY_ADDEDBY='"+userid+"'))) order by contact_name";
> }
> else
> {
> sql="select * from contacts order by contact_name";
> }
> //Response.Write (sql);
> //Response.End();
> objcomm=new SqlCommand(sql,strcon);*/
> int permission=0;
> if((CommonRules.CommonLogic.isValidServiceItem(Convert.ToInt32(Session
["RoleID"]),"Allow
> all Companies")))
> {
> permission=1;//full pemission
> }
> objcomm=new SqlCommand("Usp_LeftMenu_Contact_Checked",strcon);
> objcomm.CommandType = CommandType.StoredProcedure;
> objcomm.Parameters.Add( "@.SESSION_ROLEID", roleid );
> objcomm.Parameters.Add( "@.SESSION_USERID", userid );
> objcomm.Parameters.Add( "@.permission", permission );
> /* objcomm.Parameters.Add(
> "@.FILTER_ROLEID",CommonProperties.Filterroleid);
> objcomm.Parameters.Add(
> "@.FILTER_USERID",CommonProperties.Filteruserid);
> objcomm.Parameters.Add(
> "@.FILTER_COMPANYID",CommonProperties.FilterCompanyId);
> objcomm.Parameters.Add(
> "@.FILTER_INVERTICALID",CommonProperties.FilterIV);
> objcomm.Parameters.Add(
> "@.FILTER_DOMAINID",CommonProperties.FilterDomain);
> objcomm.Parameters.Add(
> "@.FILTER_SOURCEID",CommonProperties.FilterSource);
> objcomm.Parameters.Add(
> "@.FILTER_WORKTYPEID",CommonProperties.FilterWorkType);
> objcomm.Parameters.Add(
> "@.FILTER_DISPOSITIONID",CommonProperties.FilterDisposition);
> objcomm.Parameters.Add(
> "@.FILTER_DESIGNATION",CommonProperties.FilterDesignation);
> objcomm.Parameters.Add(
> "@.FILTER_EMAILID",CommonProperties.Filteremail);
> objcomm.Parameters.Add(
> "@.FILTER_PHONENO",CommonProperties.Filterphone);
> objcomm.Parameters.Add(
> "@.FILTER_ROLEID",CommonProperties.Filterroleid);
> objcomm.Parameters.Add(
> "@.FILTER_USERID",CommonProperties.Filteruserid);
> objcomm.Parameters.Add(
> "@.FILTER_COMPANYID",CommonProperties.FilterCompanyId);
> objcomm.Parameters.Add(
> "@.FILTER_INVERTICALID",CommonProperties.FilterIV);
> objcomm.Parameters.Add(
> "@.FILTER_DOMAINID",CommonProperties.FilterDomain);
> objcomm.Parameters.Add(
> "@.FILTER_SOURCEID",CommonProperties.FilterSource);
> objcomm.Parameters.Add(
> "@.FILTER_WORKTYPEID",CommonProperties.FilterWorkType);
> objcomm.Parameters.Add(
> "@.FILTER_DISPOSITIONID",CommonProperties.FilterDisposition);
> objcomm.Parameters.Add(
> "@.FILTER_DESIGNATION",CommonProperties.FilterDesignation);
> objcomm.Parameters.Add(
> "@.FILTER_EMAILID",CommonProperties.Filteremail);
> objcomm.Parameters.Add(
> "@.FILTER_PHONENO",CommonProperties.Filterphone);*/
> objcomm.Parameters.Add( "@.FILTER_ROLEID",Session["Filterroleid"]);
> objcomm.Parameters.Add( "@.FILTER_USERID",Session["Filteruserid"]);
> objcomm.Parameters.Add(
> "@.FILTER_COMPANYID",Session["FilterCompanyId"].ToString());
> objcomm.Parameters.Add(
> "@.FILTER_INVERTICALID",Session["FilterIV"]);
> objcomm.Parameters.Add(
> "@.FILTER_DOMAINID",Session["FilterDomain"]);
> objcomm.Parameters.Add(
> "@.FILTER_SOURCEID",Session["FilterSource"]);
> objcomm.Parameters.Add(
> "@.FILTER_WORKTYPEID",Session["FilterWorkType"]);
> objcomm.Parameters.Add(
> "@.FILTER_DISPOSITIONID",Session["FilterDisposition"]);
> objcomm.Parameters.Add(
> "@.FILTER_DESIGNATION",Session["FilterDesignation"]);
> objcomm.Parameters.Add( "@.FILTER_EMAILID",Session["Filteremail"]);
> objcomm.Parameters.Add( "@.FILTER_PHONENO",Session["Filterphone"]);
>
>
> objread=objcomm.ExecuteReader();
> if (objread.HasRows)
> {
> while (objread.Read())
> {
> CheckBox check =
> (CheckBox)plcompany.FindControl("chkcontact"+objread["contact_id"].ToStrin
g());
> if (check.Checked==true)
> {
> string _chkdcompanyid=check.ID;
> // if (CommonProperties.SelectedContact!=null)
> if (Session["SelectedContact"].ToString()!="")
> {
> // CommonProperties.SelectedContact=CommonProperties.SelectedConta
ct+","+_chkdcompanyid;
> Session["SelectedContact"]=Session["SelectedContact"]+","+_chkdcom
panyid;
> }
> else
> {
> //CommonProperties.SelectedContact=_chkdcompanyid;
> Session["SelectedContact"]=_chkdcompanyid;
> }
> }
> }
> }
> objcomm.Cancel();
> objread.Close();
> }
> }
> private void SelectLink_Click(object sender, System.EventArgs e)
> {
> CheckAllCompaniesContact();
> }
> private void CheckAllCompaniesContact()
> {
> try
> {
> // string []
> CompanyCheckBoxIds=CommonProperties.CompaniesCheckBoxIDsInLeftMenu.Split(n
ew
> char[] {','});
> string []
> CompanyCheckBoxIds=Session["CompaniesCheckBoxIDsInLeftMenu"].ToString().Sp
lit(new
> char[] {','});
> foreach (string temp in CompanyCheckBoxIds)
> {
> CheckBox check = (CheckBox)plcompany.FindControl(temp);
> check.Checked=true;
> }
> Session["SelectedCompany"]=Session["CompaniesCheckBoxIDsInLeftMenu"];
> }
> catch{}
> try
> {
> //string []
> ContactCheckBoxIds=CommonProperties.ContactCheckBoxIDsInLeftMenu.Split(new
> char[] {','});
> string []
> ContactCheckBoxIds=Session["ContactCheckBoxIDsInLeftMenu"].ToString().Spli
t(new
> char[] {','});
> foreach (string temp in ContactCheckBoxIds)
> {
> CheckBox check = (CheckBox)plcompany.FindControl(temp);
> check.Checked=true;
> }
> // CommonProperties.SelectedCompany=CommonProperties.CompaniesCheckBo
xIDsInLeftMenu;
> // CommonProperties.SelectedContact=CommonProperties.ContactCheckBoxI
DsInLeftMenu;
> Session["SelectedContact"]=Session["ContactCheckBoxIDsInLeftMenu"];
> }
> catch{}
> }
> private void ClearLink_Click(object sender, System.EventArgs e)
> {
> ClearAllCompaniesContact();
> }
> private void ClearAllCompaniesContact()
> {
> try
> {
> //string []
> CompanyCheckBoxIds=CommonProperties.CompaniesCheckBoxIDsInLeftMenu.Split(n
ew
> char[] {','});
> string []
> CompanyCheckBoxIds=Session["CompaniesCheckBoxIDsInLeftMenu"].ToString().Sp
lit(new
> char[] {','});
> foreach (string temp in CompanyCheckBoxIds)
> {
> CheckBox check = (CheckBox)plcompany.FindControl(temp);
> check.Checked=false;
> }
> Session["SelectedCompany"]=Session["CompaniesCheckBoxIDsInLeftMenu"]="
";
> //string []
> ContactCheckBoxIds=CommonProperties.ContactCheckBoxIDsInLeftMenu.Split(new
> char[] {','});
> string []
> ContactCheckBoxIds=Session["ContactCheckBoxIDsInLeftMenu"].ToString().Spli
t(new
> char[] {','});
> foreach (string temp in ContactCheckBoxIds)
> {
> CheckBox check = (CheckBox)plcompany.FindControl(temp);
> check.Checked=false;
> }
> //CommonProperties.SelectedCompany=CommonProperties.CompaniesCheckBoxI
DsInLeftMenu="";
> //CommonProperties.SelectedContact=CommonProperties.ContactCheckBoxIDs
InLeftMenu="";
> Session["SelectedContact"]=Session["ContactCheckBoxIDsInLeftMenu"]="";
> }
> catch{}
> }
>
>
> }
> }
>
Well, the problem is this code only............
If you could solve it then please seee...