Пример #1
0
        protected override bool SaveData(DataTable dt, params string[] arr)
        {
            string taskId = arr[0];

            try
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    UserEntity userEntity      = new UserEntity();
                    String     receivePersonId = "";
                    BranchCooperateBankTaskDetailEntity entity = new BranchCooperateBankTaskDetailEntity();
                    entity.id      = Common.GuId();
                    entity.task_id = taskId;
                    OrganizeEntity organizeEntity = organizeApp.GetOrgByName(dt.Rows[i][0] + "");
                    if (organizeEntity != null)
                    {
                        entity.task_object = organizeEntity.F_Id;

                        //获取次分公司的经理管理室
                        userEntity = userApp.GetMFUserByOrgIdAndRoleId(organizeEntity.F_Id, ManagerFamilyRoleId);
                        if (userEntity != null)
                        {
                            receivePersonId = userEntity.F_Id;
                        }
                    }
                    entity.traffic = Convert.ToInt32(dt.Rows[i][1]);
                    //indicatorsDefineApp.GetForm(dt.Rows[0][j] + "").id;
                    //entity.start_date = Convert.ToDateTime(startDate);
                    //entity.end_date = Convert.ToDateTime(endDate);
                    entity.ICBC_NB         = Convert.ToInt32(dt.Rows[i][2]);
                    entity.ICBC_AH         = Convert.ToInt32(dt.Rows[i][3]);
                    entity.CBC             = Convert.ToInt32(dt.Rows[i][4]);
                    entity.ICBC_GD         = Convert.ToInt32(dt.Rows[i][5]);
                    entity.Bank_WZ         = Convert.ToInt32(dt.Rows[i][6]);
                    entity.other_bank      = Convert.ToInt32(dt.Rows[i][7]);
                    entity.Financial_Lean  = Convert.ToInt32(dt.Rows[i][8]);
                    entity.statue          = 0;
                    entity.creator_user_id = OperatorProvider.Provider.GetCurrent().UserId;
                    entity.create_time     = DateTime.Now;
                    DbContext.Insert <BranchCooperateBankTaskDetailEntity>(entity);
                }
            }
            catch (Exception e)
            {
                return(false);
            }
            return(true);
        }
Пример #2
0
        protected override bool SaveData(DataTable dt, params string[] arr)
        {
            string taskId = arr[0];

            try
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    UserEntity userEntity      = new UserEntity();
                    String     receivePersonId = "";
                    BranchFinancialProductTaskDetailEntity entity = new BranchFinancialProductTaskDetailEntity();
                    entity.id      = Common.GuId();
                    entity.task_id = taskId;
                    OrganizeEntity organizeEntity = organizeApp.GetOrgByName(dt.Rows[i][0] + "");
                    if (organizeEntity != null)
                    {
                        entity.task_object = organizeEntity.F_Id;

                        //获取次分公司的经理管理室
                        userEntity = userApp.GetMFUserByOrgIdAndRoleId(organizeEntity.F_Id, ManagerFamilyRoleId);
                        if (userEntity != null)
                        {
                            receivePersonId = userEntity.F_Id;
                        }
                    }

                    entity.traffic             = Convert.ToInt32(dt.Rows[i][1].ToInt());
                    entity.traditional_new_car = Convert.ToInt32(dt.Rows[i][2]);
                    entity.YiRong_loan         = Convert.ToInt32(dt.Rows[i][3]);
                    entity.public_credit       = Convert.ToInt32(dt.Rows[i][4]);
                    entity.car_loaner          = Convert.ToInt32(dt.Rows[i][5]);
                    entity.finanical_leasing   = Convert.ToInt32(dt.Rows[i][6]);
                    entity.second_hand_car     = Convert.ToInt32(dt.Rows[i][7]);
                    entity.statue          = 0;
                    entity.creator_user_id = OperatorProvider.Provider.GetCurrent().UserId;
                    entity.create_time     = DateTime.Now;
                    DbContext.Insert <BranchFinancialProductTaskDetailEntity>(entity);
                }
            }
            catch (Exception e)
            {
                return(false);
            }

            return(true);
        }
