Forum
A place to discuss topics/games with other webDiplomacy players.
Page 1051 of 1419
FirstPreviousNextLast
Gen. Lee (7588 D(B))
02 May 13 UTC
*Spoiler* the movie Lincoln
See inside
21 replies
Open
fridaay (0 DX)
01 May 13 UTC
ADVERTISE YOUR NON-LIVE GAMES HERE
Utilize this threat by posting new games which are NOT live, here and only here.
3 replies
Open
TheMinisterOfWar (553 D)
02 May 13 UTC
Consolation stab EOG
After the sour taste of defeat of the Gunboat tournament, a group of tough survivors decided to have another taste (and seem to have ended up having more fun than the others).
11 replies
Open
Al Swearengen (0 DX)
02 May 13 UTC
On Game Conduct
As per below
8 replies
Open
Lando Calrissian (100 D(S))
02 May 13 UTC
TIM TEBOW - MEMOIRS OF A CFL CAREER
Written in the year 2024
http://www.sbnation.com/2013/5/1/4282368/tim-tebow-cfl
0 replies
Open
goldfinger0303 (3157 DMod)
30 Apr 13 UTC
The Masters Rounds 3 and 4
Lots of updates in this thread. Most importantly though, we need subs!
13 replies
Open
Draugnar (0 DX)
30 Apr 13 UTC
(+6)
An offer to Kestas...
Kestas, oh great and mighty!

If you will strip Nigee's coin/badge from him (and him alone) I will contribute an amount equal to 150% of what he has contributed to the site.
61 replies
Open
josunice (3702 D(S))
01 May 13 UTC
Why do users display "Available Points" instead of "Total Points"?
For what the points mean or don't mean, seeing and ranking by total points is more informative that the current display of available points, no?
15 replies
Open
JackWangHasNoFace (0 DX)
01 May 13 UTC
Come Play this Game
.gameID=116646 Gunboat classic, bet of 30. Game starts in two hours!
0 replies
Open
JackWangHasNoFace (0 DX)
01 May 13 UTC
Awesome Game
gameID=116646 Gunboat classic, bet of 30. Game starts in two hours!
0 replies
Open
bo_sox48 (5202 DMod(G))
01 May 13 UTC
I Muted HumanWave... What'd He Say?
Tired of him putting people with opinions like mine and plenty of others here under the bus because he throws around so many unsubstantiated claims. Hope he's gotten better, but hey, please enlighten me... is it worth looking at again?
3 replies
Open
AncientMemories (635 D)
29 Apr 13 UTC
Questions
Hey everyone, I'm back (somewhat, i still have finals so can't get too involved till after them, but I'm feeling better so I'm mostly back) and thought I'd say high. Also, some questions
16 replies
Open
podium (498 D)
29 Apr 13 UTC
Internet satellite tv /live streaming
Does anyone here use any of these services.If so which sites/programs work best.Interested in catching up on some shows that I've missed lately and want to watch older episodes.Also live sports tired of being forced to choose to watching only a few games at a time on cable.Would like to have wider selection of games to pick from.
3 replies
Open
Tasnica (3366 D)
29 Apr 13 UTC
Around the World Gunboat Tournament EoG, Game 12
6 replies
Open
NigeeBaby (100 D(G))
30 Apr 13 UTC
Fancy a beer.....
...... if you're in downtown Vegas at the weekend and fancy a beer I'm buying.
8 replies
Open
NigeeBaby (100 D(G))
28 Apr 13 UTC
(+1)
Gold Silver Bronze badges
Isn't it about time we got rid of these as they are making some people feel uncomfortable ........
50 replies
Open
hecks (164 D)
30 Apr 13 UTC
Player Needed for German Takeover
Autumn, 1902. Well-positioned Germany with existing alliances in place. 5 centers with a build coming. 20 D buyin. gameID=115893
2 replies
Open
Fasces349 (0 DX)
29 Apr 13 UTC
NHL PLAYOFF PREDICTIONS
Now that the playoffs have begun time to make our predictions as to who will win and who will lose.
2 replies
Open
Draugnar (0 DX)
29 Apr 13 UTC
What the heck?!
Three or four times this morning I have posted to a opened up thread and my posting has gone to a different one. What the heck is going on with the forum?
11 replies
Open
SplitDiplomat (101466 D)
23 Apr 13 UTC
(+1)
Why the mods are being selective?
Why they take actions against a player who breaks a rule and don't take actions against a player who breaks the same rule as the other one? What's the point of the rules then?
348 replies
Open
ReBrock (189 D)
30 Apr 13 UTC
Master of War 3rd edition!
Hi guys, I want to invite you all to the 3rd edition of Mastet of War!
gameID=116554
0 replies
Open
goldfinger0303 (3157 DMod)
30 Apr 13 UTC
Question for Econ Majors
I had an idea today that I might use for my senior thesis next year, and I just wanted to air it out and get some initial criticism.
22 replies
Open
SYnapse (0 DX)
29 Apr 13 UTC
Anyone made a wikipedia article?
I'm trying to contribute to humanity with the following:
18 replies
Open
semck83 (229 D(B))
27 Apr 13 UTC
(+2)
A Question
Some of you have probably heard this before. For you, please don't answer or otherwise respond in the first 22 posts.
Page 15 of 16
FirstPreviousNextLast
 
Draugnar (0 DX)
29 Apr 13 UTC
I tire of this anyhow and was really arguing a point I didn't really believe in an attempt to exercise my debate skills, which are clearly lacking... Until one is concretely known through direct observation, the odds are 1/3. If one then looks at the first coin and see heads, then the odds become50/50 on the other coin.

The simplest experiment for the children to prove that with the kids is to put three marbles of two colors (the color with two in the bag is boys and with one is girls). Reach in and draw them out in twos and you will get twice as many mixed colors as same colors. Draw them out one at a time and if you get the girl, put it back in, then draw them out so you only gets pairs that start with boys and you will get 50% that are BB and 50% that are BG.

Honestly, I kept waiting for one of you to provide this definitive example for the children. I pushed and pushed but no one every came up with this so obvious and simple demonstrative experiment. 2/3 (odds of boy on first draw) * 1/2 (odds of boy on second draw when first is boy) = 1/3 odds of two boys). Or 1/3 (odds of girl on first) * 1 (odds of boy on second) + 2/3 (odds of boy on first) * 1/2 (odds of girl on second) = 1/3 (odds of GB) + 1/3 (odds of BG) = 2/3 (odds of BG or GB).

