Exemplo n.º 1
0
        private void Move_Info(FeedbackInfo source_info, int dest_pid, int dest_depth, bool getchild, CFeedback BLL)
        {
            if (source_info == null) return;
            int offset_depth = source_info.Depth - (dest_depth + 1);

            FeedbackInfo info_copy = source_info.copy();
            info_copy.Pid = dest_pid;
            info_copy.Depth = dest_depth + 1;
            info_copy.Status = CCommon.GetStatus_upt();
            info_copy.Timeupdate = DateTime.Now;
            if (BLL.Save(info_copy))
            {
                List<FeedbackInfo> listin = null;
                List<FeedbackInfo> listsub = BLL.Getlist_sub(source_info.Id, listin);
                if (listsub != null && listsub.Count > 0)
                {
                    foreach (FeedbackInfo info_sub in listsub)
                    {
                        info_sub.Pid = getchild ? info_sub.Pid : (info_sub.Pid == source_info.Id ? source_info.Pid : info_sub.Pid);
                        info_sub.Depth = getchild ? info_sub.Depth + offset_depth : info_sub.Depth - 1;
                        info_sub.Status = CCommon.GetStatus_upt();
                        info_sub.Timeupdate = DateTime.Now;
                        BLL.Save(info_sub);
                    }
                }
            }
        }