Пример #3
0
        protected override bool SaveData(DataTable dt, params string[] arr)
        {
            string taskId   = arr[0];
            string taskType = arr[1];

            //string endDate = arr[2];

            try
            {
                UserEntity userEntity      = new UserEntity();
                String     receivePersonId = "";
                if (taskType.Equals("1"))
                {
                    //个人  把经理室的角色给添加上
                    userEntity = userApp.GetMFUserByOrgIdAndRoleId(OperatorProvider.Provider.GetCurrent().CompanyId, ManagerFamilyRoleId);
                    if (userEntity != null)
                    {
                        receivePersonId = userEntity.F_Id;
                    }
                    if (!String.IsNullOrEmpty(receivePersonId))
                    {
                        SelfTaskDetailEntity selfTaskDetailEntity = new SelfTaskDetailEntity();
                        selfTaskDetailEntity.id              = Common.GuId();
                        selfTaskDetailEntity.task_type       = 5; //待分发
                        selfTaskDetailEntity.person          = receivePersonId;
                        selfTaskDetailEntity.task_statue     = 2; //0 未激活  1待完成  2已完成
                        selfTaskDetailEntity.task_object     = taskId;
                        selfTaskDetailEntity.statue          = 0; //0未删除  1已删除
                        selfTaskDetailEntity.creator_user_id = OperatorProvider.Provider.GetCurrent().UserId;
                        selfTaskDetailEntity.create_time     = DateTime.Now;
                        DbContext.Insert <SelfTaskDetailEntity>(selfTaskDetailEntity);
                    }
                }
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    receivePersonId = "";
                    userEntity      = new UserEntity();
                    YearlyTaskDetailEntity entity = new YearlyTaskDetailEntity();
                    entity.id      = Common.GuId();
                    entity.task_id = taskId;

                    if (taskType.Equals("0"))
                    {
                        //公司
                        OrganizeEntity organizeEntity = organizeApp.GetOrgByName(Convert.ToString(dt.Rows[i][0]));
                        if (organizeEntity != null)
                        {
                            entity.task_object = organizeEntity.F_Id;

                            //获取次分公司的经理管理室
                            userEntity = userApp.GetMFUserByOrgIdAndRoleId(organizeEntity.F_Id, ManagerFamilyRoleId);
                            if (userEntity != null)
                            {
                                receivePersonId = userEntity.F_Id;
                            }
                        }
                    }
                    else
                    {
                        //个人

                        userEntity = userApp.GetByPhone(Convert.ToString(dt.Rows[i][14]));
                        if (userEntity != null)
                        {
                            entity.task_object = userEntity.F_Id;
                        }
                        receivePersonId = userEntity.F_Id;
                    }
                    entity.task_yearly     = Convert.ToInt32(dt.Rows[i][1]); //indicatorsDefineApp.GetForm(dt.Rows[0][j] + "").id;
                    entity.start_date      = null;                           // Convert.ToDateTime(startDate);
                    entity.end_date        = null;                           //Convert.ToDateTime(endDate);
                    entity.task_Jan        = Convert.ToInt32(dt.Rows[i][2]);
                    entity.task_Feb        = Convert.ToInt32(dt.Rows[i][3]);
                    entity.task_Mar        = Convert.ToInt32(dt.Rows[i][4]);
                    entity.task_Apr        = Convert.ToInt32(dt.Rows[i][5]);
                    entity.task_May        = Convert.ToInt32(dt.Rows[i][6]);
                    entity.task_Jun        = Convert.ToInt32(dt.Rows[i][7]);
                    entity.task_Jul        = Convert.ToInt32(dt.Rows[i][8]);
                    entity.task_Aug        = Convert.ToInt32(dt.Rows[i][9]);
                    entity.task_Sep        = Convert.ToInt32(dt.Rows[i][10]);
                    entity.task_Oct        = Convert.ToInt32(dt.Rows[i][11]);
                    entity.task_Nov        = Convert.ToInt32(dt.Rows[i][12]);
                    entity.task_Dec        = Convert.ToInt32(dt.Rows[i][13]);
                    entity.statue          = 0;
                    entity.creator_user_id = OperatorProvider.Provider.GetCurrent().UserId;
                    entity.create_time     = DateTime.Now;
                    DbContext.Insert <YearlyTaskDetailEntity>(entity);

                    //为分公司或者个人添加自己的任务
                    #region 添加个人的任务
                    if (!String.IsNullOrEmpty(receivePersonId))
                    {
                        SelfTaskDetailEntity selfTaskDetailEntity = new SelfTaskDetailEntity();
                        selfTaskDetailEntity.id              = Common.GuId();
                        selfTaskDetailEntity.task_type       = 5; //待分发
                        selfTaskDetailEntity.person          = receivePersonId;
                        selfTaskDetailEntity.task_statue     = 0; //0 未激活  1待完成  2已完成
                        selfTaskDetailEntity.task_object     = taskId;
                        selfTaskDetailEntity.statue          = 0; //0未删除  1已删除
                        selfTaskDetailEntity.creator_user_id = OperatorProvider.Provider.GetCurrent().UserId;
                        selfTaskDetailEntity.create_time     = DateTime.Now;
                        DbContext.Insert <SelfTaskDetailEntity>(selfTaskDetailEntity);
                    }

                    #endregion
                }
            }
            catch (Exception e)
            {
                return(false);
            }

            return(true);
        }