private void btnMarkDoc() { if (advancedList.ActiveRowIndex >= 0) { Global.cBL.SetCurDoc(Convert.ToInt32(advancedList.DataRows[advancedList.ActiveRowIndex]["number_doc"])); if (!isFilter) { rowIndex = advancedList.ActiveRowIndex; } else { rowIndexFilter = advancedList.ActiveRowIndex; } if (clsDialogBox.ConfirmationBoxShow(Convert.ToInt32(advancedList.DataRows[(isFilter ? rowIndexFilter : rowIndex)]["status"]) == Convert.ToInt32(TypeStatusDoc.NoMark) ? "Відмітити документ для відправки на сервер?":"Зняти з документа відмітку відправки на сервер?") == DialogResult.Yes) { TypeStatusDoc varNewStatuaDoc = (Convert.ToInt32(advancedList.DataRows[(isFilter ? rowIndexFilter : rowIndex)]["status"]) == Convert.ToInt32(TypeStatusDoc.NoMark) ? TypeStatusDoc.Mark:TypeStatusDoc.NoMark); Status res = Global.cBL.SetStatusDoc(varNewStatuaDoc); if (res.status != EStatus.Ok) { clsDialogBox.ErrorBoxShow(res.StrStatus); } else { advancedList.DataRows[(isFilter ? rowIndexFilter : rowIndex)]["status"] = Convert.ToInt32(varNewStatuaDoc); advancedList.DataRows[(isFilter ? rowIndexFilter : rowIndex)]["StatusName"] = (varNewStatuaDoc == TypeStatusDoc.Mark ? "+" : "-"); advancedList.DataRows[(isFilter ? rowIndexFilter : rowIndex)].TemplateIndex = (varNewStatuaDoc == TypeStatusDoc.Mark ? 3 : 1); advancedList.ResumeRedraw(); } } } }
public Status SetStatusDoc(TypeStatusDoc parNewStatuaDoc) { if (parNewStatuaDoc == TypeStatusDoc.Mark) { if (Convert.ToInt32(CurDoc["SumWaresInv"]) == 0) { return(new Status(EStatus.NoInputWares)); } else if (Convert.ToInt32(Global.cBL.CurDoc["type_doc"]) == 1 && true) //clsCommon.PropControlDocSup { if (CurDoc["number_out_invoice"].ToString().Length == 0) { return(new Status(EStatus.NoDocSupply)); } else if (Global.cBL.CurDoc["date_out_invoice"].ToString().Length == 0) { return(new Status(EStatus.NoDateDocSupply)); } } } Status st = cData.SetStatusDoc(CurNumDoc, parNewStatuaDoc); if (st.status != EStatus.Ok) { return(st); } CurDoc["status"] = Convert.ToInt32(parNewStatuaDoc); return(new Status()); }