Exemplo n.º 1
0
        public DataSet InsertUpdateItem(dhDBnames objDBNames, dhItems ObjItem)
        {
            DataSet ds;

            ds = objDALGeneral.InsertUpdateItem(objDBNames, ObjItem);
            return(ds);
        }
Exemplo n.º 2
0
        public dhItems GetdhItem(dhDBnames objDBNames, dhItems ObjItem)
        {
            dsGeneral ds           = new dsGeneral();
            DataSet   dsreturn     = objDatabase.GetDataSet(objDBNames, ObjItem, "xmlGetItems", (DataSet)ds, "dtPosItems");
            dhItems   returnObject = null;

            dsGeneral.dtPosItemsDataTable retdt = ((dsGeneral)dsreturn).dtPosItems;
            foreach (DataRow row in retdt.Rows)
            {
                returnObject = new dhItems
                {
                    IItemID              = Convert.ToInt32(row["IItemID"]),
                    FUnitePrice          = Convert.ToDouble(row["FUnitePrice"]),
                    VItemName            = Convert.ToString(row["VItemName"]),
                    FMaxDiscountPresent  = Convert.ToDouble(row["fMaxDiscountPresent"]),
                    FUnitPurchasePrice   = Convert.ToDouble(row["fUnitPurchasePrice"]),
                    IQuantity            = 1,
                    Ammount              = Convert.ToDouble(row["FUnitePrice"]) * 1,
                    IStockIn             = Convert.ToInt32(String.IsNullOrEmpty(row["IStockIn"].ToString()) ? 0 : row["IStockIn"]),
                    IStockOut            = Convert.ToInt32(String.IsNullOrEmpty(row["IStockOut"].ToString()) ? 0 : row["IStockOut"]),
                    ICurrantStock        = Convert.ToInt32(String.IsNullOrEmpty(row["ICurrantStock"].ToString()) ? 0 : row["ICurrantStock"]),
                    IsAvailable          = Convert.ToInt32(String.IsNullOrEmpty(row["ICurrantStock"].ToString()) ? 0 : row["ICurrantStock"]) > 0? true : false,
                    StockStatus          = Convert.ToInt32(String.IsNullOrEmpty(row["ICurrantStock"].ToString()) ? 0 : row["ICurrantStock"]) > 0 ? "Available" : "Not Available",
                    BIsEditAbleInInvoice = Convert.ToBoolean(row["BIsEditAbleInInvoice"].ToString()),
                };
            }
            return(returnObject);
        }
Exemplo n.º 3
0
        private void InsertRecord()
        {
                    dhItems objInsert = new dhItems();
                    objInsert = (dhItems)this.ItemGrid_.DataContext;
                    DataSet ds = iFacedeLayer.iFacede.InsertUpdateItem(Globalized.ObjDbName, objInsert);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        if (ds.Tables[0].Rows[0]["iItemID"].ToString() != "-1")
                        {
                                if (objInsert.IUpdate == 1)
                                {
                                     Globalized.SetMsg("I02", DataHolders.MsgType.Info);
                                }
                                else
                                {
                                     Globalized.SetMsg("I01", DataHolders.MsgType.Info);
                                     objInsert.IUpdate = 1;
                               }
                               AddItemViewModel ObjSetToEdit = new AddItemViewModel(objInsert);
                               Globalized.LoadThisObject(ObjSetToEdit, "Edit Item '" + objInsert.VItemName + "'", Globalized.AppModuleList.Where(xx => xx.VModuleName == "Store").FirstOrDefault().VShortDescription);
                    }
                    else{
      
                             Globalized.SetMsg("I013", MsgType.Error);
                             Globalized.ShowMsg(lblErrorMsg);
                    }
                }

          
            

        }
