Ejemplo n.º 1
0
        public void InitDW()
        {
            try
            {
                var setDWBH = ConfigurationManager.AppSettings["LastSetDWBH"].ToString();
                var setDWMC = ConfigurationManager.AppSettings["LastSetDWMC"].ToString();

                if (!string.IsNullOrEmpty(setDWBH) && !string.IsNullOrEmpty(setDWMC))
                {
                    frmLogin.setCookie("GSDWBH", setDWBH, setDWMC);

                    var model = DWService.GetDWData(" and lsbzdw_dwbh='" + setDWBH + "'");
                    if (model.data.Rows.Rows.Count > 0)
                    {
                        CurDWMC = buttonEditDW.Text = setDWMC;
                        CurDWBH = setDWBH;
                    }
                    else
                    {
                        InitFirstDW();
                    }
                }
                else
                {
                    InitFirstDW();
                }
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            if (AlreadyRunning())
            {
                Console.WriteLine("running already");
                return;
            }


            IConfigurationSource configurationSource = ConfigurationSourceFactory.Create();
            LogWriterFactory     logWriterFactory    = new LogWriterFactory(configurationSource);

            Logger.SetLogWriter(logWriterFactory.Create());
            Log("begin running 1.0.0.0");

            var config = new AppConfigConfiguration();
            IOrganizationService service = null;

            try
            {
                service = HelperCrm.CreateOrganizationService(config);
                IDwService dw  = new DWService(Log);
                IJobTime   job = new JobService(Log);
                IRemoveDuplicatesService removeDup = new RemoveDuplicateAuditLog(Log);
                Imapping            mapping        = new MappingCrmToDw(Log);
                ICrmAuditLogService crmToDw        = new CrmAuditLogService(service, Log);
                crmToDw.RetreiveAndSet(config, job, mapping, dw);
            }
            catch (Exception e)
            {
                Log(e.ToString());
            }
            Log("end running");
        }
Ejemplo n.º 3
0
        public void InitFirstDW()
        {
            var model = DWService.GetDWData(" and lsbzdw_mx='1'");

            if (model.data.Rows.Rows.Count > 0)
            {
                DataRow row = model.data.Rows.Rows[0];

                CurDWMC = buttonEditDW.Text = row["LSBZDW_DWMC"].ToString();
                CurDWBH = row["LSBZDW_DWBH"].ToString();
                frmLogin.setCookie("GSDWBH", CurDWBH, CurDWMC);
            }
        }
Ejemplo n.º 4
0
        public FormDW()
        {
            InitializeComponent();
            treeList1.OptionsBehavior.EnableFiltering = true;
            ///treeList1.OptionsView.ShowAutoFilterRow = true;
            treeList1.OptionsFilter.FilterMode = FilterMode.Smart;
            treeList1.OptionsBehavior.Editable = false;

            var model = DWService.GetDWData("");


            DataTable dt = new DataTable();

            DataColumn dc1 = new DataColumn();

            dc1.ColumnName = "DWBH";
            dc1.DataType   = typeof(string);


            DataColumn dc2 = new DataColumn();

            dc2.ColumnName = "ID";
            dc2.DataType   = typeof(string);

            DataColumn dc3 = new DataColumn();

            dc3.ColumnName = "ParentID";
            dc3.DataType   = typeof(string);


            DataColumn dc4 = new DataColumn();

            dc4.ColumnName = "DWMC";
            dc4.DataType   = typeof(string);


            DataColumn dc5 = new DataColumn();

            dc5.ColumnName = "MX";
            dc5.DataType   = typeof(string);

            dt.Columns.Add(dc1);
            dt.Columns.Add(dc2);
            dt.Columns.Add(dc3);
            dt.Columns.Add(dc4);
            dt.Columns.Add(dc5);


            foreach (DataRow row in model.data.Rows.Rows)
            {
                DataRow dr1 = dt.NewRow();
                dr1[0] = row["LSBZDW_DWBH"];
                dr1[1] = row["LSBZDW_DWNM"];
                dr1[2] = row["LSBZDW_DWNM"].ToString().Substring(0, (int.Parse(row["LSBZDW_JS"].ToString()) - 1) * 4);
                dr1[3] = row["LSBZDW_DWMC"];
                dr1[4] = row["LSBZDW_MX"];
                dt.Rows.Add(dr1);
            }

            //treeList1.KeyFieldName = "DWBH";
            //treeList1.ParentFieldName = "PDWBH";
            treeList1.DataSource = dt;
        }