private int LowerValue(int currentValue, LotState lotState) { int newValue; switch (lotState) { case LotState.Empty: newValue = (int)(0.9d * currentValue); return(newValue <= MaxEmptyPrice && newValue >= MinEmptyPrice ? newValue : currentValue); case LotState.House: newValue = (int)(0.8d * currentValue); return(newValue <= MaxHousePrice && newValue >= MinHousePrice ? newValue : currentValue); case LotState.Shop: newValue = (int)(0.8d * currentValue); return(newValue <= MaxShopPrice && newValue >= MinShopPrice ? newValue : currentValue); case LotState.Office: newValue = (int)(0.9d * currentValue); return(newValue <= MaxOfficePrice && newValue >= MinOfficePrice ? newValue : currentValue); default: return(currentValue); } }
private int HigherValue(int currentValue, LotState lotState) { int newValue; switch (lotState) { case LotState.Empty: newValue = (int)(1.2d * currentValue); return(newValue <= MaxEmptyPrice ? newValue : currentValue); case LotState.House: newValue = (int)(1.3d * currentValue); return(newValue <= MaxHousePrice ? newValue : currentValue); case LotState.Shop: newValue = (int)(1.3d * currentValue); return(newValue <= MaxShopPrice ? newValue : currentValue); case LotState.Office: newValue = (int)(1.1d * currentValue); return(newValue <= MaxOfficePrice ? newValue : currentValue); default: return(currentValue); } }
public static IEnumerable <ILotState> ToLotStateCollection(IEnumerable <string> ids) { var states = new List <LotState>(); foreach (var id in ids) { var s = new LotState(); s.LotId = id; states.Add(s); } return(states); }
public ILotState Get(string id, bool nullAllowed) { ILotState state = CurrentSession.Get <LotState> (id); if (!nullAllowed && state == null) { state = new LotState(); (state as LotState).LotId = id; } if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <ILotState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }
public void Initialize(GraphicsDevice graphicsDevice, Vector2 position) { Position = position; Area = new Rectangle(Position.ToPoint().X, Position.ToPoint().Y, 100, 100); Texture = new Texture2D(graphicsDevice, 1, 1); Texture.SetData(new Color[] { OwnColors.Green }); State = LotState.Empty; LotVariant = RandomGenerator.GetInteger(0, 3); Owner = Player.AI; Value = RandomGenerator.GetInteger(500, 1000); Investment = 0; Income = 0; TotalIncome = 0; Selected = false; }
private int LowerIncome(int currentIncome, LotState lotState) { int newIncome; switch (lotState) { case LotState.Shop: newIncome = (int)(0.9d * currentIncome); return(newIncome >= MinShopIncome ? newIncome : currentIncome); case LotState.Office: newIncome = (int)(0.9d * currentIncome); return(newIncome >= MinOfficeIncome ? newIncome : currentIncome); default: return(0); } }
private int HigherIncome(int currentIncome, LotState lotState) { int newIncome; switch (lotState) { case LotState.Shop: newIncome = (int)(1.2d * currentIncome); return(newIncome <= MaxShopIncome ? newIncome : currentIncome); case LotState.Office: newIncome = (int)(1.2d * currentIncome); return(newIncome <= MaxOfficeIncome ? newIncome : currentIncome); default: return(0); } }
/// <summary> /// Отображение в отчете основных свойств лота и тендера /// </summary> /// <param name="fo"></param> /// <param name="data">Данные тендера, данные которого отображаются</param> private void writeMainData(XslFOProfileWriter fo, ThisReportData data) { string sValue; #region #1: Основные данные // ...разделитель _TableSeparator(fo); fo.TStart(false, ITRepStyles.TABLE, false); fo.TAddColumn("Характеристика", align.ALIGN_LEFT, valign.VALIGN_TOP, null, "30%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TAddColumn("Значение", align.ALIGN_LEFT, valign.VALIGN_TOP, null, "70%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TRStart(); fo.TRAddCell("Основные реквизиты", "string", 2, 1, ITRepStyles.GROUP_HEADER); fo.TREnd(); if ((Int32)data.Main["CustEqOrg"] == 1) { writeDataPair(fo, "Заказчик/Организатор", xmlEncode(data.Main["Customer"])); } else { writeDataPair(fo, "Заказчик/Организатор", xmlEncode(data.Main["Customer"]) + " / " + xmlEncode(data.Main["Organizer"])); } writeDataPair(fo, "Дата подачи документов", _FormatLongDateTime(data.Main["DocFeedingDate"])); writeDataPair(fo, "Дата проведения переторжки", _FormatLongDateTime(data.Main["DateTorg1"])); writeDataPair(fo, "Дата проведения 2й переторжки", _FormatLongDateTime(data.Main["DateTorg2"])); // ...Директор Клиента: if (data.ViewType == 0) { writeDataPair(fo, "Директор Клиента", _GetUserMailAnchor(data.Main["DirectorName"], data.Main["DirectorEMail"])); } // ...cостояние: цвет фона в зависимости от состояния LotState state = (LotState)(Int32.Parse(data.Main["State"].ToString())); if (LotState.WasGain == state) { sValue = ITRepStyles.TABLE_CELL_COLOR_GREEN; } else if (LotState.WasLoss == state) { sValue = ITRepStyles.TABLE_CELL_COLOR_RED; } else { sValue = ITRepStyles.TABLE_CELL; } writeDataPair(fo, "Состояние", "<fo:inline font-weight='bold'>" + xmlEncode(data.Main["StateName"]) + "</fo:inline>", sValue); // ...Контактное лицо конкурсной комисси: fo.TRStart(); fo.TRAddCell("Контактное лицо конкурсной комисси", "string", 2, 1, ITRepStyles.GROUP_HEADER); fo.TREnd(); writeDataPair(fo, "Фамилия, имя, отчество ", xmlEncode(data.Main["JuryContactName"])); writeDataPair(fo, "Телефон ", xmlEncode(data.Main["JuryContactPhone"])); writeDataPair(fo, "Адрес электронной почты", _GetUserMailAnchor(data.Main["JuryContactEMail"], data.Main["JuryContactEMail"])); fo.TEnd(); #endregion #region #2: Данные участников конкурса: if (null != data.Parts) { // ...разделитель _TableSeparator(fo); fo.TStart(true, ITRepStyles.TABLE, false); bool isFinalState = (LotState.WasGain == state || LotState.WasLoss == state); int nCol = fo.TAddColumn("Участники конкурса", align.ALIGN_LEFT, valign.VALIGN_MIDDLE, null, String.Empty, align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TAddSubColumn(nCol, "Организация", align.ALIGN_LEFT, valign.VALIGN_MIDDLE, null, "12%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TAddSubColumn(nCol, "Тип участия", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, null, "8%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TAddSubColumn(nCol, "Отклонен", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, null, "7%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); if (isFinalState) { fo.TAddSubColumn(nCol, "Итоговый статус", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, null, "10%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); } fo.TAddSubColumn(nCol, "Сумма подачи, " + xmlEncode(data.Main["NDS"]), align.ALIGN_CENTER, valign.VALIGN_MIDDLE, null, "8%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TAddSubColumn(nCol, "Сумма переторжки, " + xmlEncode(data.Main["NDS"]), align.ALIGN_CENTER, valign.VALIGN_MIDDLE, null, "8%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TAddSubColumn(nCol, "Сумма 2й переторжки, " + xmlEncode(data.Main["NDS"]), align.ALIGN_CENTER, valign.VALIGN_MIDDLE, null, "8%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TAddSubColumn(nCol, "Сумма подачи АП, " + xmlEncode(data.Main["NDS"]), align.ALIGN_CENTER, valign.VALIGN_MIDDLE, null, "8%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TAddSubColumn(nCol, "Сумма переторжки АП, " + xmlEncode(data.Main["NDS"]), align.ALIGN_CENTER, valign.VALIGN_MIDDLE, null, "8%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TAddSubColumn(nCol, "Сумма 2й переторжки АП, " + xmlEncode(data.Main["NDS"]), align.ALIGN_CENTER, valign.VALIGN_MIDDLE, null, "8%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TAddSubColumn(nCol, "Примечание", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, null, (isFinalState ? "8%" : "13%"), align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); foreach (IDictionary orgData in data.Parts) { fo.TRStart(); _WriteCell(fo, xmlEncode(orgData["ParticipantOrganization"])); _WriteCell(fo, xmlEncode(orgData["ParticipationType"])); _WriteCell(fo, xmlEncode(orgData["DeclinedText"])); if (isFinalState) { bool isWinner = (null != orgData["Winner"]); _WriteCell(fo, "<fo:inline font-weight='bold'>" + (isWinner? "Победитель" : "Проигравший") + "</fo:inline>", "string", (isWinner? ITRepStyles.TABLE_CELL_COLOR_GREEN : ITRepStyles.TABLE_CELL_COLOR_RED)); } _WriteCell(fo, xmlEncode(orgData["TenderParticipantPrice"])); _WriteCell(fo, xmlEncode(orgData["SumTorg1"])); _WriteCell(fo, xmlEncode(orgData["SumTorg2"])); _WriteCell(fo, xmlEncode(orgData["TenderParticipantPriceAP"])); _WriteCell(fo, xmlEncode(orgData["SumTorg1AP"])); _WriteCell(fo, xmlEncode(orgData["SumTorg2AP"])); _WriteCell(fo, xmlEncode(orgData["Note"])); fo.TREnd(); } fo.TEnd(); } #endregion #region #3: Участие подразделений (если такие данные есть) if (null != data.DepParts && data.ViewType == 0) { // ...разделитель _TableSeparator(fo); fo.TStart(true, ITRepStyles.TABLE, false); int nCol = fo.TAddColumn("Участие департаментов", align.ALIGN_LEFT, valign.VALIGN_MIDDLE, null, null, align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TAddSubColumn(nCol, "Департамент", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, null, "20%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TAddSubColumn(nCol, "Исполнитель", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, null, "20%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TAddSubColumn(nCol, "Ознакомился", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, null, "20%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TAddSubColumn(nCol, "Примечание", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, null, "40%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); foreach (IDictionary depData in data.DepParts) { fo.TRStart(); _WriteCell(fo, xmlEncode(depData["Department"])); // Исполнитель от подразделения: sValue = _GetUserMailAnchor(depData["ExecutorName"], depData["ExecutorEMail"]); if (null != depData["DocsGettingDate"]) { sValue = sValue + (String.Empty != sValue ? ", " : "") + "документы получил(а) " + _FormatLongDate(depData["DocsGettingDate"]); } _WriteCell(fo, sValue); _WriteCell(fo, xmlEncode(depData["ExecutorIsAcquaint"])); _WriteCell(fo, xmlEncode(depData["Note"])); fo.TREnd(); } fo.TEnd(); } #endregion #region #3: Внешние ссылки (если таковые есть) if (null != data.Links && data.ViewType == 0) { // ...разделитель _TableSeparator(fo); fo.TStart(false, ITRepStyles.TABLE, false); fo.TAddColumn("Тип ссылки", align.ALIGN_LEFT, valign.VALIGN_TOP, null, "15%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TAddColumn("Ссылка", align.ALIGN_LEFT, valign.VALIGN_TOP, null, "85%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TRStart(); fo.TRAddCell("Внешние ссылки", "string", 2, 1, ITRepStyles.GROUP_HEADER); fo.TREnd(); foreach (IDictionary linkData in data.Links) { string sLinkHRef = String.Format( "<fo:basic-link " + "text-decoration=\"none\" " + "external-destination=\"vbscript:window.OpenExternalLink({0},"{1}")\">" + "{2}</fo:basic-link> " + "( полный адрес: <fo:basic-link " + "text-decoration=\"none\" " + "external-destination=\"vbscript:window.OpenExternalLink({0},"{1}")\">" + "{1}</fo:basic-link> )", linkData["LinkServiceType"], // {0}, тип обслуживающей системы xmlEncode(linkData["URI"]), // {1}, URI ссылки xmlEncode(linkData["LinkName"]) // {2}, отображаемое значение ссылки ); fo.TRStart(); _WriteCell(fo, xmlEncode(linkData["ServiceTypeName"])); _WriteCell(fo, sLinkHRef, "string"); fo.TREnd(); } fo.TEnd(); } #endregion #region #4: Дополнительные данные _TableSeparator(fo); fo.TStart(false, ITRepStyles.TABLE, false); fo.TAddColumn("Характеристика", align.ALIGN_LEFT, valign.VALIGN_TOP, null, "30%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TAddColumn("Значение", align.ALIGN_LEFT, valign.VALIGN_TOP, null, "70%", align.ALIGN_CENTER, valign.VALIGN_MIDDLE, ITRepStyles.TABLE_HEADER); fo.TRStart(); fo.TRAddCell("Дополнительно", "string", 2, 1, ITRepStyles.GROUP_HEADER); fo.TREnd(); writeDataPair(fo, "К обсуждению", xmlEncode(data.Main["QualifyingRequirement"])); if (data.ViewType == 0) { writeDataPair(fo, "Примечание", xmlEncode(data.Main["Note"])); writeDataPair(fo, "Обсуждения", xmlEncode(data.Main["Discussion"])); } fo.TEnd(); #endregion }
public static DalLotState ToDalLotState(this LotState lotStateEntity) { return((DalLotState)((int)lotStateEntity)); }
public override bool Save() { try { using (SqlConnection connection = DbControl.GetOpenConnection()) { SqlCommand command = connection.CreateCommand(); command.Parameters.Add(new SqlParameter("@ceid", System.Data.SqlDbType.VarChar)).Value = CEID.ToString(); command.Parameters.Add(new SqlParameter("@cst_id", System.Data.SqlDbType.VarChar)).Value = CSTID.ToString(); command.Parameters.Add(new SqlParameter("@lot_code", System.Data.SqlDbType.VarChar)).Value = LotCode.ToString(); command.Parameters.Add(new SqlParameter("@lot_id", System.Data.SqlDbType.VarChar)).Value = LotID == null ? "" : LotID; command.Parameters.Add(new SqlParameter("@cst_size", System.Data.SqlDbType.VarChar)).Value = CSTSize == null ? "" : CSTSize.ToString(); command.Parameters.Add(new SqlParameter("@eng_code", System.Data.SqlDbType.VarChar)).Value = EngCode == null ? "" : EngCode; command.Parameters.Add(new SqlParameter("@gls_thick", System.Data.SqlDbType.VarChar)).Value = GLSThick == null ? "" : GLSThick.ToString(); command.Parameters.Add(new SqlParameter("@host_msg", System.Data.SqlDbType.VarChar)).Value = HostMsg == null ? "" : HostMsg; command.Parameters.Add(new SqlParameter("@inline_code", System.Data.SqlDbType.VarChar)).Value = InLineCode.ToString() + ""; command.Parameters.Add(new SqlParameter("@inno", System.Data.SqlDbType.VarChar)).Value = InNo.ToString(); command.Parameters.Add(new SqlParameter("@outno", System.Data.SqlDbType.VarChar)).Value = OutNo.ToString(); command.Parameters.Add(new SqlParameter("@keyid", System.Data.SqlDbType.VarChar)).Value = KeyID == null ? "" : KeyID; command.Parameters.Add(new SqlParameter("@lot_command", System.Data.SqlDbType.VarChar)).Value = LotCommand == null ? "" : LotCommand; command.Parameters.Add(new SqlParameter("@lot_judge", System.Data.SqlDbType.VarChar)).Value = LotJudge == null ? "" : LotJudge; command.Parameters.Add(new SqlParameter("@lot_start_time", System.Data.SqlDbType.DateTime)).Value = LotStartTime.ToString("yyyy-MM-dd HH:mm:ss.fff"); command.Parameters.Add(new SqlParameter("@lot_state", System.Data.SqlDbType.VarChar)).Value = LotState.ToString(); command.Parameters.Add(new SqlParameter("@mode_code", System.Data.SqlDbType.VarChar)).Value = ModeCode == null ? "" : ModeCode; command.Parameters.Add(new SqlParameter("@part_num", System.Data.SqlDbType.VarChar)).Value = PartNum == null ? "" : PartNum; command.Parameters.Add(new SqlParameter("@permit", System.Data.SqlDbType.VarChar)).Value = Permit.ToString(); command.Parameters.Add(new SqlParameter("@port_id", System.Data.SqlDbType.VarChar)).Value = PortID == null ? "" : PortID; command.Parameters.Add(new SqlParameter("@prc_id", System.Data.SqlDbType.VarChar)).Value = PrcID == null ? "" : PrcID; command.Parameters.Add(new SqlParameter("@prod_type", System.Data.SqlDbType.VarChar)).Value = ProdType == null ? "" : ProdType; command.Parameters.Add(new SqlParameter("@rcp", System.Data.SqlDbType.VarChar)).Value = RCP == null ? "" : RCP; command.Parameters.Add(new SqlParameter("@slot_count", System.Data.SqlDbType.VarChar)).Value = SlotCount.ToString(); command.Parameters.Add(new SqlParameter("@download_time", System.Data.SqlDbType.DateTime)).Value = DownloadTime.ToString("yyyy-MM-dd HH:mm:ss.fff"); command.CommandText = "update lot_data set " + "ceid=@ceid, cst_id=@cst_id, cst_size=@cst_size, eng_code=@eng_code, gls_thick=@gls_thick, host_msg=@host_msg, inline_code=@inline_code, inno=@inno, " + "outno=@outno, keyid=@keyid, lot_command=@lot_command, lot_id=@lot_id, lot_judge=@lot_judge, lot_start_time=@lot_start_time, lot_state=@lot_state, mode_code=@mode_code, part_num=part_num, permit=@permit, " + "port_id=@port_id, prc_id=@prc_id, prod_type=@prod_type, rcp=@rcp, slot_count=@slot_count, download_time=@download_time " + "where lot_code=@lot_code"; command.Connection = connection; command.ExecuteNonQuery(); } return(true); } catch (SqlException ex) { CLogManager.Instance.Log(new CExceptionLogFormat(Catagory.Error, "EMP", ex)); } return(false); }
public override bool Add() { SqlDataReader reader = null; try { using (SqlConnection connection = DbControl.GetOpenConnection()) { SqlCommand readCommand = connection.CreateCommand(); readCommand.Parameters.Add(new SqlParameter("@lot_code", System.Data.SqlDbType.VarChar)).Value = LotCode.ToString(); readCommand.CommandText = "select * from lot_data where lot_code=@lot_code"; readCommand.Connection = connection; reader = readCommand.ExecuteReader(); if (reader.Read()) { reader.Close(); } else { reader.Close(); SqlCommand command = connection.CreateCommand(); //신규 command.Parameters.Add(new SqlParameter("@ceid", System.Data.SqlDbType.VarChar)).Value = CEID.ToString(); command.Parameters.Add(new SqlParameter("@cst_id", System.Data.SqlDbType.VarChar)).Value = CSTID.ToString() + ""; command.Parameters.Add(new SqlParameter("@lot_code", System.Data.SqlDbType.VarChar)).Value = LotCode.ToString(); command.Parameters.Add(new SqlParameter("@lot_id", System.Data.SqlDbType.VarChar)).Value = LotID == null ? "" : LotID; command.Parameters.Add(new SqlParameter("@cst_size", System.Data.SqlDbType.VarChar)).Value = CSTSize == null ? "" : CSTSize.ToString(); command.Parameters.Add(new SqlParameter("@eng_code", System.Data.SqlDbType.VarChar)).Value = EngCode == null ? "" : EngCode; command.Parameters.Add(new SqlParameter("@gls_thick", System.Data.SqlDbType.VarChar)).Value = GLSThick == null ? "" : GLSThick.ToString(); command.Parameters.Add(new SqlParameter("@host_msg", System.Data.SqlDbType.VarChar)).Value = HostMsg == null ? "" : HostMsg; command.Parameters.Add(new SqlParameter("@inline_code", System.Data.SqlDbType.VarChar)).Value = InLineCode.ToString() + ""; command.Parameters.Add(new SqlParameter("@inno", System.Data.SqlDbType.VarChar)).Value = InNo.ToString(); command.Parameters.Add(new SqlParameter("@outno", System.Data.SqlDbType.VarChar)).Value = OutNo.ToString(); command.Parameters.Add(new SqlParameter("@keyid", System.Data.SqlDbType.VarChar)).Value = KeyID == null ? "" : KeyID; command.Parameters.Add(new SqlParameter("@lot_command", System.Data.SqlDbType.VarChar)).Value = LotCommand == null ? "" : LotCommand; command.Parameters.Add(new SqlParameter("@lot_judge", System.Data.SqlDbType.VarChar)).Value = LotJudge == null ? "" : LotJudge; command.Parameters.Add(new SqlParameter("@lot_start_time", System.Data.SqlDbType.DateTime)).Value = LotStartTime.ToString("yyyy-MM-dd HH:mm:ss.fff"); command.Parameters.Add(new SqlParameter("@lot_state", System.Data.SqlDbType.VarChar)).Value = LotState.ToString(); command.Parameters.Add(new SqlParameter("@mode_code", System.Data.SqlDbType.VarChar)).Value = ModeCode == null ? "" : ModeCode; command.Parameters.Add(new SqlParameter("@part_num", System.Data.SqlDbType.VarChar)).Value = PartNum == null ? "" : PartNum; command.Parameters.Add(new SqlParameter("@permit", System.Data.SqlDbType.VarChar)).Value = Permit.ToString(); command.Parameters.Add(new SqlParameter("@port_id", System.Data.SqlDbType.VarChar)).Value = PortID == null ? "" : PortID; command.Parameters.Add(new SqlParameter("@prc_id", System.Data.SqlDbType.VarChar)).Value = PrcID == null ? "" : PrcID; command.Parameters.Add(new SqlParameter("@prod_type", System.Data.SqlDbType.VarChar)).Value = ProdType == null ? "" : ProdType; command.Parameters.Add(new SqlParameter("@rcp", System.Data.SqlDbType.VarChar)).Value = RCP == null ? "" : RCP; command.Parameters.Add(new SqlParameter("@slot_count", System.Data.SqlDbType.VarChar)).Value = SlotCount.ToString(); command.Parameters.Add(new SqlParameter("@download_time", System.Data.SqlDbType.DateTime)).Value = DownloadTime.ToString("yyyy-MM-dd HH:mm:ss.fff"); command.Connection = connection; command.CommandText = "insert into lot_data " + "(lot_code, ceid, cst_id, cst_size, eng_code, gls_thick, host_msg, inline_code, inno, outno, keyid, lot_command, lot_id, lot_judge, lot_state, mode_code, part_num, permit, port_id, prc_id, prod_type, rcp, slot_count, download_time) " + "values (@lot_code, @ceid, @cst_id, @cst_size, @eng_code, @gls_thick, @host_msg, @inline_code, @inno, @outno, @keyid, @lot_command, @lot_id, @lot_judge, @lot_state, @mode_code, @part_num, @permit, @port_id, @prc_id, @prod_type, @rcp, @slot_count, @download_time)"; command.ExecuteNonQuery(); return(true); } } } catch (SqlException ex) { CLogManager.Instance.Log(new CExceptionLogFormat(Catagory.Error, "EMP", ex)); } finally { if (reader != null) { reader.Close(); } } return(false); }