Exemplo n.º 4
0
 private void ItemBarCode_PreviewKeyUp(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.Key == Key.Enter)
         {
             dhItems ObjDhInputItem = new dhItems();
             if (ItemBarCode.Text.Length > 1)
             {
                 // ObjDhInputItem.VItemBarcode = ItemBarCode.Text;
                 // EmptyInvoice objabc = (EmptyInvoice)this._tabItems[0].Content as EmptyInvoice;
                 // objabc.AddItem(ObjDhInputItem);
                 // AddItem(ObjDhInputItem);
                 // ItemBarCode.Text = "";
                 // ItemBarCode.Focus();
                 // Keyboard.Focus(ItemBarCode);
                 LiftNumber.Text = "";
                 LiftNumber.Focus();
             }
         }
     }
     catch (Exception ex)
     {
         //  Globalized.setException(ex, lblErrorMsg, MsgType.Error);
     }
 }
Exemplo n.º 5
0
        public dsGeneral.dtPosItemsDataTable GetItems(dhDBnames objDBNames, dhItems ObjItem)
        {
            dsGeneral ds       = new dsGeneral();
            DataSet   dsreturn = objDatabase.GetDataSet(objDBNames, ObjItem, "xmlGetItems", (DataSet)ds, "dtPosItems");

            dsGeneral.dtPosItemsDataTable retdt = ((dsGeneral)dsreturn).dtPosItems;

            return(retdt);
            //dsGeneral.dtPosItemsDataTable dt = objDALGeneral.GetAllItems(objDBNames, ObjItem);
            //return dt;
        }
Exemplo n.º 6
0
        // insert Item
        public static DataSet InsertUpdateItem(dhDBnames objDBNames, dhItems ObjItem)
        {
            try
            {
                DataSet var_ret = null;
                if (objblItems == null)
                {
                    objblItems = new blItems();
                }
                {
                    var_ret = objblItems.InsertUpdateItem(objDBNames, ObjItem);
                }

                return(var_ret);
            }
            catch (Exception ex) { throw ex; }
        }
Exemplo n.º 7
0
        public static dhItems GetdhItem(dhDBnames objDBNames, dhItems objItem)
        {
            try
            {
                dhItems var_ret = null;

                if (objblItems == null)
                {
                    objblItems = new blItems();
                }
                {
                    var_ret = objblItems.GetdhItem(objDBNames, objItem);
                }

                return(var_ret);
            }
            catch (Exception ex) { throw ex; }
        }
Exemplo n.º 8
0
        public static dsGeneral.dtPosItemsDataTable GetItems(dhDBnames objDBNames, dhItems objItem)
        {
            try
            {
                dsGeneral.dtPosItemsDataTable var_ret = null;

                if (objblItems == null)
                {
                    objblItems = new blItems();
                }
                {
                    var_ret = objblItems.GetItems(objDBNames, objItem);
                }

                return(var_ret);
            }
            catch (Exception ex) { throw ex; }
        }
Exemplo n.º 9
0
        private void Row_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (sender != null)
            {
                DataGridRow dgr = sender as DataGridRow;
                // get the obect and then Invoice ID opne the Id in readonly mode
                dhItems objTodisplay = new dhItems();

                objTodisplay = ((dhItems)dgr.Item);
                if (objTodisplay != null)
                {
                    objTodisplay.IUpdate = 1;
                    AddItemViewModel ObjSetToEdit = new AddItemViewModel(objTodisplay);
                    //objvm.SelectToEdit(new AddPartyViewModel(objTodisplay));
                    Globalized.LoadThisObject(ObjSetToEdit, "Edit Party '" + objTodisplay.VItemName + "'", Globalized.AppModuleList.Where(xx => xx.VModuleName == "Store").FirstOrDefault().VShortDescription);
                    //}
                }
            }
        }
