/// <summary> /// Check processing /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>ResultModel</returns> private void Check(UpdateDataModel inputObject) { // Local variable declaration DataCom dataCom = null; CartCom cartCom = null; // Variable initialize dataCom = new DataCom(); cartCom = new CartCom(inputObject.Cart); // Check valid foreach (var item in cartCom.Items) { if (!dataCom.IsExist <Item>(item.ItemCd, false)) { throw new DataNotExistException(string.Format("Sản phẩm ({0})", item.ItemCd)); } if (DataCheckHelper.IsNull(item.Quantity)) { throw new ExecuteException("E_MSG_00001", "Số lượng"); } if (item.Quantity <= decimal.Zero) { throw new ExecuteException("E_MSG_00011", "Số lượng"); } } }
/// <summary> /// Check processing /// </summary> /// <param name="inputObject">DataModel</param> /// <returns>ResultModel</returns> private void Check(UpdateDataModel inputObject) { // Local variable declaration DataCom dataCom = null; CartCom cartCom = null; // Variable initialize dataCom = new DataCom(); cartCom = new CartCom(inputObject.Cart); // Check valid foreach (var item in cartCom.Items) { if (!dataCom.IsExist<Item>(item.ItemCd, false)) throw new DataNotExistException(string.Format("Sản phẩm ({0})", item.ItemCd)); if (DataCheckHelper.IsNull(item.Quantity)) throw new ExecuteException("E_MSG_00001", "Số lượng"); if (item.Quantity <= decimal.Zero) throw new ExecuteException("E_MSG_00011", "Số lượng"); } }
private int RecuperaIDCommessa(int IdCommessa) { // Prende dall'IdCommessa passata: NrCommessa e DataCommessa // Recupera dalla Tabella Commesse l'IDCommessa che ha quel NrCommessa, quella DataCommessa e TipoCommessa = 2 ù // e ritorna l'IdCommessa di quella riga int NrCom; DateTime DataCom; DataRow riga; DataTable TabellaCommesse; TabellaCommesse = target2021DataSet.Tables["Commesse"]; riga = TabellaCommesse.Rows.Find(IdCommessa); NrCom = Convert.ToInt32(riga["NrCommessa"]); DataCom = Convert.ToDateTime(riga["DataCommessa"]); int IdCom; DataRow[] righe; righe = target2021DataSet.Tables["Commesse"].Select("NrCommessa=" + NrCom + " AND DataCommessa='" + DataCom.ToShortDateString() + "' AND TipoCommessa=2"); try { IdCom = Convert.ToInt32(righe[0]["IDCommessa"]); return(IdCom); } catch { return(-1); } }