示例#1
0
        public DataSet InsertUpdateParty(dhDBnames objDBNames, dhParty objParty)
        {
            DataSet ds;

            ds = objDALGeneral.InsertUpdateParty(objDBNames, objParty);
            return(ds);
        }
        // dhParty GlobalObjParty = new dhParty();
        public AddPartyView(dhParty Obj)
        {
            InitializeComponent();
            dhSaleMan objSaleMan = new dhSaleMan();

            Globalized.ShowMsg(lblErrorMsg);
        }
示例#3
0
        //= new ObservableCollection<dhParty>();
        public PartyViewModel()
        {
            DisplayName = "Parties";
            dhParty objLoad = new dhParty();

            this.loadData(objLoad);
        }
示例#4
0
        public dsGeneral.dtPosPartyDataTable GetParty(dhDBnames objDBName, dhParty objParty)
        {
            dsGeneral ds       = new dsGeneral();
            DataSet   dsreturn = objDatabase.GetDataSet(objDBName, objParty, "xmlGetParty", (DataSet)ds, "dtPosParty");

            dsGeneral.dtPosPartyDataTable retdt = ((dsGeneral)dsreturn).dtPosParty;
            return(retdt);
        }
示例#5
0
 public void GetParty(dhDBnames objDBNames, dhParty objParty, ComboBox ObjPartylist)
 {
     dsGeneral.dtPosPartyDataTable dt = objDALGeneral.GetParty(objDBNames, objParty);
     //Binding myBinding = new Binding("Party");
     //myBinding.Source = dt;//cusmo.Customer; // data source from your example
     ObjPartylist.ItemsSource       = dt;
     ObjPartylist.DisplayMemberPath = "vPartyName";
     ObjPartylist.SelectedValuePath = "iPartyID";
     //ObjPartylist.SetBinding(ComboBox.ItemsSourceProperty, myBinding);
     //ObjPartylist
     //return dt;
 }
示例#6
0
        public static DataSet InsertUpdateParty(dhDBnames objDBNames, dhParty objParty)
        {
            try
            {
                DataSet var_ret;

                if (objBLParty == null)
                {
                    objBLParty = new blParty();
                }
                var_ret = objBLParty.InsertUpdateParty(objDBNames, objParty);

                return(var_ret);
            }
            catch (Exception ex) { throw ex; }
        }
示例#7
0
 private void loadData(dhParty objParty, Boolean ShowResultCount = false)
 {
     //dsGeneral.dtPosPartyDataTable dtparty = iFacede.GetParty(Globalized.ObjDbName, objParty);
     //sequence = ReflectionUtility.DataTableToObservableCollection<dhParty>(dtparty);
     // partyList.ItemsSource = sequence;
     ////pageControl.PageContract = null;
     ////pageControl.PageContract = this;
     //Globalized.ShowMsg(lblErrorMsg);
     //// show msg for local search
     //if ((ShowResultCount) && (sequence != null))
     //{
     //    String msg = String.Format("  {0}  Search Results Found", sequence.Count);
     ////    pageControl.ReLoad();
     //    Globalized.setException(msg, lblErrorMsg, DataHolders.MsgType.Info);
     //}
 }
示例#8
0
        public static void GetParty(dhDBnames objDBNames, dhParty objParty, ComboBox ObjPartylist)
        {
            try
            {
                // dsGeneral.dtPosPartyDataTable var_ret = null ;

                if (objBLParty == null)
                {
                    objBLParty = new blParty();
                }
                {
                    objBLParty.GetParty(objDBNames, objParty, ObjPartylist);
                }

                // return var_ret;
            }
            catch (Exception ex) { throw ex; }
        }
示例#9
0
        public static dsGeneral.dtPosPartyDataTable  GetParty(dhDBnames objDBNames, dhParty objParty)
        {
            try
            {
                dsGeneral.dtPosPartyDataTable var_ret = null;

                if (objBLParty == null)
                {
                    objBLParty = new blParty();
                }
                {
                    var_ret = objBLParty.GetParty(objDBNames, objParty);
                }

                return(var_ret);
            }
            catch (Exception ex) { throw ex; }
        }
示例#10
0
        private void Stock_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
                dhParty objTodisplay = new dhParty();

                objTodisplay = ((dhParty)dgr.Item);
                if (objTodisplay != null)
                {
                    objTodisplay.IUpdate = 1;
                    AddPartyViewModel ObjSetToEdit = new AddPartyViewModel(objTodisplay);
                    //objvm.SelectToEdit(new AddPartyViewModel(objTodisplay));
                    Globalized.LoadThisObject(ObjSetToEdit, "Edit Party '" + objTodisplay.VPartyName + "'", Globalized.AppModuleList.Where(xx => xx.VModuleName == "Party").FirstOrDefault().VShortDescription);
                }
            }
        }