Exemplo n.º 10
0
        public AddItemView(dhItems Obj)
        {
            Globalized.ShowMsg(lblErrorMsg);
            //  GlobalDhItem.VItemName = "asdasd";
            //GlobalDhItem = Obj;
            //InitializeComponent();
            //this.DataContext = GlobalDhItem;
            //btnCancel.Visibility = Visibility.Hidden;
            //if (Obj.IUpdate == 1)
            //{
            //    //lblHeading.Text = "Edit Item";
            //    ShowStock.Visibility = Visibility.Visible;

            //    // lblInStock.Visibility = Visibility.Hidden;
            //    //  vItemBarcodeTextBox_Copy1.Visibility = Visibility.Hidden;
            //}
            //if (Globalized.ObjCurrentUser.BCanMakeEditAble != false)
            //{
            //    this.bIsEditable.Visibility = Visibility.Visible;
            //}
        }
Exemplo n.º 11
0
        private void ConstructResultSet()
        {
            dhItems objitem = new dhItems();

            dsGeneral.dtPosItemsDataTable dt = iFacede.GetItems(Globalized.ObjDbName, objitem);
            _results = new List <dhItems>();
            foreach (DataRow row in dt.Rows)
            {
                _results.Add(new dhItems
                {
                    IItemID     = Convert.ToInt32(row["IItemID"]),
                    FUnitePrice = Convert.ToDouble(row["FUnitePrice"]),
                    VItemName   = Convert.ToString(row["VItemName"]),
                    //    FMaxDiscountPresent = Convert.ToDouble(row["fMaxDiscountPresent"]),
                    BIsSaleAble  = string.IsNullOrEmpty(row["bIsSaleAble"].ToString()) ? Convert.ToBoolean("False") : Convert.ToBoolean(row["bIsSaleAble"].ToString()),
                    VItemBarcode = row["vItemBarcode"].ToString()
                                   //VpartyMobile = Convert.ToString(row["VpartyMobile"]),
                                   //VPartyName = Convert.ToString(row["ReadingInches"]),
                });
            }
        }
Exemplo n.º 12
0
        private void LiftNumber_PreviewKeyUp(object sender, KeyEventArgs e)



        {
            try
            {
                if (e.Key == Key.Enter)
                {
                    dhItems ObjDhInputItem = new dhItems();
                    if (ItemBarCode.Text.Length > 1)
                    {
                        ObjDhInputItem.VItemBarcode = ItemBarCode.Text;
                        Int32 tabid;
                        int.TryParse(LiftNumber.Text.ToString(), out tabid);
                        if (tabid > tabDynamic.Items.Count)
                        {
                            MessageBox.Show("No Lift is open with this number.");
                        }
                        tabid = tabid > 0 ? tabid - 1 : tabid;
                        EmptyInvoiceView objabc = (EmptyInvoiceView)this._tabItems[tabid].Content as EmptyInvoiceView;
                        //
                        //objabc.
                        objabc.AddItem(ObjDhInputItem);
                        //  AddItem(ObjDhInputItem);
                        tabDynamic.SelectedIndex = tabid;
                        ItemBarCode.Text         = "";
                        ItemBarCode.Focus();
                        Keyboard.Focus(this.ItemBarCode);
                    }
                }
            }
            catch (Exception ex)
            {
                //  Globalized.setException(ex, lblErrorMsg, MsgType.Error);
            }
        }
Exemplo n.º 13
0
        public dhItems GetdhItem(dhDBnames objDBNames, dhItems ObjItem)
        {
            dhItems dh = objDALGeneral.GetdhItem(objDBNames, ObjItem);

            return(dh);
        }
Exemplo n.º 14
0
 public dsGeneral.dtPosItemsDataTable GetItems(dhDBnames objDBNames, dhItems ObjItem)
 {
     dsGeneral.dtPosItemsDataTable dt = objDALGeneral.GetItems(objDBNames, ObjItem);
     return(dt);
 }
Exemplo n.º 15
0
 public AddItemViewModel(dhItems objItem)
 {
     this.GlobalObj = objItem;
 }
Exemplo n.º 16
0
        public DataSet InsertUpdateItem(dhDBnames objDBName, dhItems objItem)
        {
            DataSet dsreturn = objDatabase.GetDataSet(objDBName, objItem, "xmlInsertUpdateItem");

            return(dsreturn);
        }