So sorry to get you all going, but it was a fun debate and I really was hoping the marbles in a bag would come up as that was how I was taught to think through odds oh so long ago.
abgemacht (1076 D(G))
29 Apr 13 UTC
(+1)
So, rather than admitting you were wrong and confused, you're trying to play this off as some poorly-conceived attempt to teach us to explain things better? Risky play; let's see how it pays off.
Draugnar (0 DX)
29 Apr 13 UTC
Dude, look back and see where I had agreed. SocDis was arguin all along for the 50/50 and I could see where he was comign from, so decided to try and help him argue his cause. I just got a bit carried away. As I said, I knew since doing the marble math that it was 1/3 because of the fact that the G first guarantees you get a B second which is twice the odds of a B first getting a B second.
uclabb (589 D)
29 Apr 13 UTC
(+1)
HAHAHAHAHAHAHA
abgemacht (1076 D(G))
29 Apr 13 UTC
So, in a subject that people are known to get confused by and in which it's likely you'd be considered an authority, you decide to argue the wrong position in an attempt to...?
philcore (317 D(S))
29 Apr 13 UTC
Sorry draug, babies aren't marbles, their coins. Coins is the definitive example for independent events which have 2 equally possible outcomes. If you get it now, just say you get it now (which it sounds like you do) but don't try to claim that you got it all along and were just waiting for one of us to use the exact analogy you were thinking of. I gave you plenty of brilliantly simplified analogies using coins behind a blinder even marking them with a "K", and showed my work using the conditional probably formula that was hanging up @socDis. To say that I failed your personal test because I didn't mention marbles, is a little absurd. You were trying just as hard as everyone else to argue your side and never once mentioned marbles. So really, don't use that as a lame attempt to say you were right all along and we were just too dense to use your example to explain it to you. It's a bit like claiming to be a C++ developer and not recognising it when its right in front of you ... Then saying you've got lots of development work ahead of you because you're the go to guy, and trying to impress a bunch of other developers with buzz words to try to hide your embarrassment about not recognizing C++ code.

To be clear I don't doubt for a second that you are a developer, as I've said in the past. I now have doubts that you ever used a C family language, but there's nothing wring with that - other than the repeated claims that you have just to impress people - but I think you have a real problem admitting you are wrong. And you should get over that. Admitting you are wrong is saying that you learned something today, and there is nothing better than going to sleep at night knowing more than you did when woke up.
ghug (5068 D(B))
29 Apr 13 UTC
I just came back to 14 pages of excellent reading, thanks guys.

Draug, you're full of shit. Be a big boy and admit you were wrong.
Draugnar (0 DX)
29 Apr 13 UTC
I got it the first time around when I admitted I was mistaken. Did you all honestly think I actually changed my mind back to the worng perspective and suddenly jumped ship? Hahahahahaha!
Draugnar (0 DX)
29 Apr 13 UTC
@abge - To have some fun dude! It's a fucking Diplomacy forum! Not a presidential debate. Geez!
spyman (424 D(G))
29 Apr 13 UTC
ooops philcore you're going to make Draug really mad! You might not like him when he gets mad. He turns into the incredible hulk :-)
philcore (317 D(S))
29 Apr 13 UTC
(+1)
@draug, yes I honestly think that. You went on all day about it.
Draugnar (0 DX)
29 Apr 13 UTC
And since I just noticed philcore's doubts of my C# prowess and why I was brainfriend, here is the console bulk updater I was working on this weekend. If you like, I can go into detail of the classes incolved in the CAEWebServices as well as the Guru Rule Engine (my companies product). I work for Cincom Systems in Springdale Ohio. You can call them and ask for in the Acquire Services group. My name is Robert Bolin as has been established numerous times. Here is the code.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Configuration;
using System.Web;
using System.IO;
using System.Xml;
using System.Xml.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;

using Cincom.Guru.Runtime.Engine.Hierarchies;
using Cincom.Guru.Runtime.Engine.CharacteristicValues;
using Cincom.Guru.Runtime.Engine.Rules.Methods;
using Cincom.Guru.Runtime.Engine.Entities;
using Cincom.Guru.Runtime.Engine.GuruEngine;
using Cincom.Guru.Runtime.Engine.Logging;

using CAECUDUpdateConsole.CAEWebServices;
using CAECUDUpdateConsole;

