コード例 #1
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);
        }
コード例 #2
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;
 }
コード例 #3
0
ファイル: iFacede.cs プロジェクト: fr110/SublimeCareCloud1
        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; }
        }
コード例 #4
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"]),
                });
            }
        }
コード例 #5
0
 public dsGeneral.dtPosPartyDataTable GetParty(dhDBnames objDBNames, dhParty objParty)
 {
     dsGeneral.dtPosPartyDataTable dt = objDALGeneral.GetParty(objDBNames, objParty);
     return(dt);
 }
コード例 #6
0
 private void loadData(dhParty objParty /* , Boolean ShowResultCount = false*/)
 {
     dsGeneral.dtPosPartyDataTable dtparty = iFacede.GetParty(Globalized.ObjDbName, objParty);
     Parties = ReflectionUtility.DataTableToObservableCollection <dhParty>(dtparty);
 }
コード例 #7
0
        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);
            }
        }