示例#11
0
        private void ConstructResultSet()
        {
            dhParty objparty = new dhParty();

            dsGeneral.dtPosPartyDataTable dt = iFacede.GetParty(Globalized.ObjDbName, objparty);
            _results = new List <dhParty>();
            foreach (DataRow row in dt.Rows)
            {
                _results.Add(new dhParty
                {
                    IPartyID     = Convert.ToInt32(row["IPartyID"]),
                    VPartyName   = Convert.ToString(row["VPartyName"]),
                    VPartyadress = Convert.ToString(row["VPartyadress"]),
                    VpartyMobile = Convert.ToString(row["VpartyMobile"]),
                    VPartyInfo   = Convert.ToString(row["VPartyName"]) + " , " + Convert.ToString(row["VPartyadress"]) + " , " + Convert.ToString(row["VpartyMobile"]),
                    //VItemName = Convert.ToString(row["VItemName"]),
                    //FMaxDiscountPresent = Convert.ToDouble(row["fMaxDiscountPresent"]),
                    //VpartyMobile = Convert.ToString(row["VpartyMobile"]),
                    //VPartyName = Convert.ToString(row["ReadingInches"]),
                });
            }
        }
示例#12
0
 public dsGeneral.dtPosPartyDataTable GetParty(dhDBnames objDBNames, dhParty objParty)
 {
     dsGeneral.dtPosPartyDataTable dt = objDALGeneral.GetParty(objDBNames, objParty);
     return(dt);
 }
示例#13
0
 public AddPartyViewModel(dhParty objTodisplay)
 {
     this.GlobalObjParty = objTodisplay;
 }
示例#14
0
 private void loadData(dhParty objParty /* , Boolean ShowResultCount = false*/)
 {
     dsGeneral.dtPosPartyDataTable dtparty = iFacede.GetParty(Globalized.ObjDbName, objParty);
     Parties = ReflectionUtility.DataTableToObservableCollection <dhParty>(dtparty);
 }
示例#15
0
        public DataSet InsertUpdateParty(dhDBnames objDBName, dhParty objParty)
        {
            DataSet dsreturn = objDatabase.GetDataSet(objDBName, objParty, "xmlInsertUpdateParty");

            return(dsreturn);
        }
        private void SaveTheParty(object sender, RoutedEventArgs e)
        {
            try
            {
                dhParty objParty = new dhParty();
                objParty       = (dhParty)grid1.DataContext;
                objParty.VCity = vCityList.SelectedValue != null?this.vCityList.SelectedValue.ToString() : null;

                dsGeneral.dtPosPartyDataTable  dtParty  = iFacede.GetParty(Globalized.ObjDbName, new dhParty());
                ObservableCollection <dhParty> listItem = BL.ReflectionUtility.DataTableToObservableCollection <dhParty>(dtParty);
                string bFound = null;

                foreach (dhParty item in listItem)
                {
                    string[] words = item.VPartyName.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

                    string[] filter = objParty.VPartyName.ToLower().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                    if ((objParty.IPartyID != null) && (item.IPartyID == objParty.IPartyID))
                    {
                        continue;
                    }
                    bFound = words.Where(x => filter.Contains(x.ToLower())).FirstOrDefault();
                    if (bFound != null)
                    {
                        break;
                    }
                }

                if (bFound != null)
                {
                    if (!blUtil.OverrideInformation(objParty.VPartyName, bFound))
                    {
                        this.vPartyNameTextBox.SelectAll();
                        this.vPartyNameTextBox.Focus();
                        return;
                    }
                }
                objParty.VPartyadress = objParty.VMarket + " , " + objParty.VArea + " , " + objParty.VDistrict + " , " + objParty.VCity;


                lblErrorMsg.Visibility = Visibility.Hidden;
                DataSet dsr = iFacede.InsertUpdateParty(Globalized.ObjDbName, objParty);

                if (dsr.Tables.Count > 0)
                {
                    DataTable dtb = dsr.Tables[0];
                    if (dtb.Rows.Count > 0)
                    {
                        objParty = BL.ReflectionUtility.DataTableToObservableCollection <dhParty>(dtb).FirstOrDefault();
                    }
                }

                if (((dhParty)grid1.DataContext).IUpdate == 1)
                {
                    Globalized.SetMsg("P02", DataHolders.MsgType.Info);
                }
                else
                {
                    Globalized.SetMsg("P01", DataHolders.MsgType.Info);
                    objParty.IUpdate = 1;
                    AddPartyViewModel ObjSetToEdit = new AddPartyViewModel(objParty);
                    Globalized.LoadThisObject(ObjSetToEdit, "Edit Party '" + objParty.VPartyName + "'", Globalized.AppModuleList.Where(xx => xx.VDisplayName == "Party").FirstOrDefault().VShortDescription);
                }
                Globalized.ShowMsg(lblErrorMsg);
            }

            catch (Exception ex)
            {
                Globalized.GlobalMsg = null;
                Globalized.SetMsg(ex.Message, MsgType.Error);
                Globalized.ShowMsg(lblErrorMsg);
            }
        }