public void SubmitForm(BranchCooperateBankTaskDetailEntity entity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         entity.Modify(keyValue);
         service.Update(entity);
     }
     else
     {
         entity.Create();
         service.Insert(entity);
     }
 }
Ejemplo n.º 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 = "";
                    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);
        }