namespace CAECUDUpdateConsole
{
class Program
{
private static CAEWebServices.CRMWebService crmWebService;
private static EngineMarshal engineMarshal;
private static XDocument xdDataSources;
private static List<XElement> dataSources;
private static QuoteLineItem line;
private static QuoteLineItem subline;
private static List<string> namesAdded;

static void Main(string[] args)
{
try
{
Console.WriteLine("Processing all Quotes in Cincom Acquire Express");
Console.WriteLine("Press Enter to Start (Ctrl-C to abort)");
Console.ReadLine();

Console.WriteLine("Connecting to Acquire Express Web Service...");
crmWebService = new CAEWebServices.CRMWebService();
crmWebService.CookieContainer = new CookieContainer();
crmWebService.Login(ConfigurationManager.AppSettings["CRMUser"], ConfigurationManager.AppSettings["CRMPwd"]);

Console.WriteLine("Connecting to Guru Engine Marshal...");
engineMarshal = EngineMarshal.Marshal;

Console.WriteLine("Loading Data Sources Reference File...");
string _dataSourcesFilePath = AppDomain.CurrentDomain.BaseDirectory
+ (AppDomain.CurrentDomain.BaseDirectory.EndsWith(@"\") ? "" : @"\")
+ ConfigurationManager.AppSettings["DataSourcesPath"]
+ (ConfigurationManager.AppSettings["DataSourcesPath"].EndsWith(@"\") ? "" : @"\")
+ ConfigurationManager.AppSettings["DataSourcesFile"];
xdDataSources = XDocument.Load(_dataSourcesFilePath);
dataSources = xdDataSources.Element("DataSources").Elements("DataSource").ToList();

Console.WriteLine("Getting All Quotes...");
Quote[] _quotes;
{
FilterExpression _filter = new FilterExpression();
ConditionExpression[] _conditions;

ConditionExpression _quoteCondition = new ConditionExpression();
if (ConfigurationManager.AppSettings["Quote2TestWith"] != null && ConfigurationManager.AppSettings["Quote2TestWith"].Trim() != "")
{
string[] _quoteNumbers = { ConfigurationManager.AppSettings["Quote2TestWith"] };
_quoteCondition.ConditionOperator = Operator.Equal;
_quoteCondition.Values = _quoteNumbers;
_quoteCondition.FieldName = "QuoteNumber";
}
else
{
string[] _quoteIds = { (Guid.Empty).ToString() };
_quoteCondition.ConditionOperator = Operator.NotEqual;
_quoteCondition.Values = _quoteIds;
_quoteCondition.FieldName = "Id";
}

_conditions = new ConditionExpression[] { _quoteCondition };
_filter.Conditions = _conditions;

crmWebService = new CAEWebServices.CRMWebService();
crmWebService.CookieContainer = new CookieContainer();
crmWebService.Login(ConfigurationManager.AppSettings["CRMUser"], ConfigurationManager.AppSettings["CRMPwd"]);
_quotes = crmWebService.QuoteFind(_filter, null);
}

if (_quotes.Count() > 0)
foreach (Quote _quote in _quotes)
{
Console.WriteLine("Processing " + _quote.QuoteNumber);

QuoteLineItem[] _lines;
{
FilterExpression _filter = new FilterExpression();
ConditionExpression[] _conditions;

string[] _quoteIds = { (_quote.Id).ToString() };
ConditionExpression _quoteIdCondition = new ConditionExpression();
_quoteIdCondition.FieldName = "QuoteId";
_quoteIdCondition.ConditionOperator = Operator.Equal;
_quoteIdCondition.Values = _quoteIds;

_conditions = new ConditionExpression[] { _quoteIdCondition };
_filter.Conditions = _conditions;

crmWebService = new CAEWebServices.CRMWebService();
crmWebService.CookieContainer = new CookieContainer();
crmWebService.Login(ConfigurationManager.AppSettings["CRMUser"], ConfigurationManager.AppSettings["CRMPwd"]);
_lines = crmWebService.QuoteLineItemFind(_filter, null);
}

if (_lines.Count() > 0)
_lines.ToList().Where(_line => _line.QuoteId == _quote.Id).Where(_line => _line.SubLineItemNumber == null || _line.SubLineItemNumber == 0).OrderBy(_line => _line.LineItemNumber).ToList().ForEach(_line =>
{
namesAdded = new List<string>();
Console.WriteLine(" Line " + _line.LineItemNumber.ToString() + ": " + _line.Description);
line = _line;

_lines.ToList().Where(_subline => _subline.LineItemNumber == _line.LineItemNumber).Where(_subline => _subline.SubLineItemNumber != null && _subline.SubLineItemNumber > 0).OrderBy(_subline => _subline.SubLineItemNumber).ToList().ForEach(_subline =>
{
Console.WriteLine(" SubLine " + _subline.SubLineItemNumber.ToString() + ": " + _subline.Description);

subline = _subline;
ProcessSubline();
subline = null;
});
line = null;
});
}

Console.WriteLine("All Quotes Processed.");
Console.ReadLine();
}
catch (Exception e)
{
//LogWriter.Logger.Exception(e.Message);
Console.WriteLine(e.Message.ToString());
Console.ReadLine();
}
}

private static void ProcessSubline()
{
if (subline.ConfigurationDna != null)
{
foreach (ConfigurationDnaItem _cdi in subline.ConfigurationDna.Items)
{
if (_cdi.Name != null && _cdi.Name.Trim() != "")
{
IRuleEngine _ruleEngine = GetEngine(_cdi.Name);
if (_ruleEngine != null)
{
Console.WriteLine(" Instantiated Engine: " + _ruleEngine.ModelName);
_ruleEngine.DecodeData(_cdi.Value);

List<IEntity> _backgroundEntities = Lennox.PluginShared.Common.GetBackGroundEntities(_ruleEngine.EngineKey);
List<IEntity> _caseEntities = Lennox.PluginShared.Common.GetCaseEntities(_ruleEngine.EngineKey);
List<IMultiValueEntity> _lineupEntities = Lennox.PluginShared.Common.GetLineupEntities(_ruleEngine.EngineKey);

string _caseCUD = _ruleEngine.EncodeData(_caseEntities, null);
string _lineupCUD = _ruleEngine.EncodeData(_lineupEntities.Select(_le => _le.Name).ToList().Union(_backgroundEntities.Select(_be => _be.Name).ToList()).ToList());

bool _hasDNAItem = (line.ConfigurationDna.Items.Where(_lcdi => _lcdi.Name == _cdi.Name).Count() > 0);
if (!_hasDNAItem)
{
ConfigurationDnaItem _lcdi = SerializationCopier<ConfigurationDnaItem>.DeepCopy(_cdi);
_lcdi.Value = _lineupCUD;
_lcdi.ConfigurationDnaId = line.ConfigurationDna.Id;
crmWebService.ConfigurationDnaItemAdd(_lcdi);
line = crmWebService.QuoteLineItemGet(line.Id);
namesAdded.Add(_cdi.Name);
}
else if (!namesAdded.Contains(_cdi.Name))
{
// log the pre-existence
Console.WriteLine(" SKIPPED: " + _cdi.Name + " already exists on lineup.");
}

_cdi.Value = _caseCUD;
crmWebService.ConfigurationDnaItemUpdate(_cdi);

engineMarshal.RemoveEngine(_ruleEngine.EngineKey);
}
}
}
}
}


private static IRuleEngine GetEngine(string sourceName)
{
IRuleEngine _ruleEngine = null;

string _engineName = null;
dataSources.Where(_ds => _ds.Attribute("source-name").Value == sourceName).ToList().ForEach(_ds =>
{
_engineName = _ds.Element("Source").Value;
if (_engineName != null && _engineName.Trim() != "")
{
string _fullEngineName = ConfigurationManager.AppSettings["GuruModelPath"]
+ (ConfigurationManager.AppSettings["GuruModelPath"].EndsWith(@"\") ? "" : @"\")
+ _engineName;
_engineName = _fullEngineName;
}
});

if (_engineName != null)
{
_ruleEngine = engineMarshal.CreateEngineAndLoadRules(_engineName);
}

return _ruleEngine;
}
}

public static class SerializationCopier<T>
{
public static T DeepCopy(object objectToCopy)
{
using (MemoryStream _memoryStream = new MemoryStream())
{
BinaryFormatter _binaryFormatter = new BinaryFormatter();
_binaryFormatter.Serialize(_memoryStream, objectToCopy);
_memoryStream.Seek(0, SeekOrigin.Begin);
return (T)_binaryFormatter.Deserialize(_memoryStream);
}
}
}
}
Draugnar (0 DX)
29 Apr 13 UTC
And here is a library I wrote to provide quote, group, line, and subline discounting functionality to a discoutning front end I wrote. I can't provide the front end code as it is confidential for the client where as this is not. Note the use of the same Serializable object Deep Copy class.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net;
using System.Configuration;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Web.Services.Protocols;
using Discounting.AEWebReference;
using Discounting;
using System.Reflection;

namespace Discounting
{
public static class SerializationCopier<T>
{
public static T DeepCopy(object objectToCopy)
{
using (MemoryStream _memoryStream = new MemoryStream())
{
BinaryFormatter _binaryFormatter = new BinaryFormatter();
_binaryFormatter.Serialize(_memoryStream, objectToCopy);
_memoryStream.Seek(0, SeekOrigin.Begin);
return (T)_binaryFormatter.Deserialize(_memoryStream);
}
}
}

public class DisplayGroup : object
{
public DisplayGroup()
{
}

public DisplayGroup(string _group, string _description)
{
group = _group;
description = _description;
}

private string group;
private string description;

public string Group
{
get { return group; }
set { group = value; }
}

public string Description
{
get { return description; }
set { description = value; }
}
}

public class CAEDiscountingLibrary
{
public enum DiscountType { Percentage, Amount, Override };
public enum QuoteLineOrder { Display, Price };

private List<QuoteLineItem> quoteLineItemList;
private List<QuoteLineItem> quoteLineItemListReadOnly;
private List<QuoteGroup> groupList;
private Quote activeQuote;

private AEWebReference.CRMWebService crmWebService;

public CAEDiscountingLibrary()
{
crmWebService = new AEWebReference.CRMWebService();
crmWebService.CookieContainer = new CookieContainer();
crmWebService.Login(ConfigurationManager.AppSettings["CRMUser"], ConfigurationManager.AppSettings["CRMPwd"]);
}

public CAEDiscountingLibrary(string quoteId)
{
crmWebService = new AEWebReference.CRMWebService();
crmWebService.CookieContainer = new CookieContainer();
crmWebService.Login(ConfigurationManager.AppSettings["CRMUser"], ConfigurationManager.AppSettings["CRMPwd"]);
LoadQuoteAndLines(quoteId);
}

public string GetFirstUserIDByType(string[] typecode)
{
FilterExpression _filter = new FilterExpression();
ConditionExpression[] _conditions;

ConditionExpression _userCondition = new ConditionExpression();
_userCondition.ConditionOperator = Operator.Equal;
_userCondition.FieldName = "Type";
_userCondition.Values = typecode;

_conditions = new ConditionExpression[] { _userCondition };

_filter.Conditions = _conditions;

User[] _u = crmWebService.UserFind(_filter, null);

if (_u != null && _u.Count() > 0 && _u[0].Id != null)
{
return _u[0].Id;
}
else
{
return null;
}
}

public void LoadQuoteAndLines(string quoteId)
{
try
{
activeQuote = crmWebService.QuoteGet(quoteId);
}
catch (Exception _exc)
{
}
if (activeQuote == null || activeQuote.Id == "") return;

{
FilterExpression _filter = new FilterExpression();
ConditionExpression[] _conditions;

string[] _quoteIds = { quoteId };
ConditionExpression _quoteIdCondition = new ConditionExpression();
_quoteIdCondition.ConditionOperator = Operator.Equal;
_quoteIdCondition.FieldName = "QuoteId";
_quoteIdCondition.Values = _quoteIds;

_conditions = new ConditionExpression[] { _quoteIdCondition };

_filter.Conditions = _conditions;

QuoteGroup[] _groups = crmWebService.QuoteGroupFind(_filter, null);

if (_groups != null && _groups.Count() > 0)
{
groupList = _groups.ToList();
}
else
{
groupList = null;
}
}

{
FilterExpression _filter = new FilterExpression();
ConditionExpression[] _conditions;

string[] _quoteIds = { quoteId };
ConditionExpression _quoteIdCondition = new ConditionExpression();
_quoteIdCondition.ConditionOperator = Operator.Equal;
_quoteIdCondition.FieldName = "QuoteId";
_quoteIdCondition.Values = _quoteIds;

_conditions = new ConditionExpression[] { _quoteIdCondition };

_filter.Conditions = _conditions;

QuoteLineItem[] _lines = crmWebService.QuoteLineItemFind(_filter, null);

quoteLineItemList = _lines.ToList();
quoteLineItemList = quoteLineItemList.FindAll(_qli => (_qli.IsExcludedFromQuoteAmount == null || _qli.IsExcludedFromQuoteAmount == false) || (_qli.SubLineItemNumber == null || _qli.SubLineItemNumber == 0));

quoteLineItemList.FindAll(_qli => _qli.SubLineItemNumber == null || _qli.SubLineItemNumber == 0).ForEach(_qli =>
{
_qli.UnitCost = GetLinePrice(_qli.Id);
_qli.UnitPrice = GetLineListPrice(_qli.Id);
_qli.ManualDiscountAmount = GetLineDiscountAmount(_qli.Id);
_qli.ExtendedAmount = GetLineNetPrice(_qli.Id);
});

//quoteLineItemList = quoteLineItemList.FindAll(_qli => _qli.UnitPrice != null && _qli.UnitCost != null && _qli.UnitPrice != 0 && _qli.UnitPrice == _qli.UnitCost);
quoteLineItemList = quoteLineItemList.FindAll(_qli => _qli.UnitPrice != null && _qli.UnitCost != null && _qli.UnitPrice != 0);
quoteLineItemList.ForEach(_qli => _qli.DiscountPercentage = 100 * _qli.ManualDiscountAmount / _qli.UnitPrice);
quoteLineItemListReadOnly = SerializationCopier<List<QuoteLineItem>>.DeepCopy(quoteLineItemList.FindAll(
_qli => (_qli.SubLineItemNumber != null && _qli.SubLineItemNumber > 0)
|| ((_qli.SubLineItemNumber == null || _qli.SubLineItemNumber == 0)
&& ((_qli.IsExcludedFromQuoteAmount == null) || (_qli.IsExcludedFromQuoteAmount == false)))));
}
}

private void RollUpSublines()
{
foreach (QuoteLineItem _line in quoteLineItemList)
{
_line.UnitPrice = GetLineListPrice(_line.Id);
_line.UnitCost = GetLinePrice(_line.Id);
_line.ExtendedAmount = GetLineNetPrice(_line.Id);
_line.ManualDiscountAmount = GetLineDiscountAmount(_line.Id);
_line.DiscountPercentage = GetLineDiscountPercent(_line.Id);
_line.Group = GetLineGroup(_line.Id);
}
}

//public bool VerifyDiscount(string quoteId, string userName)
//{
// bool retval = false;

// FilterExpression usersFilter = new FilterExpression();
// ConditionExpression userNameCondition = new ConditionExpression();
// userNameCondition.ConditionOperator = Operator.Equal;
// userNameCondition.FieldName = "";
// string[] usersFilterValues = { userName };
// userNameCondition.Values = usersFilterValues;

// ConditionExpression[] usersFilterConditions = { userNameCondition };
// usersFilter.Conditions = usersFilterConditions;
// User[] users = crmWebService.UserFind(usersFilter, null);
// User user = null;
// if (users != null && users.Count() > 0)
// {
// user = users[0];
// }

// if (user == null)
// {
// return retval;
// }

// string userType = user.Type;

// GuruAjaxServices guruAjaxService = new GuruAjaxServices();
// string ajaxControllerId = guruAjaxService.GetAjaxControllerId();
// guruAjaxService.InitializeEngine(ajaxControllerId);




// Quote quote = GetQuoteById(quoteId);

// List<QuoteLineItem> lines = GetQuoteLineItemsForQuoteId(quoteId, QuoteLineOrder.Display, true);

// return retval;
//}

public void ApplyQuoteDiscount(string discount, DiscountType discountType)
{
decimal? _quotePriceNullable;
decimal _quotePrice;
decimal _discountPct;
decimal _discountAmt;

_quotePriceNullable = GetQuoteListPrice();
_quotePrice = (_quotePriceNullable == null ? 0 : (decimal)_quotePriceNullable);

if (discount != null & discount.Trim() != "")
{
if (discountType == DiscountType.Amount)
{
_discountAmt = decimal.Parse(discount);
if (_quotePrice != 0)
{
_discountPct = Math.Round((_discountAmt / _quotePrice) * 10000) / 100;
}
else
{
_discountPct = (decimal)100.0;
}
}
else if (discountType == DiscountType.Override)
{
decimal _overrideAmt = decimal.Parse(discount);
_discountAmt = _quotePrice - _overrideAmt;
if (_quotePrice != 0)
{
_discountPct = Math.Round((_discountAmt / _quotePrice) * 10000) / 100;
}
else
{
_discountPct = (decimal)100.0;
}
}
else
{
_discountPct = decimal.Parse(discount);
_discountAmt = Math.Round(_quotePrice * (_discountPct)) / 100;
}
}
else
{
return;
}

List<QuoteLineItem> lines = GetQuoteLineItems(QuoteLineOrder.Price, false);
foreach (QuoteLineItem _line in lines)
{
if (lines.IndexOf(_line) == lines.Count - 1)
{
if (discountType == DiscountType.Percentage)
{
ApplyLineDiscount(_line.Id, _discountPct.ToString(), DiscountType.Percentage);
}
else
{
ApplyLineDiscount(_line.Id, _discountAmt.ToString(), DiscountType.Amount);
}
}
else
{
decimal? _lineDiscount = _line.UnitPrice * (((decimal?)_discountPct) / 100) * (_line.Quantity == null || _line.Quantity == 0 ? 1 : _line.Quantity);

if (discountType == DiscountType.Percentage)
{
ApplyLineDiscount(_line.Id, _discountPct.ToString(), DiscountType.Percentage);
}
else
{
ApplyLineDiscount(_line.Id, _lineDiscount.ToString(), DiscountType.Amount);
}
_discountAmt -= (decimal)_lineDiscount;
}
}
RollUpSublines();
}

public void ApplyGroupDiscount(string group, string discount, DiscountType discountType)
{
decimal? _groupPriceNullable;
decimal _groupPrice;
decimal _discountPct;
decimal _discountAmt;

_groupPriceNullable = GetGroupListPrice(group);
_groupPrice = (_groupPriceNullable == null ? 0 : (decimal)_groupPriceNullable);

if (discount != null & discount.Trim() != "")
{
if (discountType == DiscountType.Amount)
{
_discountAmt = decimal.Parse(discount);
if (_groupPrice != 0)
{
_discountPct = Math.Round((_discountAmt / _groupPrice) * 10000) / 100;
}
else
{
_discountPct = (decimal)100.0;
}
}
else if (discountType == DiscountType.Override)
{
decimal _overrideAmt = decimal.Parse(discount);
_discountAmt = _groupPrice - _overrideAmt;
if (_groupPrice != 0)
{
_discountPct = Math.Round((_discountAmt / _groupPrice) * 10000) / 100;
}
else
{
_discountPct = (decimal)100.0;
}
}
else
{
_discountPct = decimal.Parse(discount);
_discountAmt = Math.Round(_groupPrice * (_discountPct)) / 100;
}
}
else
{
return;
}

List<QuoteLineItem> lines = GetGroupLineItems(group, QuoteLineOrder.Price, false);
foreach (QuoteLineItem _line in lines)
{
if (lines.IndexOf(_line) == lines.Count - 1)
{
if (discountType == DiscountType.Percentage)
{
ApplyLineDiscount(_line.Id, _discountPct.ToString(), DiscountType.Percentage);
}
else
{
ApplyLineDiscount(_line.Id, _discountAmt.ToString(), DiscountType.Amount);
}
}
else
{
decimal? _lineDiscount = _line.UnitPrice * (((decimal?)_discountPct) / 100) * (_line.Quantity == null || _line.Quantity == 0 ? 1 : _line.Quantity);

if (discountType == DiscountType.Percentage)
{
ApplyLineDiscount(_line.Id, _discountPct.ToString(), DiscountType.Percentage);
}
else
{
ApplyLineDiscount(_line.Id, _lineDiscount.ToString(), DiscountType.Amount);
}
_discountAmt -= (decimal)_lineDiscount;
}
}
RollUpSublines();
}

public void ApplyLineDiscount(string quoteLineItemId, string discount, DiscountType discountType)
{
decimal? _linePriceNullable;
decimal _linePrice;
decimal _discountPct;
decimal _discountAmt;

_linePriceNullable = GetLineListPrice(quoteLineItemId);
_linePrice = (_linePriceNullable == null ? 0 : (decimal)_linePriceNullable);

if (discount != null & discount.Trim() != "")
{
if (discountType == DiscountType.Amount)
{
_discountAmt = decimal.Parse(discount);
if (_linePrice != 0)
{
_discountPct = Math.Round((_discountAmt / _linePrice) * 10000) / 100;
}
else
{
_discountPct = (decimal)100.0;
}
}
else if (discountType == DiscountType.Override)
{
decimal _overrideAmt = decimal.Parse(discount);
_discountAmt = _linePrice - _overrideAmt;
if (_linePrice != 0)
{
_discountPct = Math.Round((_discountAmt / _linePrice) * 10000) / 100;
}
else
{
_discountPct = (decimal)100.0;
}
}
else
{
_discountPct = decimal.Parse(discount);
_discountAmt = Math.Round(_linePrice * (_discountPct)) / 100;
}
}
else
{
return;
}

QuoteLineItem _quoteLineItem = GetQuoteLineItemById(quoteLineItemId);
List<QuoteLineItem> _sublines = GetSubLinesForLineId(quoteLineItemId, QuoteLineOrder.Price);

if ((_quoteLineItem.SubLineItemNumber == null || _quoteLineItem.SubLineItemNumber == 0) && (_sublines != null && _sublines.Count > 0))
{
foreach (QuoteLineItem _subline in _sublines)
{
if (_sublines.IndexOf(_subline) == _sublines.Count - 1)
{
if (discountType == DiscountType.Percentage)
{
ApplyLineDiscount(_subline.Id, _discountPct.ToString(), DiscountType.Percentage);
}
else
{
ApplyLineDiscount(_subline.Id, _discountAmt.ToString(), DiscountType.Amount);
}
}
else
{
decimal? _lineDiscount = _subline.UnitPrice * (((decimal?)_discountPct / 100)) * (_subline.Quantity == null || _subline.Quantity == 0 ? 1 : _subline.Quantity);

if (discountType == DiscountType.Percentage)
{
ApplyLineDiscount(_subline.Id, _discountPct.ToString(), DiscountType.Percentage);
}
else
{
ApplyLineDiscount(_subline.Id, _lineDiscount.ToString(), DiscountType.Amount);
}
_discountAmt -= (decimal)_lineDiscount;
}
}
}
else
{
_quoteLineItem.ExtendedAmount = (_quoteLineItem.UnitPrice * (_quoteLineItem.Quantity == null || _quoteLineItem.Quantity == 0 ? 1 : _quoteLineItem.Quantity)) - ((decimal?)_discountAmt);
_quoteLineItem.ManualDiscountAmount = _discountAmt;
_quoteLineItem.DiscountPercentage = null;
}
RollUpSublines();
}

public void SaveDiscounts()
{
quoteLineItemList.FindAll(
_qli => (_qli.SubLineItemNumber != null && _qli.SubLineItemNumber > 0)
|| ((_qli.SubLineItemNumber == null || _qli.SubLineItemNumber == 0)
&& ((_qli.IsExcludedFromQuoteAmount == null) || (_qli.IsExcludedFromQuoteAmount == false)))
).ForEach(_qli =>
{
if (quoteLineItemListReadOnly.Exists(_qlire => _qlire.Id == _qli.Id && _qlire.ExtendedAmount != _qli.ExtendedAmount))
{
_qli.IsPriceOverridden = true;
_qli.ExtendedAmount = _qli.UnitPrice - _qli.ManualDiscountAmount;
crmWebService.QuoteLineItemUpdate(_qli);
}
});
quoteLineItemListReadOnly = SerializationCopier<List<QuoteLineItem>>.DeepCopy(quoteLineItemList.FindAll(
_qli => (_qli.SubLineItemNumber != null && _qli.SubLineItemNumber > 0)
|| ((_qli.SubLineItemNumber == null || _qli.SubLineItemNumber == 0)
&& ((_qli.IsExcludedFromQuoteAmount == null) || (_qli.IsExcludedFromQuoteAmount == false)))));
}

public Quote GetQuote()
{
return activeQuote;
}

public Quote GetQuoteById(string quoteId)
{
Quote _retval = null;
try
{
_retval = crmWebService.QuoteGet(quoteId);
}
catch (Exception _exc)
{
}
return _retval;
}

public QuoteGroup GetGroupByGroup(string group)
{
QuoteGroup _retval = null;
QuoteGroup _group = groupList.Find(_n => _n.Group.Equals(group));
if (_group != null && _group.Id != "")
{
_retval = _group;
}
return _retval;
}

public List<QuoteLineItem> GetGroupLineItems(string groupName, QuoteLineOrder quoteLineOrder, bool includeSubLines)
{
List<QuoteLineItem> _retval = new List<QuoteLineItem>();
if (!includeSubLines)
{
List<QuoteLineItem> _filtered = quoteLineItemList.FindAll(_g => _g.Group != null && _g.Group.Equals(groupName));
//_filtered = _filtered.FindAll(lpc => lpc.UnitCost == lpc.UnitPrice);
_filtered = _filtered.FindAll(_slin => _slin.SubLineItemNumber.Equals(null));
if (_filtered != null && _filtered.Count > 0)
_retval.AddRange(_filtered);
_filtered = _filtered.FindAll(_slin => _slin.SubLineItemNumber.Equals(0));
if (_filtered != null && _filtered.Count > 0)
_retval.AddRange(_filtered);
}
else
{
_retval = quoteLineItemList.FindAll(_g => _g.Group.Equals(groupName));
}

if (quoteLineOrder == QuoteLineOrder.Display)
{
return _retval.OrderBy(lin => lin.LineItemNumber).ThenBy(slin => slin.SubLineItemNumber).ToList();
}
else if (quoteLineOrder == QuoteLineOrder.Price)
{
return _retval.OrderBy(up => up.UnitPrice).ToList();
}
else
{
return _retval;
}
}

public decimal? GetGroupPrice(string groupName)
{
decimal? _retval = 0;

List<QuoteLineItem> _lines = new List<QuoteLineItem>();
_lines = GetGroupLineItems(groupName, QuoteLineOrder.Display, false);
if (_lines != null && _lines.Count > 0)
{
foreach (QuoteLineItem _line in _lines)
{
//if (!(GetLineListPrice(_line.Id) > GetLinePrice(_line.Id)))
{
_retval += GetLinePrice(_line.Id);
}
}
}

return _retval;
}

public decimal? GetGroupListPrice(string groupName)
{
decimal? _retval = 0;

List<QuoteLineItem> _lines = new List<QuoteLineItem>();
_lines = GetGroupLineItems(groupName, QuoteLineOrder.Display, false);
if (_lines != null && _lines.Count > 0)
{
foreach (QuoteLineItem _line in _lines)
{
//if (!(GetLineListPrice(_line.Id) > GetLinePrice(_line.Id)))
{
_retval += GetLineListPrice(_line.Id);
}
}
}

return _retval;
}

public decimal? GetGroupNetPrice(string groupName)
{
decimal? _retval = 0;

List<QuoteLineItem> _lines = new List<QuoteLineItem>();
_lines = GetGroupLineItems(groupName, QuoteLineOrder.Display, false);
if (_lines != null && _lines.Count > 0)
{
foreach (QuoteLineItem _line in _lines)
{
//if (GetLineListPrice(_line.Id) <= GetLinePrice(_line.Id))
{
_retval += GetLineNetPrice(_line.Id);
}
}
}

return _retval;
}

public decimal? GetGroupDiscountAmount(string groupName)
{
decimal? _retval = 0;

List<QuoteLineItem> _lines = new List<QuoteLineItem>();
_lines = GetGroupLineItems(groupName, QuoteLineOrder.Display, false);
if (_lines != null && _lines.Count > 0)
{
foreach (QuoteLineItem _line in _lines)
{
if (!(GetLineListPrice(_line.Id) > GetLinePrice(_line.Id)))
{
_retval += GetLineDiscountAmount(_line.Id);
}
}
}

return _retval;
}

public decimal? GetGroupDiscountPercent(string groupName)
{
decimal? _retval = null;
decimal? _discount = 0;
decimal? _unitprice = 0;

List<QuoteLineItem> _lines = GetGroupLineItems(groupName, QuoteLineOrder.Display, false);
_retval = 0;
if (_lines != null && _lines.Count > 0)
{
foreach (QuoteLineItem _line in _lines)
{
_discount += GetLineDiscountAmount(_line.Id) == null ? 0 : GetLineDiscountAmount(_line.Id);
_unitprice += GetLineListPrice(_line.Id) == null ? 0 : GetLineListPrice(_line.Id);
}
_retval = (_unitprice == 0 ? 0 : _discount / _unitprice);
}
return _retval;
}

public List<QuoteLineItem> GetQuoteLineItems(QuoteLineOrder quoteLineOrder, bool includeSubLines)
{
List<QuoteLineItem> _retval = new List<QuoteLineItem>();
//List<QuoteLineItem> _filtered = quoteLineItemList.FindAll(_f => GetLineListPrice(_f.Id) == GetLinePrice(_f.Id));
List<QuoteLineItem> _filtered = quoteLineItemList;
if (!includeSubLines)
{
_filtered = _filtered.FindAll(_qlil => _qlil.SubLineItemNumber.Equals(null));
if (_filtered != null && _filtered.Count > 0)
_retval.AddRange(_filtered);

_filtered = quoteLineItemList.FindAll(_qlil => _qlil.SubLineItemNumber.Equals(0));
if (_filtered != null && _filtered.Count > 0)
_retval.AddRange(_filtered);
}
else
{
_retval = _filtered;
}

if (quoteLineOrder == QuoteLineOrder.Display)
{
return _retval.OrderBy(lin => lin.LineItemNumber).ThenBy(slin => slin.SubLineItemNumber).ToList();
}
else if (quoteLineOrder == QuoteLineOrder.Price)
{
return _retval.OrderBy(up => up.UnitPrice).ToList();
}
else
{
return _retval;
}
}

public decimal? GetQuotePrice()
{
decimal? _retval = 0;
List<QuoteLineItem> _lines = new List<QuoteLineItem>();
_lines = GetQuoteLineItems(QuoteLineOrder.Display, false);
if (_lines != null && _lines.Count > 0)
{
foreach (QuoteLineItem _line in _lines)
{
//if (!(GetLineListPrice(_line.Id) > GetLinePrice(_line.Id)))
{
_retval += GetLinePrice(_line.Id);
}
}
}

return _retval;
}

public decimal? GetQuoteListPrice()
{
decimal? _retval = 0;
List<QuoteLineItem> _lines = new List<QuoteLineItem>();
_lines = GetQuoteLineItems(QuoteLineOrder.Display, false);
if (_lines != null && _lines.Count > 0)
{
foreach (QuoteLineItem _line in _lines)
{
//if (!(GetLineListPrice(_line.Id) > GetLinePrice(_line.Id)))
{
_retval += GetLineListPrice(_line.Id);
}
}
}

return _retval;
}

public decimal? GetQuoteNetPrice()
{
decimal? _retval = 0;
List<QuoteLineItem> _lines = new List<QuoteLineItem>();
_lines = GetQuoteLineItems(QuoteLineOrder.Display, false);
if (_lines != null && _lines.Count > 0)
{
foreach (QuoteLineItem _line in _lines)
{
//if (GetLineListPrice(_line.Id) <= GetLinePrice(_line.Id))
{
_retval += GetLineNetPrice(_line.Id);
}
}
}

return _retval;
}

public decimal? GetQuoteDiscountAmount()
{
decimal? _retval = 0;

List<QuoteLineItem> _lines = GetQuoteLineItems(QuoteLineOrder.Display, false);
if (_lines != null && _lines.Count > 0)
{
_retval = 0;
foreach (QuoteLineItem _line in _lines)
{
_retval += GetLineDiscountAmount(_line.Id);
}
}

return _retval;
}

public decimal? GetQuoteDiscountPercent()
{
decimal? _retval = null;
decimal? _discount = 0;
decimal? _unitprice = 0;

List<QuoteLineItem> _lines = GetQuoteLineItems(QuoteLineOrder.Display, false);
_retval = 0;
if (_lines != null && _lines.Count > 0)
{
foreach (QuoteLineItem _line in _lines)
{
_discount += GetLineDiscountAmount(_line.Id) == null ? 0 : GetLineDiscountAmount(_line.Id);
_unitprice += GetLineListPrice(_line.Id) == null ? 0 : GetLineListPrice(_line.Id);
}
_retval = (_unitprice == 0 ? 0 : _discount / _unitprice);
} return _retval;
}

public QuoteLineItem GetQuoteLineItemById(string quoteLineItemId)
{
return quoteLineItemList.Find(_id => _id.Id.Equals(quoteLineItemId));
}

public List<QuoteLineItem> GetSubLinesForLineId(string quoteLineItemId, QuoteLineOrder quoteLineOrder)
{
List<QuoteLineItem> _retval = new List<QuoteLineItem>();

QuoteLineItem _line = quoteLineItemList.Find(qlil => qlil.Id == quoteLineItemId);

_retval = quoteLineItemList.FindAll(qlil => qlil.LineItemNumber == _line.LineItemNumber);
_retval = _retval.FindAll(_rv => _rv.SubLineItemNumber != null);
_retval = _retval.FindAll(_rv => _rv.SubLineItemNumber != 0);
//_retval = _retval.FindAll(_rv => _rv.UnitCost == _rv.UnitPrice);
if (quoteLineOrder == QuoteLineOrder.Display)
{
List<QuoteLineItem> _qli = _retval.OrderBy(lin => lin.LineItemNumber).ThenBy(slin => slin.SubLineItemNumber).ToList();
return _retval;
}
else if (quoteLineOrder == QuoteLineOrder.Price)
{
return _retval.OrderBy(up => up.UnitPrice).ToList();
}
else
{
return _retval;
}
}

public decimal? GetLinePrice(string quoteLineItemId)
{
decimal? _retval = 0;
QuoteLineItem _quoteLineItem = GetQuoteLineItemById(quoteLineItemId);

if (_quoteLineItem != null && _quoteLineItem.Id != "")
{
List<QuoteLineItem> _sublines = GetSubLinesForLineId(quoteLineItemId, QuoteLineOrder.Display);
if ((_quoteLineItem.SubLineItemNumber == null || _quoteLineItem.SubLineItemNumber == 0) && (_sublines != null && _sublines.Count > 0))
{
_retval = 0;
foreach (QuoteLineItem _subline in _sublines)
{
_retval += GetLinePrice(_subline.Id);
}
}
else
{
decimal? _listprice = GetLineListPrice(quoteLineItemId);
decimal? _discount = GetLineDiscountAmount(quoteLineItemId);
_retval = (_listprice != null ? _listprice : 0) - (_discount != null ? _discount : 0);
}
}

return _retval;
}

public decimal? GetLineListPrice(string quoteLineItemId)
{
decimal? _retval = 0;
QuoteLineItem _quoteLineItem = GetQuoteLineItemById(quoteLineItemId);
if (_quoteLineItem != null && _quoteLineItem.Id != "")
{
List<QuoteLineItem> _sublines = GetSubLinesForLineId(quoteLineItemId, QuoteLineOrder.Display);
if ((_quoteLineItem.SubLineItemNumber == null || _quoteLineItem.SubLineItemNumber == 0) && (_sublines != null && _sublines.Count > 0))
{
_retval = 0;
foreach (QuoteLineItem _subline in _sublines)
{
_retval += GetLineListPrice(_subline.Id);
}
}
else
{
_retval = _quoteLineItem.UnitPrice != null ? _quoteLineItem.UnitPrice : 0;
}
}

return _retval;
}

public decimal? GetLineNetPrice(string quoteLineItemId)
{
decimal? _retval = 0;
QuoteLineItem _quoteLineItem = GetQuoteLineItemById(quoteLineItemId);

if (_quoteLineItem != null && _quoteLineItem.Id != "")
{
List<QuoteLineItem> _sublines = GetSubLinesForLineId(quoteLineItemId, QuoteLineOrder.Display);
if ((_quoteLineItem.SubLineItemNumber == null || _quoteLineItem.SubLineItemNumber == 0) && (_sublines != null && _sublines.Count > 0))
{
_retval = 0;
foreach (QuoteLineItem _subline in _sublines)
{
_retval += GetLineNetPrice(_subline.Id);
}
}
else
{
_retval = _quoteLineItem.ExtendedAmount != null ? _quoteLineItem.ExtendedAmount : 0;
}
}

return _retval;
}

public decimal? GetLineDiscountAmount(string quoteLineItemId)
{
decimal? _retval = 0;
QuoteLineItem _quoteLineItem = GetQuoteLineItemById(quoteLineItemId);

if (_quoteLineItem != null && _quoteLineItem.Id != "")
{
List<QuoteLineItem> _sublines = GetSubLinesForLineId(quoteLineItemId, QuoteLineOrder.Display);
if ((_quoteLineItem.SubLineItemNumber == null || _quoteLineItem.SubLineItemNumber == 0) && (_sublines != null && _sublines.Count > 0))
{
_retval = 0;
foreach (QuoteLineItem _subline in _sublines)
{
_retval += GetLineDiscountAmount(_subline.Id);
}
}
else
{
_retval = _quoteLineItem.ManualDiscountAmount != null ? _quoteLineItem.ManualDiscountAmount : 0;
}
}

return _retval;
}

public decimal? GetLineDiscountPercent(string quoteLineItemId)
{
decimal? _discount = 0;
decimal? _listprice = 0;
decimal? _retval = null;
QuoteLineItem _quoteLineItem = GetQuoteLineItemById(quoteLineItemId);

if (_quoteLineItem != null && _quoteLineItem.Id != "")
{
_discount = GetLineDiscountAmount(quoteLineItemId) == null ? 0 : GetLineDiscountAmount(quoteLineItemId);
_listprice = GetLineListPrice(quoteLineItemId) == null ? 0 : GetLineListPrice(quoteLineItemId);
_retval = (_listprice == 0 ? 0 : _discount / _listprice);
}

return _retval;
}

private string GetLineGroup(string quoteLineItemId)
{
QuoteLineItem _quoteLineItem = GetQuoteLineItemById(quoteLineItemId);
return _quoteLineItem.Group;
}
}
}
philcore (317 D(S))
29 Apr 13 UTC
(+2)
Ok, my doubts have been disproven, I was wrong. You do indeed do c# programming. See how easy it is? But look at the extent you went to to make sure it was known that you do c# ... You actually posted what is most likely proprietary code on a Fucking game forum! Just to save face! If one of my SEs did that, I would have a serious problem with that.

You have an insecurity issue and even though its clear that you know a lot of shit, you don't seem satisfied with yourself. Like I said before, the way to learn new stuff is to realize that there are things you don't know. And to be able to admit it to your peers.
Draugnar (0 DX)
29 Apr 13 UTC
And here is a part of the output from the first console app I posted. It's running on the entire set of Quotes and Revisions off our test server now.

Processing MO20130410134423
Line 1: LU1 20' Case 710, M/D Dairy, DX8UN
SubLine 1: DX8UN08R_L1_P1
Instantiated Engine: ElectricalAndControls
Instantiated Engine: EndOptions
Instantiated Engine: ExteriorOptions
Instantiated Engine: InteriorOptions
Instantiated Engine: MerchandisingOptions
Instantiated Engine: RefrigerationOptions
Instantiated Engine: UpperDisplayOptions
SubLine 2: DX8UN12R_L1_P2
Instantiated Engine: ElectricalAndControls
Instantiated Engine: EndOptions
Instantiated Engine: ExteriorOptions
Instantiated Engine: InteriorOptions
Instantiated Engine: MerchandisingOptions
Instantiated Engine: RefrigerationOptions
Instantiated Engine: UpperDisplayOptions
Line 2: LU2 12' Case 710, M/D Dairy, DX8UN
SubLine 1: DX8UN12R_L2_P1
Instantiated Engine: ElectricalAndControls
Instantiated Engine: EndOptions
Instantiated Engine: ExteriorOptions
Draugnar (0 DX)
29 Apr 13 UTC
Now do you believe that I know C# and was just brain fried from working 15+ hour days all week for this client?
erist (228 D(B))
29 Apr 13 UTC
Man throw that code in a damn link or something, geez. Also, isn't that shit proprietary?
Draugnar (0 DX)
29 Apr 13 UTC
And none of that was proprietary. The first chunk was for a mass conversion and will be more or less discarded as it is a one time conversion and the second code we include as part of a template to any customer who buys Aqcuire Express and it is released royalty free so they can do with it what they like. The client specific front end that uses it, I did *not* include because it is proprietary.
Draugnar (0 DX)
29 Apr 13 UTC
No, erist. And if I weren't so damn brainfried and wanted to spend the time, I would just have developed all three examples (original coint toss, my twisted coin toss, and the three marbles in a bag) in C# and posted them, but it was quicker and easier to just copy and paste a couple of .cs files I knew weren't proprietary and that I had written in full, myself.
Draugnar (0 DX)
29 Apr 13 UTC
I will readily admit my C++ is ancient and mostly forgotten. I have to look up every time I want to use a pointer. Same goes for my Java as I haven't coded Java dince JDK 1.2 when I got my certification. I am almost exclusively a C#.Net and T-SQL developer with SSRS and SSAS capabilities as well. Of course XML and ASP/HTML/Javascript come with the territory.
philcore (317 D(S))
29 Apr 13 UTC
Making progress, now admit that the marble thing never even entered your mind until right before you posted about it, and we'll be off to the races :-)
Draugnar (0 DX)
29 Apr 13 UTC
So I had a marble epiphany? Seeing as nothing involving marbles or pulling three marked elements from a bag or anything even remotely similar ever came up in this thread, I just had an epiphany? Jesus, I must be a fucking genius!
Draugnar (0 DX)
29 Apr 13 UTC
And why do you think I never offered to take the bet up with abge tossing the coins? Because I *knew* he was rtight. I don't make bets unless I think I can win them and I haven't actually accepted a bet yet in this entire time, just offered to split it when I first laid out the difference between concrete/discrete where we have additional knowledge gained first hand versus conceptual knowledge where we only know a single aspect and how we know it gives no additional clues. Seriously, do I seem that stupid too you yet intelligent enough to have some epiphany *and* come up with a reason why so easily?

I gave up the charade cause I was tired of trolling. That's all. It was fun and the fun died off. the joke was over, so I showed you the man behind the curtain that was Draugnar's persona for the weekend.
philcore (317 D(S))
29 Apr 13 UTC
(+2)
The marble epiphany was a good start, but then you regressed calling it a charade.

We all know you better than that draug. We know when you're trolling and when you're being stubborn, when you're trying too hard to impress, and when you're honestly trying to argue your point. This was the latter and we all know that. If you're anything, you're transparent. Nothing wrong with that, BTW ... I'm also transparent. I just don't ever try to convince anyone otherwise. Life is much simpler that way.
Draugnar (0 DX)
29 Apr 13 UTC
So my marble epiphany was an actual epiphany and I'm a fucking genius? Good to know.
philcore (317 D(S))
29 Apr 13 UTC
An epiphany doesn't make you a genius ... It just means you saw something from a perspective you didn't see before. So IRA I believe you had an epiphany. I dont, however think that your epiphany of marbles in a bag, was that great of an epiphany. I actually question the logic of your marble example. I think coins are way more analogous, but of your marbles in a bag epiphany helped you to understand the problem, then that's great.
tendmote (100 D(B))
29 Apr 13 UTC
Does anyone here flip a coin to decide their Diplomacy moves, so that there *is* an element of chance?
SYnapse (0 DX)
29 Apr 13 UTC
I role a number of six-sided dies
SYnapse (0 DX)
29 Apr 13 UTC
Also note that I role them all at once, rather than seperately. this increases the probability that I will take Vienna
tendmote (100 D(B))
29 Apr 13 UTC
Does anyone here flip a coin to decide their Diplomacy moves, so that there *is* an element of chance?

Page 15 of 16
FirstPreviousNextLast
 

457 replies
markturrieta (400 D)
28 Apr 13 UTC
Leaving a game
How do you leave a game? Is there a way to end your participation immediately (so the other players know) or do you just stop playing and the other players just see that you "missed the last phase" and wonder if you're coming back?
14 replies
Open
NigeeBaby (100 D(G))
29 Apr 13 UTC
(+1)
Jason Colliny
http://www.bbc.co.uk/news/world-us-canada-22341153
17 replies
Open
Jamiet99uk (873 D)
28 Apr 13 UTC
The Self-Hating State, The Market, and the Environment
Read this:

http://www.monbiot.com/2013/04/22/the-self-hating-state/
14 replies
Open
Tolstoy (1962 D)
26 Apr 13 UTC
Are IQ tests a reliable measure of intelligence?
I remember when I took Psych 101 in college that we went through two weeks of lectures on the varying vying definitions of intelligence and the techniques and strategies for measuring it. How can you conclusively measure something that cannot be clearly defined?
31 replies
Open
SYnapse (0 DX)
29 Apr 13 UTC
Hostage rescue variant
I'm going to make a variant of a small space, like a building, with teams of terrorists and police forces who can move from room to room supporting each other etc.
9 replies
Open
jmbostwick (2308 D)
13 Apr 13 UTC
(+1)
EOG: Game 17 Around the World Map Gunboart Tournament
23 replies
Open
Page 1051 of 1419
FirstPreviousNextLast
Back to top