- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
if (mainWareHouseId.HasValue && mainWareHouseId.Value.ToString() == this._locationList.SelectedValue)
{
return false;
}
else
{
return location == null ? true : !location.RegionalFulfillment;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+118
if (mainWareHouseId.HasValue && mainWareHouseId.Value.ToString() == this._locationList.SelectedValue)
{
return false;
}
else
{
return location == null ? true : !location.RegionalFulfillment;
}
+952
namespace AppendStrinAtBegin
{
class Program
{
static void ProcessDirectory(string path, string fileMask, Action<string> action)
{
Directory.EnumerateFiles(path, fileMask).ToList().ForEach(action);
Directory.EnumerateDirectories(path).ToList().ForEach
(
subDirectory => ProcessDirectory(subDirectory, fileMask, action)
);
}
static void Main(string[] args)
{
Console.WriteLine("Path FileMask AppendedString");
if (args.Length < 3)
return;
var appendedString = args.Skip(2).Aggregate((workingSentence, next) => workingSentence+ " " +next);
ProcessDirectory(args[0], args[1], (file) => ProcessFile(file, appendedString));
Console.WriteLine("Gun done");
}
static void ProcessFile(string file, string appendedStringAtBegin)
{
var fileLines = File.ReadAllLines(file, Encoding.GetEncoding(1251));
var fileResulted = fileLines.ToList();
fileResulted.Insert(0, appendedStringAtBegin);
File.WriteAllLines(file, fileResulted, Encoding.GetEncoding(1251));
}
}
}
+122
for (int y = 0; y < bmp.Height; y++)
{
for (int x = 0; x < bmp.Width; x++)
{
Color col = bmp.GetPixel(x, y);
col = Color.FromArgb((col.R + col.G + col.B) / 3,
(col.R + col.G + col.B) / 3,
(col.R + col.G + col.B) / 3);
int rValue = int.Parse(col.R.ToString());
html.Append(getGrayShade(rValue));
if (x == bmp.Width - 1)
html.Append("<br/&rt");
}
}
Нашел проект на codeproject, для конвертации изображения в аscii-art
+968
private TList<ProductType> ProductTypeListTable
{
get
{
ProductTypeService productTypeService = new ProductTypeService();
TList<ProductType> productTypes = productTypeService.GetAll();
foreach (ProductType pt in productTypes)
{
pt.Name = Server.HtmlDecode(pt.Name);
}
return productTypes;
}
}
Некая дорогущая АСП.НЕТ платформа. Ну и че там, будем читать базу, пока не надоест...
+147
if (embededDatasourceItem.Text.Localized(language) == string.Empty)
Это вместо string.IsNullOrEmpty
+146
public bool IsUnplugged
{
get { throw new NotImplementedException(); }
}
public bool IsPlugged
{
get { throw new NotImplementedException(); }
}
+113
public List<ReducedPayer> red_pay_list
{
get
{
if (Session["red_pay_list"] == null)
Session["red_pay_list"] = new List<ReducedPayer>();
return (List<ReducedPayer>)Session["red_pay_list"];
}
set { Session["red_pay_list"] = value; }
}
без коментариев
+964
[Flags]
public enum ColumnState
{
Exist = 1,
NotExist = 2
}
Большинство енумов у нас помечено именно так.
+953
var result = System.Windows.Forms.MessageBox.Show("Ви дійсно бажаєте видалити платника?", "Видалення платників", System.Windows.Forms.MessageBoxButtons.YesNo);
if (result == System.Windows.Forms.DialogResult.Yes)
{
DeleteWithoutRedirect(ReducingPayerID);
red_pay_list.RemoveAt(e.RowIndex);
}
это Code-Behind aspx страницы
Это писал "большой начальник" на укрПочте. Берегитесь Позывая. Он настолько суров, что гавнокодит сразу на 3 языках
+125
if (row["Comments"] != null || row["Comments"] != string.Empty)
{
deptEvents.Description = string.Format(Convert.ToString(row["Comments"]));
}
else
{
deptEvents.Description = "N/A";
}
Еще Норвеги писаки-проверяки.
Особенно доставляет:
string.Format(Convert.ToString(row["Comments"]));
и
if (row["Comments"] != null || row["Comments"] != string.Empty)