예제 #1
0
 protected void grdProductSupplier_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
 {
     collectData();
     e.NewValues["ItemId"] = currentItem;
     NAS.DAL.Nomenclature.Organization.SupplierOrg supp = session.FindObject <NAS.DAL.Nomenclature.Organization.SupplierOrg>
                                                              (new BinaryOperator("OrganizationId", e.NewValues["SupplierOrgId!Key"]));
     if (supp != null)
     {
         e.NewValues["SupplierOrgId"] = supp;
     }
     treelstProductUnits.CancelEdit();
 }
예제 #2
0
        public void CRUD_Saving()
        {
            if (ChkSelectedSuppliersAll.Checked)
            {
                SelectionLST = new List <DataGrdSupplierListSelection>();
                DataGrdSupplierListSelection o = new DataGrdSupplierListSelection();
                NAS.DAL.Nomenclature.Organization.SupplierOrg.Populate();
                NAS.DAL.Nomenclature.Organization.SupplierOrg s =
                    session.FindObject <NAS.DAL.Nomenclature.Organization.SupplierOrg>(
                        new BinaryOperator("Code", Utility.Constant.NAAN_DEFAULT_CODE_SELECTEDALL, BinaryOperatorType.Equal));
                o.OrganizationId = s.OrganizationId;
                o.Code           = s.Code;
                o.Name           = s.Name;
                SelectionLST.Add(o);
            }

            RuleObject.SaveRuleCondition(session, KeyValue, SelectionLST);
        }
예제 #3
0
파일: SupplierOrg.cs 프로젝트: ewin66/dev
 public static SupplierOrg InitNewRow(Session session)
 {
     try
     {
         SupplierOrg supplierOrg = new SupplierOrg(session)
         {
             OrganizationTypeId   = Util.getDefaultXpoObject <OrganizationType>(session),
             RowStatus            = 0,
             RowCreationTimeStamp = DateTime.Now
         };
         supplierOrg.Save();
         return(supplierOrg);
     }
     catch (Exception)
     {
         throw;
     }
     finally
     {
     }
 }
예제 #4
0
파일: SupplierOrg.cs 프로젝트: ewin66/dev
        new public static void Populate()
        {
            Session session = null;

            try
            {
                session = XpoHelper.GetNewSession();
                //insert default data into Organization table
                OrganizationType organizationType = session.FindObject <OrganizationType>(new BinaryOperator("Code", Utility.Constant.NAAN_DEFAULT_CODE));
                //Insert
                if (!Util.isExistXpoObject <Organization>("Code",
                                                          Utility.Constant.NAAN_DEFAULT_CODE_SELECTEDALL))
                {
                    SupplierOrg defaultSupplierForSelectAll = new SupplierOrg(session)
                    {
                        Code = Utility.Constant.NAAN_DEFAULT_CODE_SELECTEDALL,
                        Name = Utility.Constant.NAAN_DEFAULT_CODE_SELECTEDALL,
                        OrganizationTypeId   = organizationType,
                        Description          = "",
                        RowStatus            = Utility.Constant.ROWSTATUS_DEFAULT_SELECTEDALL,
                        RowCreationTimeStamp = DateTime.Now,
                        TaxNumber            = "",
                        Address = ""
                    };
                    defaultSupplierForSelectAll.Save();
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                if (session != null)
                {
                    session.Dispose();
                }
            }
        }