本文整理汇总了C#中Order.IsColumnNull方法的典型用法代码示例。如果您正苦于以下问题:C# Order.IsColumnNull方法的具体用法?C# Order.IsColumnNull怎么用?C# Order.IsColumnNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Order
的用法示例。
在下文中一共展示了Order.IsColumnNull方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateOrder
public static Order GenerateOrder(int? orderID, int orderTypeID, int orderStatusID, int activityID, int paymentTypeID, string contactPerson, int? requestedBy, int userID, int? refNo = null)
{
var requisitionType = new RequisitionType();
int requisitionTypeID = Convert.ToInt32(requisitionType.LoadIDByCode("DMN")["RequisitionTypeID"]);
Order or = new Order();
if (orderID == null)
{
or.AddNew();
}
else
{
or.LoadByPrimaryKey(orderID.Value);
}
or.RefNo = refNo == null ? GetNextOrderReference() : refNo.ToString();
var oldOrderStatus = or.IsColumnNull("OrderStatusID") ? (int?)null : or.OrderStatusID;
or.OrderStatusID = orderStatusID;
// or.RequisitionTypeID = RequisitionType.CONSTANTS.DEMAND;
or.RequisitionTypeID = requisitionTypeID;
or.EurDate = or.Date = DateTimeHelper.ServerDateTime;
if (requestedBy != null)
{
or.RequestedBy = requestedBy.Value;
}
or.FilledBy = userID;
or.ContactPerson = contactPerson;
var activity = new Activity();
activity.LoadByPrimaryKey(activityID);
or.FromStore = activity.ModeID;
or.PaymentTypeID = paymentTypeID;
or.FiscalYearID = FiscalYear.Current.ID;
or.OrderTypeID = orderTypeID;
or.Save();
or.LogRequisitionStatus(or.ID, oldOrderStatus, orderStatusID, CurrentContext.UserId);
return or;
}
示例2: ReorganizeDataViewForSTVPrint_Program
/// <summary>
/// Reorganizes the data view for STV print_ program.
/// </summary>
/// <param name="dv">The dv.</param>
/// <param name="refNo">The ref no.</param>
/// <param name="pickListId">The pick list id.</param>
/// <param name="userID">The user ID.</param>
/// <param name="stvLogID">The STV log ID.</param>
/// <param name="convertDNtoSTV">if set to <c>true</c> [convert D nto STV].</param>
/// <param name="generateNewPrintID">if set to <c>true</c> [generate new print ID].</param>
/// <param name="hasInsurance">if set to <c>true</c> [has insurance].</param>
/// <returns></returns>
public static DataTable ReorganizeDataViewForSTVPrint_Program(DataView dv, int orderID, int pickListId, int userID, int? stvLogID, bool convertDNtoSTV, bool generateNewPrintID, bool hasInsurance)
{
BLL.Order order = new Order();
order.LoadByPrimaryKey(orderID);
int? paymentTypeID = null;
if (order.PaymentTypeID == PaymentType.Constants.CASH || order.PaymentTypeID == PaymentType.Constants.CREDIT || order.PaymentTypeID == PaymentType.Constants.STV)
{
paymentTypeID = order.PaymentTypeID;
}
// This is just to make the delivery notes print a separate series of numbers.
// This section completely asks for a re-write.
if (dv.Count > 0 && (dv[0]["Cost"] == DBNull.Value || Convert.ToDecimal(dv[0]["Cost"]) == 0M))
{
paymentTypeID = PaymentType.Constants.DELIVERY_NOTE;
}
else if (stvLogID != null)
{
Issue issue = new Issue();
issue.LoadByPrimaryKey(stvLogID.Value);
if (!issue.IsColumnNull("IsDeliveryNote") && issue.IsDeliveryNote && !convertDNtoSTV)
{
paymentTypeID = PaymentType.Constants.DELIVERY_NOTE;
}
}
// prepare the pick list for printing.
// this method only merges the items that come in different rows but ...
// that have same price same item.
DataTable dtbl = dv.Table.Clone();
if (!dtbl.Columns.Contains("Supplier"))
{
dtbl.Columns.Add("Supplier");
}
if (!dtbl.Columns.Contains("SupplierID"))
{
dtbl.Columns.Add("SupplierID");
}
dtbl.Columns.Add("STVNumber");
dtbl.Columns.Add("StoreName");
dtbl.Columns.Add("ContactPerson");
dtbl.Columns.Add("PhysicalStoreType"); //The virtual store (The grouping for the stores) for the display on the stv
dtbl.Clear();
foreach (DataRowView drv in dv)
{
if (dtbl.Rows.Count == 0)
{
dtbl.ImportRow(drv.Row);
}
else
{
//check if items with same expiry exists in the table
//TOFIX: Add the supplier in this mix
string qItemID = "", qbatchNumberID = "", qUnitPriceID = "", qPhysicalStoreName = "", qStoreID = "";
qItemID = string.Format("ItemID={0} and UnitID={1}", drv["ItemID"].ToString(), drv["UnitID"]);
if (drv["BatchNumber"] != DBNull.Value)
qbatchNumberID = string.Format(" and BatchNumber='{0}'", drv["BatchNumber"].ToString());
if (drv["UnitPrice"] != DBNull.Value)
qUnitPriceID = string.Format(" and UnitPrice = {0} ", drv["UnitPrice"].ToString());
if (drv["PhysicalStoreName"] != DBNull.Value)
qPhysicalStoreName = string.Format(" and PhysicalStoreName= '{0}'",
drv["PhysicalStoreName"].ToString());
if (drv["StoreID"] != DBNull.Value)
qStoreID = string.Format(" and StoreID= '{0}'", drv["StoreID"].ToString());
string query = string.Format("{0}{1}{2}{3}{4}", qItemID, qbatchNumberID, qUnitPriceID,
qPhysicalStoreName, qStoreID);
DataRow[] ar = dtbl.Select(query);
if (ar.Length > 0)
{
//
foreach (var dataRow in ar)
{
dataRow["SKUPICKED"] = Convert.ToInt32(dataRow["SKUPICKED"]) +
Convert.ToInt32(drv["SKUPICKED"]);
dataRow["Cost"] = (dataRow["Cost"] != DBNull.Value ? Convert.ToDouble(dataRow["Cost"]) : 0) +
(drv["Cost"] != DBNull.Value ? Convert.ToDouble(drv["Cost"]) : 0);
dataRow["IssueDocID"] = dataRow["IssueDocID"].ToString() + ',' +
drv["IssueDocID"].ToString();
//.........这里部分代码省略.........
示例3: gridViewReferences_FocusedRowChanged
/// <summary>
/// Handles the FocusedRowChanged event of the gridViewReferences control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs" /> instance containing the event data.</param>
private void gridViewReferences_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
{
if (e != null && e.PrevFocusedRowHandle < -1)
return;
dtDate.Value = DateTimeHelper.ServerDateTime;
_reprintId = null;
DataRow dr = gridViewReferences.GetFocusedDataRow();
if (dr == null)
{
return;
}
string[] referenceNo = new string[2];
referenceNo[0] = dr["RefNo"].ToString();
if (Convert.ToBoolean(dr["isConvertedDN"]))
{
_isConvertedDn = true;
_stvLogIdChosen = (int?)dr["IsReprintOf"];
}
else if (dr != null && dr["ID"] != DBNull.Value)
{
_isConvertedDn = false;
_stvLogIdChosen = (int?)dr["ID"];
}
UpdateReprintedNumbers(dr);
// Enable and disable STV reprint
// STV SHouldn't be reprinted off a reprint.
if (dr["IsReprintOf"] != DBNull.Value && !Convert.ToBoolean(dr["isConvertedDN"]))
{
btnExport.Enabled = btnReprint.Enabled = false;
var permission = (BLL.Settings.UseNewUserManagement) ? this.HasPermission("Print") : true;
btnPrint.Enabled = permission;
_reprintId = _stvLogIdChosen;
_stvLogIdChosen = Convert.ToInt32(dr["IsReprintOf"]);
}
else if (dr["IsDeliveryNote"] != DBNull.Value && Convert.ToBoolean(dr["IsDeliveryNote"]))
{
btnExport.Enabled = false;
btnReprint.Enabled = (BLL.Settings.UseNewUserManagement) ? this.HasPermission("Re-Print") : true;
btnPrint.Enabled = false;
}
else
{
btnPrint.Enabled = this.HasPermission("Print");
btnReprint.Enabled = this.HasPermission("Re-Print");
btnExport.Enabled = this.HasPermission("Export");
}
if (_stvLogIdChosen != null)
{
Issue log = new Issue();
log.LoadByPrimaryKey(_stvLogIdChosen.Value);
Institution rus = new Institution();
IssueDoc iss = new IssueDoc();
if (!log.IsColumnNull("ReceivingUnitID"))
{
rus.LoadByPrimaryKey(log.ReceivingUnitID);
//FacilityName.Text = rus.Name;
HeaderSection.Text = rus.Name;
var activity = new Activity();
activity.LoadByPrimaryKey(log.StoreID);
lblActivity.Text = activity.Name;
lblSubAccount.Text = activity.SubAccountName;
lblMode.Text = activity.ModeName;
lblAccount.Text = activity.AccountName;
lblRegion.Text = rus.RegionName;
lblWoreda.Text = rus.WoredaName;
lblZone.Text = rus.ZoneName;
lblInstType.Text = rus.InstitutionTypeName;
var ownership = new OwnershipType();
ownership.LoadByPrimaryKey(rus.Ownership);
lblOwnership.Text = ownership.Name;
lblVoidConDate.Text = (dr["approvalDate"]) != DBNull.Value ? Convert.ToDateTime(dr["approvalDate"]).ToShortDateString(): "-";
lblIssueType.Text = (string)dr["OrderType"];
User user = new User();
if (dr["approvedBy"] != DBNull.Value)
{
user.LoadByPrimaryKey(Convert.ToInt32(dr["approvedBy"]));
lblConfirmedBy.Text = user.FullName;
}
else
{
lblConfirmedBy.Text = "-";
}
//.........这里部分代码省略.........
示例4: GetApprovedQuantity
/// <summary>
/// Gets the approved quantity.
/// </summary>
/// <param name="setting">The setting.</param>
/// <param name="storeId">The store id.</param>
/// <param name="itemID">The item ID.</param>
/// <param name="unitid">The unitid.</param>
/// <param name="preferedExpiry">The prefered expiry.</param>
/// <param name="preferredManufacturer">The preferred manufacturer.</param>
/// <param name="preferredPhysicalStoreID">The preferred physical store ID.</param>
/// <returns></returns>
internal static int GetApprovedQuantity(PriceSettings setting, int storeId, int itemID, int? unitid, DateTime? preferedExpiry, int? preferredManufacturer, int? preferredPhysicalStoreID)
{
var query = HCMIS.Repository.Queries.Order.SelectGetApprovedQuantity(storeId, itemID, unitid, preferedExpiry,
preferredManufacturer,
preferredPhysicalStoreID,
setting ==
PriceSettings.DELIVERY_NOTE_ONLY);
Order ord = new Order();
ord.LoadFromRawSql(query);
if (ord.RowCount > 0 && !ord.IsColumnNull("Approved"))
{
return Convert.ToInt32(ord.GetColumn("Approved"));
}
return 0;
}
示例5: GetReceivingUnitName
private static string GetReceivingUnitName(Order order)
{
if (!order.IsColumnNull("RequestedBy"))
{
var rus = new Institution();
rus.LoadByPrimaryKey(order.RequestedBy);
return rus.Name;
}
if (!order.IsColumnNull("OrderTypeID") && order.OrderTypeID == OrderType.CONSTANTS.ACCOUNT_TO_ACCOUNT_TRANSFER)
{
var transfer = new Transfer();
transfer.LoadByOrderID(order.ID);
var activity = new Activity();
activity.LoadByPrimaryKey(transfer.ToStoreID);
return activity.FullActivityName;
}
return "";
}