リビジョン 103
資材管理(排他制御方法変更、資材品目マスタのバージョンNoで排他)、SQL例外の変数名を修正(oraex→myex)、リビジョン100マージ済み
| branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBankBusinessDayMaster.cs | ||
|---|---|---|
| 218 | 218 |
wrk.EntryDate = objwrk[(int)NameColumn.EntryDate].ToString()=="" ? DateTime.Parse("2001/01/01"): DateTime.Parse(objwrk[(int)NameColumn.EntryDate].ToString());
|
| 219 | 219 |
wrk.UpdateDate = objwrk[(int)NameColumn.UpdateDate].ToString()=="" ? DateTime.Parse("2001/01/01") : DateTime.Parse(objwrk[(int)NameColumn.UpdateDate].ToString());
|
| 220 | 220 |
} |
| 221 |
catch (MySqlException oraex)
|
|
| 221 |
catch (MySqlException myex)
|
|
| 222 | 222 |
{
|
| 223 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), oraex.Message);
|
|
| 223 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), myex.Message);
|
|
| 224 | 224 |
} |
| 225 | 225 |
catch (Exception ex) |
| 226 | 226 |
{
|
| branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBillingData.cs | ||
|---|---|---|
| 214 | 214 |
wrk.EntryDate = DateTime.Parse(objwrk[(int)NameColumn.EntryDate].ToString()); |
| 215 | 215 |
wrk.UpdateDate = DateTime.Parse(objwrk[(int)NameColumn.UpdateDate].ToString()); |
| 216 | 216 |
} |
| 217 |
catch (MySqlException oraex)
|
|
| 217 |
catch (MySqlException myex)
|
|
| 218 | 218 |
{
|
| 219 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), oraex.Message);
|
|
| 219 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), myex.Message);
|
|
| 220 | 220 |
} |
| 221 | 221 |
catch (Exception ex) |
| 222 | 222 |
{
|
| branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBillingDataDetail.cs | ||
|---|---|---|
| 240 | 240 |
wrk.EntryDate = DateTime.Parse(objwrk[(int)NameColumn.EntryDate].ToString()); |
| 241 | 241 |
wrk.UpdateDate = DateTime.Parse(objwrk[(int)NameColumn.UpdateDate].ToString()); |
| 242 | 242 |
} |
| 243 |
catch (MySqlException oraex)
|
|
| 243 |
catch (MySqlException myex)
|
|
| 244 | 244 |
{
|
| 245 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), oraex.Message);
|
|
| 245 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), myex.Message);
|
|
| 246 | 246 |
} |
| 247 | 247 |
catch (Exception ex) |
| 248 | 248 |
{
|
| branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBillingPaymentSummary.cs | ||
|---|---|---|
| 254 | 254 |
wrk.EntryDate = DateTime.Parse(objwrk[(int)NameColumn.EntryDate].ToString()); |
| 255 | 255 |
wrk.UpdateDate = DateTime.Parse(objwrk[(int)NameColumn.UpdateDate].ToString()); |
| 256 | 256 |
} |
| 257 |
catch (MySqlException oraex)
|
|
| 257 |
catch (MySqlException myex)
|
|
| 258 | 258 |
{
|
| 259 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), oraex.Message);
|
|
| 259 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), myex.Message);
|
|
| 260 | 260 |
} |
| 261 | 261 |
catch (Exception ex) |
| 262 | 262 |
{
|
| branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOConstructionMaterialInfo.cs | ||
|---|---|---|
| 217 | 217 |
wrk.EntryDate = DateTime.Parse(objwrk[(int)NameColumn.EntryDate ].ToString()); |
| 218 | 218 |
wrk.UpdateDate = DateTime.Parse(objwrk[(int)NameColumn.UpdateDate ].ToString()); |
| 219 | 219 |
} |
| 220 |
catch (MySqlException oraex)
|
|
| 220 |
catch (MySqlException myex)
|
|
| 221 | 221 |
{
|
| 222 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), oraex.Message);
|
|
| 222 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), myex.Message);
|
|
| 223 | 223 |
} |
| 224 | 224 |
catch (Exception ex) |
| 225 | 225 |
{
|
| branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODeadLineMaster.cs | ||
|---|---|---|
| 223 | 223 |
wrk.EntryDate = objwrk[(int)NameColumn.EntryDate].ToString()=="" ? DateTime.Parse("2001/01/01") : DateTime.Parse(objwrk[(int)NameColumn.EntryDate].ToString());
|
| 224 | 224 |
wrk.UpdateDate = objwrk[(int)NameColumn.UpdateDate].ToString()=="" ? DateTime.Parse("2001/01/01") : DateTime.Parse(objwrk[(int)NameColumn.UpdateDate].ToString());
|
| 225 | 225 |
} |
| 226 |
catch (MySqlException oraex)
|
|
| 226 |
catch (MySqlException myex)
|
|
| 227 | 227 |
{
|
| 228 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), oraex.Message);
|
|
| 228 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), myex.Message);
|
|
| 229 | 229 |
} |
| 230 | 230 |
catch (Exception ex) |
| 231 | 231 |
{
|
| branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMaterialInfo.cs | ||
|---|---|---|
| 210 | 210 |
wrk.EntryDate = DateTime.Parse(objwrk[(int)NameColumn.ENTRYDATE].ToString()); |
| 211 | 211 |
wrk.UpdateDate = DateTime.Parse(objwrk[(int)NameColumn.UPDATEDATE].ToString()); |
| 212 | 212 |
} |
| 213 |
catch (MySqlException oraex)
|
|
| 213 |
catch (MySqlException myex)
|
|
| 214 | 214 |
{
|
| 215 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), oraex.Message);
|
|
| 215 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), myex.Message);
|
|
| 216 | 216 |
} |
| 217 | 217 |
catch (Exception ex) |
| 218 | 218 |
{
|
| branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMaterialItem.cs | ||
|---|---|---|
| 80 | 80 |
strcmd += " MaterialItemCode, MaterialKindCode, MaterialItemName, DisplayOrder, DeleteFlg"; |
| 81 | 81 |
strcmd += " ,DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')"; |
| 82 | 82 |
strcmd += " ,DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')"; |
| 83 |
strcmd += " ,VersionNo"; |
|
| 83 | 84 |
strcmd += " FROM MaterialItemMaster"; |
| 84 | 85 |
strcmd += AddSQLString; |
| 85 | 86 |
|
| ... | ... | |
| 129 | 130 |
|
| 130 | 131 |
strcmd += ", STR_TO_DATE(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')"; |
| 131 | 132 |
strcmd += ", STR_TO_DATE(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')"; |
| 133 |
strcmd += ", 0"; |
|
| 132 | 134 |
strcmd += ")"; |
| 133 | 135 |
|
| 134 | 136 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
| ... | ... | |
| 163 | 165 |
strcmd += string.Format(",MaterialItemName = '{0}'", data.MaterialItemName);
|
| 164 | 166 |
strcmd += string.Format(",DisplayOrder = {0}", data.DisplayOrder.ToString());
|
| 165 | 167 |
strcmd += string.Format(",DeleteFlg = {0}", data.DeleteFlg.ToString());
|
| 168 |
strcmd += ", UpdateDate = STR_TO_DATE(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')"; |
|
| 169 |
strcmd += string.Format(", VersionNo = if(VersionNo = {0}, 0, VersionNo + 1) ", IOMaterialItem.MAX_VERSION);
|
|
| 166 | 170 |
|
| 167 |
strcmd += ", UpdateDate = STR_TO_DATE(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')"; |
|
| 168 | 171 |
strcmd += AddSQLString; |
| 169 | 172 |
|
| 170 | 173 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
| ... | ... | |
| 187 | 190 |
public bool UpdateVersionAction(string AddSQLString, MaterialItemMaster data, bool bConnect = true) |
| 188 | 191 |
{
|
| 189 | 192 |
string strcmd = ""; |
| 190 |
int nVersionNo = 0; |
|
| 191 | 193 |
try |
| 192 | 194 |
{
|
| 193 | 195 |
|
| ... | ... | |
| 200 | 202 |
strcmd += string.Format(",MaterialItemName = '{0}'", data.MaterialItemName);
|
| 201 | 203 |
strcmd += string.Format(",DisplayOrder = {0}", data.DisplayOrder.ToString());
|
| 202 | 204 |
strcmd += string.Format(",DeleteFlg = {0}", data.DeleteFlg.ToString());
|
| 203 |
if (data.VersionNo >= MAX_VERSION) |
|
| 204 |
{
|
|
| 205 |
nVersionNo = 1; |
|
| 206 |
} |
|
| 207 |
else |
|
| 208 |
{
|
|
| 209 |
nVersionNo = data.VersionNo + 1; |
|
| 210 |
} |
|
| 211 |
strcmd += string.Format(",VersionNo = {0}", nVersionNo.ToString());
|
|
| 205 |
strcmd += ", UpdateDate = STR_TO_DATE(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')"; |
|
| 206 |
strcmd += string.Format(", VersionNo = if(VersionNo = {0}, 0, VersionNo + 1) ", IOMaterialItem.MAX_VERSION);
|
|
| 212 | 207 |
|
| 213 |
strcmd += ", UpdateDate = STR_TO_DATE(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')"; |
|
| 214 | 208 |
strcmd += AddSQLString; |
| 215 | 209 |
|
| 216 | 210 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
| ... | ... | |
| 236 | 230 |
string strcmd = ""; |
| 237 | 231 |
try |
| 238 | 232 |
{
|
| 239 |
strcmd = "Update MaterialItemMaster Set DeleteFlg = 1,DisplayOrder = 999"; |
|
| 233 |
strcmd = "Update MaterialItemMaster Set DeleteFlg = 1, DisplayOrder = 999";
|
|
| 240 | 234 |
strcmd += ", UpdateDate = STR_TO_DATE(DATE_FORMAT(NOW(),'%Y/%m/%d %H:%i:%s'),'%Y/%m/%d %H:%i:%s')"; |
| 235 |
strcmd += string.Format(", VersionNo = if(VersionNo = {0}, 0, VersionNo + 1) ", IOMaterialItem.MAX_VERSION);
|
|
| 236 |
|
|
| 241 | 237 |
strcmd += AddSQLString; |
| 242 | 238 |
|
| 243 | 239 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
| ... | ... | |
| 272 | 268 |
|
| 273 | 269 |
wrk.VersionNo = int.Parse(objwrk[(int)NameColumn.VERSIONNO].ToString()); |
| 274 | 270 |
} |
| 275 |
catch (MySqlException oraex)
|
|
| 271 |
catch (MySqlException myex)
|
|
| 276 | 272 |
{
|
| 277 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), oraex.Message);
|
|
| 273 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), myex.Message);
|
|
| 278 | 274 |
} |
| 279 | 275 |
catch (Exception ex) |
| 280 | 276 |
{
|
| 281 |
logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(), ex.Message);
|
|
| 277 |
logger.ErrorFormat("システムエラー::{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
|
|
| 282 | 278 |
} |
| 283 | 279 |
} |
| 284 | 280 |
|
| branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMaterialRecordInfo.cs | ||
|---|---|---|
| 224 | 224 |
wrk.EntryDate = DateTime.Parse(objwrk[(int)NameColumn.EntryDate].ToString()); |
| 225 | 225 |
wrk.UpdateDate = DateTime.Parse(objwrk[(int)NameColumn.UpdateDate].ToString()); |
| 226 | 226 |
} |
| 227 |
catch (MySqlException oraex)
|
|
| 227 |
catch (MySqlException myex)
|
|
| 228 | 228 |
{
|
| 229 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), oraex.Message);
|
|
| 229 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), myex.Message);
|
|
| 230 | 230 |
} |
| 231 | 231 |
catch (Exception ex) |
| 232 | 232 |
{
|
| branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOMaterialTypes.cs | ||
|---|---|---|
| 216 | 216 |
wrk.EntryDate = objwrk[(int)NameColumn.ENTRYDATE].ToString() == "" ? DateTime.Parse("2001/01/01") : DateTime.Parse(objwrk[(int)NameColumn.ENTRYDATE].ToString());
|
| 217 | 217 |
wrk.UpdateDate = objwrk[(int)NameColumn.UPDATEDATE].ToString()=="" ? DateTime.Parse("2001/01/01") : DateTime.Parse(objwrk[(int)NameColumn.UPDATEDATE].ToString());
|
| 218 | 218 |
} |
| 219 |
catch (MySqlException oraex)
|
|
| 219 |
catch (MySqlException myex)
|
|
| 220 | 220 |
{
|
| 221 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), oraex.Message);
|
|
| 221 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), myex.Message);
|
|
| 222 | 222 |
} |
| 223 | 223 |
catch (Exception ex) |
| 224 | 224 |
{
|
| branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPaymentApprovalInfo.cs | ||
|---|---|---|
| 234 | 234 |
wrk.EntryDate = DateTime.Parse(objwrk[(int)NameColumn.EntryDate].ToString()); |
| 235 | 235 |
wrk.UpdateDate = DateTime.Parse(objwrk[(int)NameColumn.UpdateDate].ToString()); |
| 236 | 236 |
} |
| 237 |
catch (MySqlException oraex)
|
|
| 237 |
catch (MySqlException myex)
|
|
| 238 | 238 |
{
|
| 239 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), oraex.Message);
|
|
| 239 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), myex.Message);
|
|
| 240 | 240 |
} |
| 241 | 241 |
catch (Exception ex) |
| 242 | 242 |
{
|
| branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPaymentDataDetail.cs | ||
|---|---|---|
| 267 | 267 |
wrk.EntryDate = DateTime.Parse(objwrk[(int)NameColumn.EntryDate].ToString()); |
| 268 | 268 |
wrk.UpdateDate = DateTime.Parse(objwrk[(int)NameColumn.UpdateDate].ToString()); |
| 269 | 269 |
} |
| 270 |
catch (MySqlException oraex)
|
|
| 270 |
catch (MySqlException myex)
|
|
| 271 | 271 |
{
|
| 272 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), oraex.Message);
|
|
| 272 |
logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(), myex.Message);
|
|
| 273 | 273 |
} |
| 274 | 274 |
catch (Exception ex) |
| 275 | 275 |
{
|
| branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Material/MaterialCountEntry/FrmMaterialCountEntry.cs | ||
|---|---|---|
| 263 | 263 |
{
|
| 264 | 264 |
m_IoM = new IOMaterialInfo(); |
| 265 | 265 |
m_IoM.connect(); |
| 266 |
m_IoM.SetLockWaitime(1);
|
|
| 266 |
//m_IoM.SetLockWaitime(1); // 排他制御削除
|
|
| 267 | 267 |
m_IoM.beginTran(); |
| 268 |
// 共有ロック |
|
| 268 |
// 共有ロック削除
|
|
| 269 | 269 |
//if (!m_IoM.RowLockShare(m_MaterialItemCode, false)) |
| 270 | 270 |
//{
|
| 271 | 271 |
// this.Close(); |
| ... | ... | |
| 616 | 616 |
} |
| 617 | 617 |
|
| 618 | 618 |
// 資材品目マスタバージョンNo更新 |
| 619 |
strMimSQL += string.Format(" And VERSIONNO = {0}", MiMaster.VersionNo.ToString());
|
|
| 620 |
if (IoMim.UpdateVersionAction(strMimSQL, MiMaster, false)) |
|
| 619 |
strMimSQL += string.Format(" And VersionNo = {0}", MiMaster.VersionNo.ToString());
|
|
| 620 |
if (!IoMim.UpdateVersionAction(strMimSQL, MiMaster, false))
|
|
| 621 | 621 |
{
|
| 622 | 622 |
MessageBox.Show("他のユーザで更新されています。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
| 623 | 623 |
IoMri.rollback(); |
| ... | ... | |
| 627 | 627 |
|
| 628 | 628 |
IoMri.commit(); |
| 629 | 629 |
m_IoM.commit(); |
| 630 |
IoMim.commit(); |
|
| 630 | 631 |
} |
| 631 | 632 |
finally |
| 632 | 633 |
{
|
| branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Material/MaterialReserveEntry/FrmMaterialReserveEntry.cs | ||
|---|---|---|
| 288 | 288 |
{
|
| 289 | 289 |
m_IoMi = new IOMaterialInfo(); |
| 290 | 290 |
m_IoMi.connect(); |
| 291 |
m_IoMi.SetLockWaitime(1);
|
|
| 291 |
//m_IoMi.SetLockWaitime(1); // 排他制御削除
|
|
| 292 | 292 |
m_IoMi.beginTran(); |
| 293 | 293 |
|
| 294 | 294 |
} |
| ... | ... | |
| 1129 | 1129 |
} |
| 1130 | 1130 |
|
| 1131 | 1131 |
// 資材品目マスタバージョンNo更新 |
| 1132 |
strMimSQL += string.Format(" And VERSIONNO = {0}", MiMaster.VersionNo.ToString());
|
|
| 1132 |
strMimSQL += string.Format(" And VersionNo = {0}", MiMaster.VersionNo.ToString());
|
|
| 1133 | 1133 |
if (!IoMim.UpdateVersionAction(strMimSQL, MiMaster, false)) |
| 1134 | 1134 |
{
|
| 1135 | 1135 |
MessageBox.Show("他のユーザで更新されています。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
| ... | ... | |
| 1564 | 1564 |
else |
| 1565 | 1565 |
{
|
| 1566 | 1566 |
// 存在する場合、行非表示 |
| 1567 |
dgvMaster.Rows[dgvMaster.CurrentRow.Index].Cells[(int)DispColumn.RowState].Value = DataRowState.Deleted; |
|
| 1568 |
dgvMaster.Rows[dgvMaster.CurrentRow.Index].Visible = false; |
|
| 1569 |
dgvMaster.ClearSelection(); |
|
| 1567 |
//dgvMaster.Rows[dgvMaster.CurrentRow.Index].Cells[(int)DispColumn.RowState].Value = DataRowState.Deleted; |
|
| 1568 |
//dgvMaster.Rows[dgvMaster.CurrentRow.Index].Visible = false; |
|
| 1569 |
//dgvMaster.ClearSelection(); |
|
| 1570 |
MessageBox.Show("登録済みの資材は解除できません。", "解除エラー"
|
|
| 1571 |
, MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
| 1572 |
return; |
|
| 1570 | 1573 |
} |
| 1571 | 1574 |
|
| 1572 | 1575 |
// 資材種類名称設定 |
| ... | ... | |
| 1603 | 1606 |
} |
| 1604 | 1607 |
|
| 1605 | 1608 |
/// <summary> |
| 1606 |
/// 資材解除押下
|
|
| 1609 |
/// 資材登録押下
|
|
| 1607 | 1610 |
/// </summary> |
| 1608 | 1611 |
/// <param name="sender"></param> |
| 1609 | 1612 |
/// <param name="e"></param> |
| branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Material/MaterialReturnEntry/FrmMaterialReturnEntry.cs | ||
|---|---|---|
| 785 | 785 |
} |
| 786 | 786 |
|
| 787 | 787 |
// 資材品目マスタバージョンNo更新 |
| 788 |
strMimSQL += string.Format(" And VERSIONNO = {0}", MiMaster.VersionNo.ToString());
|
|
| 789 |
if (IoMim.UpdateVersionAction(strMimSQL, MiMaster, false)) |
|
| 788 |
strMimSQL += string.Format(" And VersionNo = {0}", MiMaster.VersionNo.ToString());
|
|
| 789 |
if (!IoMim.UpdateVersionAction(strMimSQL, MiMaster, false))
|
|
| 790 | 790 |
{
|
| 791 | 791 |
MessageBox.Show("他のユーザで更新されています。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
| 792 | 792 |
IoCmi.rollback(); |
| branches/src/ProcessManagement/ProcessManagement/Forms/Master/Material/MaterialItemsMaster/FrmMaterialItemsMaster.cs | ||
|---|---|---|
| 22 | 22 |
using ProcessManagement.Forms.SubForms; |
| 23 | 23 |
using ProcessManagement.Forms.CustomControls; |
| 24 | 24 |
using ProcessManagement.Forms.ControlsAction; |
| 25 |
//*------------------------ 部署マスタメンテ画面 ----------------------------*
|
|
| 26 |
// 2015/12/04 Ver1.0.0.0 Create Source
|
|
| 25 |
//*------------------------ 資材品目登録画面 ----------------------------*
|
|
| 26 |
// 2016/12/04 Ver1.0.0.0 Create Source
|
|
| 27 | 27 |
// |
| 28 | 28 |
// |
| 29 | 29 |
// |
| ... | ... | |
| 216 | 216 |
{
|
| 217 | 217 |
m_IoMt = new IOMaterialItem(); |
| 218 | 218 |
m_IoMt.connect(); |
| 219 |
m_IoMt.SetLockWaitime(1);
|
|
| 219 |
//m_IoMt.SetLockWaitime(1); // 共有排他制御削除
|
|
| 220 | 220 |
m_IoMt.beginTran(); |
| 221 | 221 |
|
| 222 | 222 |
} |
| ... | ... | |
| 358 | 358 |
return; |
| 359 | 359 |
} |
| 360 | 360 |
|
| 361 |
|
|
| 362 | 361 |
if (MessageBox.Show("選択中のデータを削除します。", "削除確認"
|
| 363 | 362 |
, MessageBoxButtons.YesNo, MessageBoxIcon.Information) != DialogResult.Yes) return; |
| 364 | 363 |
|
| 365 | 364 |
// ロック |
| 366 |
if (!m_IoMt.RowLock(int.Parse(dgvMaster.CurrentRow.Cells[(int)DispColumn.MaterialItemKey].Value.ToString()), false)) |
|
| 367 |
{
|
|
| 368 |
MessageBox.Show("他のユーザで編集中のため、処理できません。", "削除確認"
|
|
| 369 |
, MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
| 370 |
return; |
|
| 371 |
} |
|
| 365 |
//if (!m_IoMt.RowLock(int.Parse(dgvMaster.CurrentRow.Cells[(int)DispColumn.MaterialItemKey].Value.ToString()), false))
|
|
| 366 |
//{
|
|
| 367 |
// MessageBox.Show("他のユーザで編集中のため、処理できません。", "削除確認"
|
|
| 368 |
// , MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 369 |
// return;
|
|
| 370 |
//}
|
|
| 372 | 371 |
|
| 373 |
// ロック(資材情報)
|
|
| 372 |
// トランザクション開始(資材情報)
|
|
| 374 | 373 |
if (m_IoMi == null) |
| 375 | 374 |
{
|
| 376 | 375 |
m_IoMi = new IOMaterialInfo(); |
| 377 | 376 |
m_IoMi.connect(); |
| 378 | 377 |
m_IoMi.beginTran(); |
| 379 | 378 |
} |
| 380 |
if (!m_IoMi.RowLockUpdate(int.Parse(dgvMaster.CurrentRow.Cells[(int)DispColumn.MaterialItemKey].Value.ToString()),false)) |
|
| 379 |
//if (!m_IoMi.RowLockUpdate(int.Parse(dgvMaster.CurrentRow.Cells[(int)DispColumn.MaterialItemKey].Value.ToString()),false)) |
|
| 380 |
//{
|
|
| 381 |
// m_IoMt.rollback(); |
|
| 382 |
// MessageBox.Show("他のユーザで編集中のため、処理できません。", "削除確認"
|
|
| 383 |
// , MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
| 384 |
// return; |
|
| 385 |
//} |
|
| 386 |
|
|
| 387 |
//削除実施 |
|
| 388 |
string strSQL = m_IoMt.CreatePrimarykeyString(CommonMotions.cnvInt(dgvMaster.CurrentRow.Cells[(int)DispColumn.MaterialItemKey].Value)); |
|
| 389 |
List<MaterialItemMaster> MimList = new List<MaterialItemMaster>(); |
|
| 390 |
if (!m_IoMt.SelectAction(strSQL, ref MimList, false)) |
|
| 381 | 391 |
{
|
| 382 |
m_IoMt.rollback(); |
|
| 383 |
MessageBox.Show("他のユーザで編集中のため、処理できません。", "削除確認"
|
|
| 384 |
, MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
| 392 |
MessageBox.Show("資材品目マスタの取得に失敗しました。", "削除エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 385 | 393 |
return; |
| 386 | 394 |
} |
| 387 |
|
|
| 388 |
//削除実施
|
|
| 389 |
string strSQL = m_IoMt.CreatePrimarykeyString(CommonMotions.cnvInt(dgvMaster.CurrentRow.Cells[(int)DispColumn.MaterialItemKey].Value));
|
|
| 395 |
// 資材品目マスタバージョンNo取得 |
|
| 396 |
strSQL += string.Format(" And VersionNo = {0}", MimList[0].VersionNo.ToString());
|
|
| 397 |
// 削除実施(資材品目マスタ)
|
|
| 390 | 398 |
if (!m_IoMt.DeleteAction(strSQL, false)) |
| 391 | 399 |
{
|
| 392 | 400 |
m_IoMt.rollback(); |
| ... | ... | |
| 395 | 403 |
return; |
| 396 | 404 |
} |
| 397 | 405 |
|
| 398 |
//削除実施(資材情報) |
|
| 406 |
//削除実施(資材情報) |
|
| 407 |
strSQL = m_IoMt.CreatePrimarykeyString(CommonMotions.cnvInt(dgvMaster.CurrentRow.Cells[(int)DispColumn.MaterialItemKey].Value)); |
|
| 399 | 408 |
m_IoMi.SelectAction(strSQL, ref MiList, false); |
| 400 | 409 |
if (MiList.Count > 0) |
| 401 | 410 |
{
|
| ... | ... | |
| 734 | 743 |
|
| 735 | 744 |
m_IoMtype = new IOMaterialTypes(); |
| 736 | 745 |
m_IoMtype.connect(); |
| 737 |
if (m_IoMtype.RowLock(int.Parse(cmbTypes.SelectedValue.ToString()), false) == false) |
|
| 738 |
{
|
|
| 739 |
MessageBox.Show("他のユーザで編集中のため、処理できません。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 740 |
m_IoMtype.rollback(); |
|
| 741 |
return; |
|
| 742 |
} |
|
| 746 |
//if (m_IoMtype.RowLock(int.Parse(cmbTypes.SelectedValue.ToString()), false) == false)
|
|
| 747 |
//{
|
|
| 748 |
// MessageBox.Show("他のユーザで編集中のため、処理できません。", "登録エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 749 |
// m_IoMtype.rollback();
|
|
| 750 |
// return;
|
|
| 751 |
//}
|
|
| 743 | 752 |
|
| 744 |
string strKindWhere = m_IoMtype.CreatePrimarykeyString(int.Parse(cmbTypes.SelectedValue.ToString())) + " and DELETEFLG=0";
|
|
| 753 |
string strKindWhere = m_IoMtype.CreatePrimarykeyString(int.Parse(cmbTypes.SelectedValue.ToString())) + " and DELETEFLG = 0";
|
|
| 745 | 754 |
List<MaterialKindMaster> mKindList = new List<MaterialKindMaster>(); |
| 746 | 755 |
// 資材種類マスタ存在確認 |
| 747 | 756 |
if (!m_IoMtype.SelectAction(strKindWhere, ref mKindList, false)) |
| ... | ... | |
| 817 | 826 |
else |
| 818 | 827 |
{
|
| 819 | 828 |
// 更新ロック |
| 820 |
if (!m_IoMt.RowLock(uwork.MaterialItemCode, false)) |
|
| 821 |
{
|
|
| 822 |
MessageBox.Show("他のユーザで編集中のため、処理できません。", "登録エラー"
|
|
| 823 |
, MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
| 824 |
m_IoMtype.rollback(); |
|
| 825 |
return; |
|
| 826 |
} |
|
| 829 |
//if (!m_IoMt.RowLock(uwork.MaterialItemCode, false))
|
|
| 830 |
//{
|
|
| 831 |
// MessageBox.Show("他のユーザで編集中のため、処理できません。", "登録エラー"
|
|
| 832 |
// , MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 833 |
// m_IoMtype.rollback();
|
|
| 834 |
// return;
|
|
| 835 |
//}
|
|
| 827 | 836 |
|
| 828 | 837 |
// データ登録 |
| 838 |
// 資材品目マスタバージョンNo取得 |
|
| 839 |
strSQL += string.Format(" And VersionNo = {0}", mList[0].VersionNo.ToString());
|
|
| 829 | 840 |
if (!m_IoMt.UpdateAction(strSQL, uwork, false)) |
| 830 | 841 |
{
|
| 831 | 842 |
m_IoMt.rollback(); |
| ... | ... | |
| 838 | 849 |
|
| 839 | 850 |
// 成功したらcommit |
| 840 | 851 |
m_IoMt.commit(); |
| 852 |
m_IoMtype.commit(); |
|
| 841 | 853 |
m_IoMi.commit(); |
| 842 |
m_IoMtype.commit(); |
|
| 843 | 854 |
|
| 844 | 855 |
if (m_IoMi != null) |
| 845 | 856 |
{
|
| 846 | 857 |
m_IoMi.close(); |
| 847 | 858 |
m_IoMi = null; |
| 859 |
} |
|
| 860 |
if (m_IoMtype != null) |
|
| 861 |
{
|
|
| 848 | 862 |
m_IoMtype.close(); |
| 849 | 863 |
m_IoMtype = null; |
| 850 | 864 |
} |
| branches/src/ProcessManagement/ProcessManagement/Forms/Master/Material/MaterialTypesMaster/FrmMaterialTypesMaster.cs | ||
|---|---|---|
| 20 | 20 |
using ProcessManagement.Forms.CustomControls; |
| 21 | 21 |
using ProcessManagement.Forms.ControlsAction; |
| 22 | 22 |
|
| 23 |
//*------------------------ 単位マスタメンテ画面 ----------------------*
|
|
| 24 |
// 2015/07/14 Ver1.0.0.0 Create Source
|
|
| 23 |
//*------------------------ 資材種類登録画面 ----------------------*
|
|
| 24 |
// 2016/12/14 Ver1.0.0.0 Create Source
|
|
| 25 | 25 |
// |
| 26 | 26 |
// |
| 27 | 27 |
// |
| ... | ... | |
| 200 | 200 |
{
|
| 201 | 201 |
m_IoMt = new IOMaterialTypes(); |
| 202 | 202 |
m_IoMt.connect(); |
| 203 |
m_IoMt.SetLockWaitime(1);
|
|
| 203 |
//m_IoMt.SetLockWaitime(1); // 共有排他制御削除
|
|
| 204 | 204 |
m_IoMt.beginTran(); |
| 205 | 205 |
|
| 206 | 206 |
} |
| ... | ... | |
| 403 | 403 |
, MessageBoxButtons.YesNo, MessageBoxIcon.Information) != DialogResult.Yes) return; |
| 404 | 404 |
|
| 405 | 405 |
// ロック |
| 406 |
if (!m_IoMt.RowLock(int.Parse(dgvMaster.CurrentRow.Cells[(int)DispColumn.MaterialTypesKey].Value.ToString()), false)) |
|
| 407 |
{
|
|
| 408 |
MessageBox.Show("他のユーザで編集中のため、処理できません。", "削除確認"
|
|
| 409 |
, MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
| 410 |
return; |
|
| 411 |
} |
|
| 406 |
//if (!m_IoMt.RowLock(int.Parse(dgvMaster.CurrentRow.Cells[(int)DispColumn.MaterialTypesKey].Value.ToString()), false))
|
|
| 407 |
//{
|
|
| 408 |
// MessageBox.Show("他のユーザで編集中のため、処理できません。", "削除確認"
|
|
| 409 |
// , MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 410 |
// return;
|
|
| 411 |
//}
|
|
| 412 | 412 |
|
| 413 | 413 |
//削除実施 |
| 414 | 414 |
string strSQL = m_IoMt.CreatePrimarykeyString(CommonMotions.cnvInt(dgvMaster.CurrentRow.Cells[(int)DispColumn.MaterialTypesKey].Value)); |
| ... | ... | |
| 789 | 789 |
else |
| 790 | 790 |
{
|
| 791 | 791 |
// 更新ロック |
| 792 |
if (!m_IoMt.RowLock(uwork.MaterialKindCode, false)) |
|
| 793 |
{
|
|
| 794 |
MessageBox.Show("他のユーザで編集中のため、処理できません。", "削除確認"
|
|
| 795 |
, MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
| 796 |
return; |
|
| 797 |
} |
|
| 792 |
//if (!m_IoMt.RowLock(uwork.MaterialKindCode, false))
|
|
| 793 |
//{
|
|
| 794 |
// MessageBox.Show("他のユーザで編集中のため、処理できません。", "削除確認"
|
|
| 795 |
// , MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
| 796 |
// return;
|
|
| 797 |
//}
|
|
| 798 | 798 |
|
| 799 | 799 |
// データ登録 |
| 800 | 800 |
if (!m_IoMt.UpdateAction(strSQL, uwork, false)) |
| branches/src/ProcessManagement/ProcessManagement/Forms/SubForms/Material/FrmMaterialHistory.cs | ||
|---|---|---|
| 262 | 262 |
{
|
| 263 | 263 |
m_IoM = new IOMaterialInfo(); |
| 264 | 264 |
m_IoM.connect(); |
| 265 |
m_IoM.SetLockWaitime(1);
|
|
| 265 |
//m_IoM.SetLockWaitime(1); // 排他制御削除
|
|
| 266 | 266 |
m_IoM.beginTran(); |
| 267 |
// 共有ロック |
|
| 268 |
if (!m_IoM.RowLockShare(m_MaterialItemCode, false)) |
|
| 269 |
{
|
|
| 270 |
return; |
|
| 271 |
} |
|
| 267 |
// 共有ロック削除
|
|
| 268 |
//if (!m_IoM.RowLockShare(m_MaterialItemCode, false))
|
|
| 269 |
//{
|
|
| 270 |
// return;
|
|
| 271 |
//}
|
|
| 272 | 272 |
|
| 273 | 273 |
} |
| 274 | 274 |
catch (Exception ex) |
他の形式にエクスポート: Unified diff