本文整理汇总了C#中Item.IsColumnNull方法的典型用法代码示例。如果您正苦于以下问题:C# Item.IsColumnNull方法的具体用法?C# Item.IsColumnNull怎么用?C# Item.IsColumnNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item.IsColumnNull方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsRecieveGridValid
private bool IsRecieveGridValid()
{
bool valid = true;
for (int i = 0; i < gridRecieveView.RowCount; i++)
{
DataRow dr = gridRecieveView.GetDataRow(i);
Item itm = new Item();
itm.LoadByPrimaryKey(Convert.ToInt32(dr["ID"]));
dr.ClearErrors();
if (!BLL.Settings.HandleGRV && srm != true)
//The price is entered right here if we don't handle the GRVs
{
//Unless it is a receive by delivery note, price needs to be entered.
//txtSTVNo.Text = txtRefNo.Text;
if ((dr["Price/Pack"] == DBNull.Value || dr["Price/Pack"] == null ||
dr["Price/Pack"].ToString() == "") && deliveryNoteType == DeliveryNoteType.NotSet)
{
dr.SetColumnError("Price/Pack", @"Please fill the cost");
valid = false;
}
//If it is a delivery note receive, it cannot have price.
//var pricePerPack = "";
if (dr["Price/Pack"] != DBNull.Value && dr["Price/Pack"] != null)
{
var pricePerPack = Convert.ToString(dr["Price/Pack"]);
if ((deliveryNoteType != DeliveryNoteType.NotSet) &&
(pricePerPack != "" && Convert.ToDouble(pricePerPack) != 0))
{
dr.SetColumnError("Price/Pack", @"A Delivery note receive cannot have price information");
valid = false;
}
}
}
// Require batch if the store (account type) is the program/Free store or if the EnforceBatch Setting is set to true.
bool enforceBatch = BLL.Settings.EnforceBatchTracking;
//Check if Empty before checking Batch
if (lkAccounts.EditValue != null)
{
var activity = new Activity();
activity.LoadByPrimaryKey(int.Parse(lkAccounts.EditValue.ToString()));
if (activity.IsHealthProgram() || enforceBatch)
{
if ((!itm.IsColumnNull("NeedExpiryBatch") && itm.NeedExpiryBatch) &&
(dr["Batch No"] == DBNull.Value || dr["Batch No"].ToString() == ""))
{
dr.SetColumnError("Batch No", @"Can not be Null");
valid = false;
}
}
}
if (dr["UnitID"] == DBNull.Value)
{
dr.SetColumnError("UnitID", @"Can not be Null");
valid = false;
}
if (dr["Pack Qty"] == DBNull.Value)
{
dr.SetColumnError("Pack Qty", @"Can not be Null");
valid = false;
}
else
{
if (srm && !chkSRMForOldSystemIssues.Checked &&
Convert.ToDecimal(dr["Pack Qty"]) > Convert.ToDecimal(dr["IssuedQty"]))
{
dr.SetColumnError("Pack Qty", @"Can not exceed issued quantity!");
valid = false;
XtraMessageBox.Show(
"Returned quantity cannot be greater than the issued quantity. Please review the grid.",
"SRM Error");
}
}
if ((!itm.IsColumnNull("NeedExpiryBatch") && itm.NeedExpiryBatch) && (dr["Expiry Date"] == DBNull.Value))
{
dr.SetColumnError("Expiry Date", @"Can not be Null");
//gridRecieveView.SetColumnError(gridRecieveView.Columns[], );
valid = false;
}
else
{
if (dr["Expiry Date"] != DBNull.Value)
{
DateTime expiryDate = Convert.ToDateTime(dr["Expiry Date"]);
if (DateTime.Today.Subtract(expiryDate).Days > 0)
{
dr["IsDamaged"] = true;
}
}
//.........这里部分代码省略.........
示例2: ResetForHub
private void ResetForHub()
{
grpStorageSettings.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
// Bind the Storage Types
cmbStorageType.DataSource = StorageType.PrimaryStorageTypes;
Item itm = new Item();
itm.LoadByPrimaryKey(itemId);
if (!itm.IsColumnNull("StorageTypeID"))
{
cmbStorageType.SelectedValue = itm.StorageTypeID.ToString();
if (itm.StorageTypeID.ToString() == StorageType.BulkStore)
{
gridPickfaceLocationsContainer.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
if (itm.IsColumnNull("IsStackStored"))
{
chkIsStackStored.Checked = false;
}
else
{
chkIsStackStored.Checked = itm.IsStackStored;
}
}
}
else
{
cmbStorageType.SelectedIndex = 0;
}
numNearExpiryTrigger.Visible = true;
if (!itm.IsColumnNull("NearExpiryTrigger"))
numNearExpiryTrigger.Value = Convert.ToDecimal(itm.NearExpiryTrigger);
}
示例3: PopulateFields
private void PopulateFields()
{
// Bind the lookups first
ABC abc = new ABC();
abc.LoadAll();
radioGroupABC.Properties.Items.Clear();
while(!abc.EOF){
radioGroupABC.Properties.Items.Add(new RadioGroupItem(abc.ID, abc.Description));
abc.MoveNext();
}
radioGroupVEN.Properties.Items.Clear();
VEN ven = new VEN();
ven.LoadAll();
while (!ven.EOF)
{
radioGroupVEN.Properties.Items.Add(new RadioGroupItem(ven.ID, ven.Description));
ven.MoveNext();
}
if(itemId != 0)
{
Item itm = new Item();
//itm.LoadByPrimaryKey(itemId);
DataTable dtItem = itm.GetItemById(itemId);
txtItemName.Text = itm.FullItemName;//String.Format("{0} - {1} - {2}", dtItem.Rows[0]["ItemName"], dtItem.Rows[0]["DosageForm"], dtItem.Rows[0]["Strength"]);
ckExculed.Checked = (!itm.IsColumnNull("IsInHospitalList"))?itm.IsInHospitalList:false;
chkProcessDecimal.Checked = (!itm.IsColumnNull("ProcessInDecimal")) ? itm.ProcessInDecimal : false;
if (!itm.IsColumnNull("ABCID"))
{
radioGroupABC.EditValue = itm.GetColumn("ABCID");
}
if (!itm.IsColumnNull("VENID"))
{
radioGroupVEN.EditValue = itm.GetColumn("VENID");
}
Supplier sup = new Supplier();
sup.LoadAll();
ItemSupplier itmSup = new ItemSupplier();
itmSup.GetSuppliersAndMarkThoseUsed(itemId);
while(!itmSup.EOF)
{
lstSuppliers.Items.Add(itmSup.GetColumn("CompanyName"),Convert.ToBoolean(itmSup.GetColumn("IsUsed")));
itmSup.MoveNext();
}
BLL.Program prog = new BLL.Program();
prog.GetSubPrograms();
ItemProgram progItem = new ItemProgram();
lstPrograms.Items.Clear();
foreach (DataRowView dv in prog.DefaultView)
{
bool check = false;
check = progItem.CheckIfExists(itemId,Convert.ToInt32(dv["ID"]));
lstPrograms.Items.Add(dv["Name"],check);
}
}
}
示例4: GetIssuesByReceivingUnitFaster
/// <summary>
/// Gets the issues by receiving unit faster.
/// </summary>
/// <param name="storeID">The store ID.</param>
/// <param name="routeID">The route ID.</param>
/// <param name="type">The type.</param>
/// <returns></returns>
/// Shit: what a name? and it does crazy stuff too.
public DataTable GetIssuesByReceivingUnitFaster(int storeID, int routeID, int type)
{
var ru = new Institution();
if (Settings.IsRdfMode)
ru.GetFacilitiesThatEverReceivedItems();
else
ru.GetAllUnderRoute(routeID);
//Load all the items.
var query = HCMIS.Repository.Queries.Item.SelectGetIssuesByReceivingUnitFaster(type);
this.LoadFromRawSql(query);
//Add the columns
while (!ru.EOF)
{
this.AddColumn(string.Format("{0},{1}", ru.Name, ru.ID), typeof(int));
ru.MoveNext();
}
while (!this.EOF)
{
Institution rus = new Institution();
if (Settings.IsRdfMode)
rus.GetFacilitiesThatEverReceivedItems();
else
rus.GetAllUnderRoute(routeID);
while (!rus.EOF)
{
int itemID = int.Parse(this.GetColumn("ID").ToString());
var itm = new Item();
var issueQuery = HCMIS.Repository.Queries.Item.SelectGetIssuesByReceivingUnitFasterIssueQuery(itemID, rus.ID);
itm.LoadFromRawSql(issueQuery);
if (itm.RowCount > 0 && !itm.IsColumnNull("Quantity"))
this.SetColumn(string.Format("{0},{1}", ru.Name, ru.ID), itm.GetColumn("Quantity"));
rus.MoveNext();
}
this.MoveNext();
}
return this.DataTable;
}
示例5: PopulateItems
private void PopulateItems()
{
Item itm = new Item();
itm.GetItemByPrimaryKey(this._itemID);
if (itm.IsColumnNull("StorageTypeID"))
{
itm.StorageTypeID = 1;
itm.Save();
}
if (itm.StorageTypeID.ToString() == StorageType.BulkStore && !itm.IsColumnNull("IsStackStored") && itm.IsStackStored)
{
layoutStackedView.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
}
else
layoutStackedView.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
lblItemName.Text = itm.FullItemName;
BLL.ItemManufacturer imfr = new BLL.ItemManufacturer();
imfr.LoadManufacturersFor(this._itemID);
lstManufacturers.DataSource = imfr.DefaultView;
itemUnit.LoadAllForItem(_itemID);
gridUnits.DataSource = itemUnit.DefaultView;
}
示例6: OnSaveItemManufacturerClick
private void OnSaveItemManufacturerClick(object sender, EventArgs e)
{
_isSaving = true;
BLL.Item itm = new Item();
if (im.RowCount > 0)
{
double divider = GetDivider();
// Save the metric data
im.BoxHeight = Convert.ToDouble(txtHeight.Text) / divider;
im.BoxLength = Convert.ToDouble(txtLength.Text) / divider;
im.BoxWidth = Convert.ToDouble(txtWidth.Text) / divider;
// validate if someone is attempting to change the SKU after it has been used.
//
if (im.PackageLevel == 0)
{
BLL.ItemManufacturer imff = new BLL.ItemManufacturer();
imff.LoadIMbyLevel(im.ItemID, im.ManufacturerID, 0);
if (imff.HasReceives() && !Settings.IsRdfMode)
{
if(!Settings.IsRdfMode)
{
if(XtraMessageBox.Show("Are you sure you want change this level and all the received data along with it?","Confirmation",MessageBoxButtons.YesNo) == DialogResult.Yes)
{
// Do the logic that changes the SKU.
BLL.ItemManufacturer.ChangeSKU(im.ItemID, im.ManufacturerID,0,
Convert.ToInt32(txtQuantity.Text));
}
}
else
{
XtraMessageBox.Show("You cannot change an SKU for an Item that has already been Received using this quantity. Please contact the administrator for such changes.","Changing a used SKU not allowed");
return;
}
}
}
im.QuantityPerLevel = Convert.ToInt32(txtQuantity.Text);
if (im.QuantityPerLevel <= 0)
{
im.QuantityPerLevel = 1;
}
im.Save();
if (chkDefault.Checked)
{
im.SaveReceivingDefault();
}
itm.LoadByPrimaryKey( _itemID );
if (itm.StorageTypeID.ToString() == StorageType.BulkStore && !itm.IsColumnNull("IsStackStored") && itm.IsStackStored)
{
BLL.ItemManufacturer imf = new BLL.ItemManufacturer();
imf.SaveStackStored( _itemID, im.ManufacturerID, Convert.ToDouble(txtStackedHeight.EditValue));
}
SaveItemUnits();
XtraMessageBox.Show("Your changes have been saved.", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
_isSaving = false;
OnPackageLevelSelected(new object(), new EventArgs());
}