UI.manageVehicleCategories=function(){var A=[{name:"ID",type:"int"},{name:"Name",type:"string"},{name:"SortCode",type:"string"}];var B=Ext.data.Record.create(A);if("undefined"==typeof (this.manageVC)){this.manageVC=new Cici.ManagementWindow({id:"VehicleCategories",title:"Management Categorii Vehicule",width:700,height:400,minWidth:700,minHeight:300,idCol:"ID",arrRecordModel:A,recordModel:B,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetVehicleCategories,params:{}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},B)}),columnModel:[{header:"Denumire",width:120,sortable:true,dataIndex:"Name",menuDisabled:true},{header:"Cod sortare",width:80,sortable:true,dataIndex:"SortCode",menuDisabled:true}],editFields:[{xtype:"textfield",fieldLabel:"Denumire",allowBlank:false,maxLength:200,id:"Name"},{xtype:"textfield",fieldLabel:"Cod sortare",allowBlank:false,maxLength:1,id:"SortCode"}],deleteMethod:RCAService.MDeleteVehicleCategory,editMethod:RCAService.MEditVehicleCategory,addMethod:RCAService.MAddVehicleCategory,quickSearch:false})}this.manageVC.show()};UI.manageVehicleTypes=function(){var B=[{name:"ID",type:"int"},{name:"VehicleCategoryID",type:"int"},{name:"VehicleCategoryName",type:"string"},{name:"Name",type:"string"},{name:"SortCode",type:"string"}];var A=Ext.data.Record.create(B);if("undefined"==typeof (this.manageVT)){this.manageVT=new Cici.ManagementWindow({id:"VehicleTypes",title:"Management Tip Vehicule",width:700,height:400,minWidth:700,minHeight:300,idCol:"ID",arrRecordModel:B,recordModel:A,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetVehicleTypes,params:{vehicleCategoryID:null}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},A)}),columnModel:[{header:"Categorie",width:120,sortable:true,dataIndex:"VehicleCategoryName",menuDisabled:true},{header:"Tip",width:120,sortable:true,dataIndex:"Name",menuDisabled:true}],editFields:[{xtype:"combo",fieldLabel:"Categorie",id:"VehicleCategoryID",editable:false,forceSelection:true,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetVehicleCategories,params:{}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},Ext.data.Record.create([{name:"ID"},{name:"Name"}]))}),allowBlank:false,displayField:"Name",valueField:"ID",triggerAction:"all"},{xtype:"textfield",fieldLabel:"Tip",allowBlank:false,maxLength:200,id:"Name"},{xtype:"textfield",fieldLabel:"Cod sortare",allowBlank:false,maxLength:1,id:"SortCode"}],deleteMethod:RCAService.MDeleteVehicleType,editMethod:RCAService.MEditVehicleType,addMethod:RCAService.MAddVehicleType,quickSearch:false,loadAllStores:true});this.manageVT.on("beforecommit",function(E,C){var D=C.item("VehicleTypes-VehicleCategoryID");E.set("VehicleCategoryName",D.store.getById(D.getValue()).get(D.displayField))},this)}this.manageVT.show()};UI.manageCustomerTypes=function(){var B=[{name:"ID",type:"int"},{name:"Name",type:"string"}];var A=Ext.data.Record.create(B);if("undefined"==typeof (this.manageCT)){this.manageCT=new Cici.ManagementWindow({id:"CustomerTypes",title:"Management Tipuri Clienti",width:600,editWidth:300,height:400,minWidth:700,minHeight:300,idCol:"ID",arrRecordModel:B,recordModel:A,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetCustomerTypes,params:{}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},A)}),columnModel:[{header:"Denumire",width:120,sortable:true,dataIndex:"Name",menuDisabled:true}],editFields:[{xtype:"textfield",fieldLabel:"Denumire",allowBlank:false,maxLength:200,id:"Name"}],deleteMethod:RCAService.MDeleteCustomerType,editMethod:RCAService.MEditCustomerType,addMethod:RCAService.MAddCustomerType,quickSearch:false})}this.manageCT.show()};UI.manageCustomerLocations=function(){var B=[{name:"ID",type:"int"},{name:"Name",type:"string"}];var A=Ext.data.Record.create(B);if("undefined"==typeof (this.manageCL)){this.manageCL=new Cici.ManagementWindow({id:"CustomerLocations",title:"Management Locatii Clienti",width:600,editWidth:300,height:400,minWidth:700,minHeight:300,idCol:"ID",arrRecordModel:B,recordModel:A,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetCustomerLocations,params:{}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},A)}),columnModel:[{header:"Denumire",width:120,sortable:true,dataIndex:"Name",menuDisabled:true}],editFields:[{xtype:"textfield",fieldLabel:"Denumire",allowBlank:false,maxLength:200,id:"Name"}],deleteMethod:RCAService.MDeleteCustomerLocation,editMethod:RCAService.MEditCustomerLocation,addMethod:RCAService.MAddCustomerLocation,quickSearch:false})}this.manageCL.show()};UI.managePaymentTypes=function(){var A=[{name:"ID",type:"int"},{name:"Name",type:"string"}];var B=Ext.data.Record.create(A);if("undefined"==typeof (this.managePT)){this.managePT=new Cici.ManagementWindow({id:"PaymentTypes",title:"Management Perioade de Plata",width:600,editWidth:300,height:400,minWidth:700,minHeight:300,idCol:"ID",arrRecordModel:A,recordModel:B,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetPaymentTypes,params:{}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},B)}),columnModel:[{header:"Denumire",width:120,sortable:true,dataIndex:"Name",menuDisabled:true}],editFields:[{xtype:"textfield",fieldLabel:"Denumire",allowBlank:false,maxLength:200,id:"Name"}],deleteMethod:RCAService.MDeletePaymentType,editMethod:RCAService.MEditPaymentType,addMethod:RCAService.MAddPaymentType,quickSearch:false})}this.managePT.show()};UI.manageFirms=function(){var B=[{name:"ID",type:"int"},{name:"Name",type:"string"},{name:"InfoFile",type:"string"}];var A=Ext.data.Record.create(B);if("undefined"==typeof (this.manageF)){this.manageF=new Cici.ManagementWindow({id:"Firms",title:"Management Firme",width:700,height:400,minWidth:700,minHeight:300,idCol:"ID",arrRecordModel:B,recordModel:A,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetFirms,params:{}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},A)}),columnModel:[{header:"Denumire",width:120,sortable:true,dataIndex:"Name",menuDisabled:true},{header:"Fisier informatii",width:120,sortable:true,dataIndex:"InfoFile",menuDisabled:true}],editFields:[{xtype:"textfield",fieldLabel:"Denumire",allowBlank:false,maxLength:200,id:"Name"},{xtype:"textfield",fieldLabel:"InfoFile",maxLength:50,id:"InfoFile"}],deleteMethod:RCAService.MDeleteFirm,editMethod:RCAService.MEditFirm,addMethod:RCAService.MAddFirm,quickSearch:false})}this.manageF.show()};UI.managePrices=function(){var A=[{name:"ID",type:"int"},{name:"FirmID",type:"int"},{name:"FirmName",type:"string"},{name:"VehicleTypeID",type:"int"},{name:"VehicleTypeName",type:"string"},{name:"CustomerTypeID",type:"int"},{name:"CustomerTypeName",type:"string"},{name:"CustomerLocationID",type:"int"},{name:"CustomerLocationName",type:"string"},{name:"PaymentTypeID",type:"int"},{name:"PaymentTypeName",type:"string"},{name:"Value",type:"float"}];var B=Ext.data.Record.create(A);if("undefined"==typeof (this.manageP)){this.manageP=new Cici.ManagementWindow({id:"Prices",title:"Management Preturi",width:850,editWidth:300,height:400,minWidth:700,minHeight:300,idCol:"ID",arrRecordModel:A,recordModel:B,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetPrices,params:{}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},B)}),columnModel:[{header:"Firma",sortable:true,dataIndex:"FirmName",menuDisabled:true},{header:"Tip Vehicul",sortable:true,dataIndex:"VehicleTypeName",menuDisabled:true},{header:"Tip Client",sortable:true,dataIndex:"CustomerTypeName",menuDisabled:true},{header:"Locatie Client",sortable:true,dataIndex:"CustomerLocationName",menuDisabled:true},{header:"Perioada Plata",sortable:true,dataIndex:"PaymentTypeName",menuDisabled:true},{header:"Valoare",sortable:true,dataIndex:"Value",menuDisabled:true}],editFields:[{xtype:"combo",fieldLabel:"Firma",id:"FirmID",editable:false,forceSelection:true,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetFirms,params:{}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},Ext.data.Record.create([{name:"ID"},{name:"Name"}]))}),allowBlank:false,displayField:"Name",valueField:"ID",triggerAction:"all"},{xtype:"combo",fieldLabel:"Tip vehicul",id:"VehicleTypeID",editable:false,forceSelection:true,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetVehicleTypes,params:{vehicleCategoryID:null}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},Ext.data.Record.create([{name:"ID"},{name:"VehicleCategoryID"},{name:"Name"}]))}),allowBlank:false,displayField:"Name",valueField:"ID",triggerAction:"all"},{xtype:"combo",fieldLabel:"Tip client",id:"CustomerTypeID",editable:false,forceSelection:true,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetCustomerTypes,params:{}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},Ext.data.Record.create([{name:"ID"},{name:"Name"}]))}),allowBlank:false,displayField:"Name",valueField:"ID",triggerAction:"all"},{xtype:"combo",fieldLabel:"Locatie client",id:"CustomerLocationID",editable:false,forceSelection:true,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetCustomerLocations,params:{}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},Ext.data.Record.create([{name:"ID"},{name:"Name"}]))}),allowBlank:false,displayField:"Name",valueField:"ID",triggerAction:"all"},{xtype:"combo",fieldLabel:"Perioada de plata",id:"PaymentTypeID",editable:false,forceSelection:true,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetPaymentTypes,params:{}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},Ext.data.Record.create([{name:"ID"},{name:"Name"}]))}),allowBlank:false,displayField:"Name",valueField:"ID",triggerAction:"all"},{xtype:"numberfield",fieldLabel:"Valoare",allowBlank:false,id:"Value"}],deleteMethod:RCAService.MDeletePrice,editMethod:RCAService.MEditPrice,addMethod:RCAService.MAddPrice,quickSearch:false,loadAllStores:true,filters:[{xtype:"combo",label:"Firma",webService:RCAService,webMethod:RCAService.MGetFirms,readerConfig:{totalProperty:"count",root:"rows",id:"ID"},filterMethod:function(C,D){if(D!=""&&D!=0&&C.get("FirmID")!=D){return false}return true}},{xtype:"combo",label:"Tip vehicul",webService:RCAService,webMethod:RCAService.MGetVehicleTypes,webMethodParams:{vehicleCategoryID:null},readerConfig:{totalProperty:"count",root:"rows",id:"ID"},filterMethod:function(C,D){if(D!=""&&D!=0&&C.get("VehicleTypeID")!=D){return false}return true}}]});this.manageP.on("beforecommit",function(E,C){var D=C.item("Prices-FirmID");E.set("FirmName",D.store.getById(D.getValue()).get(D.displayField));var D=C.item("Prices-VehicleTypeID");E.set("VehicleTypeName",D.store.getById(D.getValue()).get(D.displayField));var D=C.item("Prices-CustomerTypeID");E.set("CustomerTypeName",D.store.getById(D.getValue()).get(D.displayField));var D=C.item("Prices-CustomerLocationID");E.set("CustomerLocationName",D.store.getById(D.getValue()).get(D.displayField));var D=C.item("Prices-PaymentTypeID");E.set("PaymentTypeName",D.store.getById(D.getValue()).get(D.displayField))},this)}this.manageP.show()};UI.manageNews=function(){var A=[{name:"ID",type:"int"},{name:"Text",type:"string"}];var B=Ext.data.Record.create(A);if("undefined"==typeof (this.manageN)){this.manageN=new Cici.ManagementWindow({id:"News",title:"Management Stiri",width:600,editWidth:300,height:400,minWidth:700,minHeight:300,idCol:"ID",arrRecordModel:A,recordModel:B,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetNews,params:{}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},B)}),columnModel:[{header:"Text",width:120,sortable:true,dataIndex:"Text",menuDisabled:true}],editFields:[{xtype:"textarea",fieldLabel:"Text",allowBlank:false,height:300,maxLength:200,id:"Text"}],deleteMethod:RCAService.MDeleteNew,editMethod:RCAService.MEditNew,addMethod:RCAService.MAddNew,quickSearch:false})}this.manageN.show()};UI.manageDiscounts=function(){var A=[{name:"ID",type:"int"},{name:"Firm",type:"string"},{name:"FirmID",type:"int"},{name:"CustomerType",type:"string"},{name:"CustomerTypeID",type:"int"},{name:"PaymentType",type:"string"},{name:"PaymentTypeID",type:"int"},{name:"Percent",type:"int"}];var B=Ext.data.Record.create(A);if("undefined"==typeof (this.manageD)){this.manageD=new Cici.ManagementWindow({id:"Discounts",title:"Management Reduceri",width:850,editWidth:350,height:400,minWidth:700,minHeight:300,idCol:"ID",arrRecordModel:A,recordModel:B,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetDiscounts,params:{}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},B)}),columnModel:[{header:"Firma",sortable:true,dataIndex:"Firm",menuDisabled:true},{header:"Tip Client",sortable:true,dataIndex:"CustomerType",menuDisabled:true},{header:"Perioada Plata",sortable:true,dataIndex:"PaymentType",menuDisabled:true},{header:"Procent",sortable:true,dataIndex:"Percent",menuDisabled:true}],editFields:[{xtype:"combo",fieldLabel:"Firma",id:"FirmID",editable:false,forceSelection:true,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetFirms,params:{}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},Ext.data.Record.create([{name:"ID"},{name:"Name"}]))}),allowBlank:false,displayField:"Name",valueField:"ID",triggerAction:"all"},{xtype:"combo",fieldLabel:"Tip client",id:"CustomerTypeID",editable:false,forceSelection:true,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetCustomerTypes,params:{}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},Ext.data.Record.create([{name:"ID"},{name:"Name"}]))}),allowBlank:false,displayField:"Name",valueField:"ID",triggerAction:"all"},{xtype:"combo",fieldLabel:"Perioada de plata",id:"PaymentTypeID",editable:false,forceSelection:true,store:new Ext.data.Store({proxy:new Cici.AspWebServiceProxy({webServiceProxy:RCAService,webServiceProxyMethod:RCAService.MGetPaymentTypes,params:{}}),baseParams:{},reader:new Ext.data.JsonReader({totalProperty:"count",root:"rows",id:"ID"},Ext.data.Record.create([{name:"ID"},{name:"Name"}]))}),allowBlank:false,displayField:"Name",valueField:"ID",triggerAction:"all"},{xtype:"numberfield",fieldLabel:"Procent",allowBlank:false,minValue:0,maxValue:100,id:"Percent"}],deleteMethod:RCAService.MDeleteDiscount,editMethod:RCAService.MEditDiscount,addMethod:RCAService.MAddDiscount,quickSearch:false,loadAllStores:true,filters:[{xtype:"combo",label:"Firma",webService:RCAService,webMethod:RCAService.MGetFirms,readerConfig:{totalProperty:"count",root:"rows",id:"ID"},filterMethod:function(C,D){if(D!=""&&D!=0&&C.get("FirmID")!=D){return false}return true}}]});this.manageD.on("beforecommit",function(E,C){var D=C.item("Discounts-FirmID");E.set("Firm",D.store.getById(D.getValue()).get(D.displayField));var D=C.item("Discounts-CustomerTypeID");E.set("CustomerType",D.store.getById(D.getValue()).get(D.displayField));var D=C.item("Discounts-PaymentTypeID");E.set("PaymentType",D.store.getById(D.getValue()).get(D.displayField))},this)}this.manageD.show()};
