public void Edit_Product(Tables.Product record) { Params.spU_tblProduct param = new Params.spU_tblProduct(false); param.SetUpConnection(string.Empty); param.Param_Pro_GuidID = record.Col_Pro_GuidID.Value; if (record.Name == null || record.Name.UseNull) { param.Param_ConsiderNull_Pro_StrName = true; param.Param_Pro_StrName = SqlString.Null; } else if (!record.Name.UseDefault) { param.Param_Pro_StrName = record.Name.Value; } if (record.Col_Pro_CurPrice == null || record.Col_Pro_CurPrice.UseNull) { param.Param_ConsiderNull_Pro_CurPrice = true; param.Param_Pro_CurPrice = SqlMoney.Null; } else if (!record.Col_Pro_CurPrice.UseDefault) { param.Param_Pro_CurPrice = record.Col_Pro_CurPrice.Value; } if (record.CategoryID == null || record.CategoryID.UseNull) { param.Param_ConsiderNull_Pro_LngCategoryID = true; param.Param_Pro_LngCategoryID = SqlInt32.Null; } else if (!record.CategoryID.UseDefault) { param.Param_Pro_LngCategoryID = record.CategoryID.Value; } using (SPs.spU_tblProduct sp = new SPs.spU_tblProduct(true)) { sp.Execute(ref param); param.Dispose(); } }
public void Execute(WSGuid Pro_GuidID, WSString Pro_StrName, WSBoolean ConsiderNull_Pro_StrName, WSDecimal Pro_CurPrice, WSBoolean ConsiderNull_Pro_CurPrice, WSInt32 Pro_LngCategoryID, WSBoolean ConsiderNull_Pro_LngCategoryID) { Params.spU_tblProduct param = new Params.spU_tblProduct(true); param.SetUpConnection(string.Empty); if (Pro_GuidID == null || Pro_GuidID.UseNull) { param.Param_Pro_GuidID = SqlGuid.Null; } else if (!Pro_GuidID.UseDefault) { param.Param_Pro_GuidID = Pro_GuidID.Value; } if (Pro_StrName == null || Pro_StrName.UseNull) { param.Param_Pro_StrName = SqlString.Null; } else if (!Pro_StrName.UseDefault) { param.Param_Pro_StrName = Pro_StrName.Value; } if (ConsiderNull_Pro_StrName == null || ConsiderNull_Pro_StrName.UseNull) { param.Param_ConsiderNull_Pro_StrName = SqlBoolean.Null; } else if (!ConsiderNull_Pro_StrName.UseDefault) { param.Param_ConsiderNull_Pro_StrName = ConsiderNull_Pro_StrName.Value; } if (Pro_CurPrice == null || Pro_CurPrice.UseNull) { param.Param_Pro_CurPrice = SqlMoney.Null; } else if (!Pro_CurPrice.UseDefault) { param.Param_Pro_CurPrice = Pro_CurPrice.Value; } if (ConsiderNull_Pro_CurPrice == null || ConsiderNull_Pro_CurPrice.UseNull) { param.Param_ConsiderNull_Pro_CurPrice = SqlBoolean.Null; } else if (!ConsiderNull_Pro_CurPrice.UseDefault) { param.Param_ConsiderNull_Pro_CurPrice = ConsiderNull_Pro_CurPrice.Value; } if (Pro_LngCategoryID == null || Pro_LngCategoryID.UseNull) { param.Param_Pro_LngCategoryID = SqlInt32.Null; } else if (!Pro_LngCategoryID.UseDefault) { param.Param_Pro_LngCategoryID = Pro_LngCategoryID.Value; } if (ConsiderNull_Pro_LngCategoryID == null || ConsiderNull_Pro_LngCategoryID.UseNull) { param.Param_ConsiderNull_Pro_LngCategoryID = SqlBoolean.Null; } else if (!ConsiderNull_Pro_LngCategoryID.UseDefault) { param.Param_ConsiderNull_Pro_LngCategoryID = ConsiderNull_Pro_LngCategoryID.Value; } using (SPs.spU_tblProduct sp = new SPs.spU_tblProduct(true)) { sp.Execute(ref param); param.Dispose(); } }