public override DFDictionary Get(FormM form, DFDictionary entity, ref string message)
        {
            var dict = new DFDictionary();
            var f    = SessionHelper.Get <FormM>("f");

            dict.Add("FormName", f.FormName);
            dict.Add("DAImp", f.DAImp);
            dict.Add("FormId", f.FormId);
            dict.Add("FormDesc", f.FormDesc);
            return(dict);
        }
        /// <summary>
        /// ÉèÖÃ FileName
        /// </summary>
        /// <param name="FileId"></param>
        /// <param name="dict"></param>
        /// <param name="key"></param>
        public static void SetFileName(string FileId, DFDictionary dict, string key)
        {
            var entity = Get(FileId);

            if (entity != null)
            {
                dict.Add(key, entity.FileName);
            }
        }
        public override void SetAccess(FormM form, DFDictionary entity)
        {
            var ycs        = WF_M_PUBLICCODELoader.Query("YCName");
            var palletDict = new DFDictionary();

            foreach (var item in ycs)
            {
                palletDict.Add(item.CodeName, item.CodeValue);
            }
            this.Model.Add("YCName_DataSource", Base64StringHelper.ConvertToBase64String(JsonSerializeHelper.SerializeObject(palletDict)));
        }
Пример #4
0
        public override DFDictionary Get(FormM form, DFDictionary entity, ref string message)
        {
            var dict = new DFDictionary();
            var f    = SessionHelper.Get <FormM>("f");
            // Panel|0|Row|0
            var _Path = entity["_Path"];
            var ss    = _Path.Split('|');
            var c     = f.Panels[int.Parse(ss[1])].Rows[int.Parse(ss[3])];

            dict.Add("RowAttributes", c.RowAttributes);
            return(dict);
        }
Пример #5
0
        public override DFDictionary Get(FormM form, DFDictionary entity, ref string message)
        {
            var dict = new DFDictionary();
            var f    = SessionHelper.Get <FormM>("f");
            // Panel|0|Column|1
            var _Path = entity["_Path"];
            var ss    = _Path.Split('|');
            var c     = f.Panels[int.Parse(ss[1])].Columns[int.Parse(ss[3])];

            dict.Add("AfterScript", c.AfterScript);
            dict.Add("Editor", c.Editor);
            dict.Add("Name", c.Name);
            dict.Add("OtherAttributes", c.OtherAttributes);
            dict.Add("Renderer", c.Renderer);
            dict.Add("Sortable", c.Sortable);
            dict.Add("SortName", c.SortName);
            dict.Add("Text", c.Text);
            dict.Add("Visible", c.Visible);
            dict.Add("Width", c.Width);
            return(dict);
        }
Пример #6
0
        public override DFDictionary Get(FormM form, DFDictionary entity, ref string message)
        {
            try
            {
                var dict = new DFDictionary();
                if (!string.IsNullOrWhiteSpace(entity["RoleId"]))
                {
                    using (var db = Pub.DB)
                    {
                        var sql  = "select * from WF_M_ROLE where RoleId=@RoleId";
                        var item = db.Query <WF_M_ROLE>(sql, new { RoleId = entity["RoleId"] }).FirstOrDefault();
                        if (null != item)
                        {
                            dict.Merge(DFDictionary.Create <WF_M_ROLE>(item));
                        }

                        // 载入权限
                        sql = "select * from WF_M_AUTH_MODULE where RoleId=@RoleId";
                        var list1 = db.Query <WF_M_AUTH_MODULE>(sql, new { RoleId = entity["RoleId"] }).ToList();
                        dict.Add("DF_TREE_VIEWSTATE1", Base64StringHelper.ConvertToBase64String(JsonSerializeHelper.SerializeObject(
                                                                                                    list1.Select(a => new WFTreeNode {
                            id = a.ModuleId, _checked = true, expanded = true
                        }))));

                        sql = "select * from WF_M_AUTH_DATA where RoleId=@RoleId";
                        var list2 = db.Query <WF_M_AUTH_DATA>(sql, new { RoleId = entity["RoleId"] }).ToList();
                        dict.Add("DF_TREE_VIEWSTATE2", Base64StringHelper.ConvertToBase64String(JsonSerializeHelper.SerializeObject(
                                                                                                    list2.Select(a => new WFTreeNode {
                            id = a.DeptId, _checked = true, expanded = true
                        }))));
                    }
                }
                return(dict);
            }
            catch (Exception ex)
            {
                message = ex.Message;
                return(null);
            }
        }
        public override int Update(FormM form, DFDictionary entity, ref string message)
        {
            //线径信息填写

            var list = base.GetGridClientData <SM_T_PROCESS_QUALITY>(entity, "grid1");

            //if (list.Count == 0)
            //{
            //    throw new WFException("没有为订单分配周转箱");
            //}
            base.Delete("delete from  SM_T_PROCESS_QUALITY where InstanceId=@InstanceId", new { InstanceId = entity["InstanceId"] });

            foreach (var l in list)
            {
                var dEntity = new DFDictionary();
                dEntity = l.ToDFDictionary();
                dEntity.Add("InstanceId", entity["InstanceId"]);



                CheckData("SM_T_PROCESS_QUALITY", dEntity, CurrentUserName);

                SaveData("SM_T_PROCESS_QUALITY", dEntity, IMPORT_TYPE_INSERT);
            }

            message = "保存成功";
            var sb = new System.Text.StringBuilder(DFPub.DF_SCRIPT);

            sb.AppendFormat("alert('保存成功');");
            sb.AppendFormat("closeSelfDialog();");
            message = sb.ToString();
            return(DFPub.EXECUTE_SUCCESS);
            //if (string.IsNullOrWhiteSpace(entity["EditMode"]))
            //{
            //    return Insert(form, entity, ref message);
            //}
            //var oldEntity = Get(GetSelectSql(TableName), GetParam(entity));
            //if (oldEntity == null)
            //{
            //    throw new WFException("要更新的记录不存在".GetRes());
            //}
            //CheckInput(form, entity);
            //var newEntity = oldEntity.ToDFDictionary().Merge(entity);

            //CheckData(TableName, newEntity, CurrentUserName);
            //using (var db = Pub.DB)
            //{
            //    db.Update<SM_T_PROCESS_QUALITY>(newEntity.To<SM_T_PROCESS_QUALITY>());
            //}
            //message = "保存成功";
            //return DFPub.EXECUTE_SUCCESS;
        }
        private static void CloneInstance(DFDictionary entity, string instanceId)
        {
            var SourceInstanceId = entity["SourceInstanceId"];
            var model            = WFDA.Instance.GetModelByInstanceId(instanceId);

            if (model == null)
            {
                throw new WFException(string.Format("根据工作流实例编号 {0} 不能找到对应的工作流模型定义", instanceId));
            }
            var f  = DFPub.GetFormM(model.DFFormName);
            var da = NinjectHelper.Get <IDA>(f.DAImp);

            if (da == null)
            {
                throw new WFException(string.Format("根据 {0} 不能创建 IDA 接口", f.DAImp));
            }
            var d = new DFDictionary();

            d.Add("SourceInstanceId", SourceInstanceId);
            d.Add("InstanceId", instanceId);
            var msg = string.Empty;

            (da as BaseDA).CloneData(f, d, ref msg);
        }
Пример #9
0
        private DFDictionary ClientReport(DFDictionary dict)
        {
            FormM        form   = null;
            DFDictionary entity = null;

            DFPub.SetDBEntity(dict, ref form, ref entity);
            var ret     = new DFDictionary();
            var message = string.Empty;
            var da      = NinjectHelper.Get <IDA>(form.DAImp);

            try
            {
                if (null == da)
                {
                    throw new Exception("Invalid DAImp");
                }
                if (da.Update(form, entity, ref message) != 0)
                {
                    ret.Add("hasError", "true");
                }
                var baseDA = (BaseDA)da;
                ret.Add("Debug", entity["Debug"]);
                ret.Add("ReportName", Path.GetFileName(baseDA.ReportPath));
                ret.Add("UploadFileUrl", baseDA.GetUrlFolder() + "/kindeditor/asp.net/upload_json.ashx");
                ret.Add("ReportUrl", baseDA.GetUrlRoot() + DFPub.PhysicalToRelative(baseDA.ReportPath));
                if (baseDA.ReportDataSource != null)
                {
                    ret.Add("ReportDataSource", Convert.ToBase64String(SerializeHelper.DataSetSerializer(baseDA.ReportDataSource)));
                }
                ret.Add("error", message);
                m_log.Debug(JsonSerializeHelper.SerializeObject(ret));
            }
            catch (Exception ex)
            {
                ret.Add("hasError", "true");
                ret.Add("error", ex.Message);
                m_log.Error(ex.Message, ex);
            }
            return(ret);
        }
Пример #10
0
        public override void SetAccess(FormM form, DFDictionary entity)
        {
            var path    = DFPub.RelativeToPhysical(entity["ConfigFile"]);
            var configs = GetTableConfig(path);

            SetSelectDataSource(form, "TableName", configs.Select(a => new DFSelectItem(a.TableName, a.TableName)).ToList());

            if (string.IsNullOrWhiteSpace(entity["TableName"]))
            {
                entity.Add("TableName", configs.FirstOrDefault().TableName);
            }

            if (!IsPostBack() || GetPostbackControl(entity) == "TableName")
            {
                var t = configs.FirstOrDefault(a => a.TableName == entity["TableName"]);
                if (t != null)
                {
                    this.Model.Add("ImportType", t.ImportType);
                    this.Model.Add("Insert", t.Insert);
                    this.Model.Add("Update", t.Update);
                    this.Model.Add("CheckExist", t.CheckExist);
                }
            }
        }
        public override DFDictionary Get(FormM form, DFDictionary entity, ref string message)
        {
            var dict = new DFDictionary();
            var f    = SessionHelper.Get <FormM>("f");
            // Panel|0|Row|0|Control|0
            var _Path = entity["_Path"];
            var ss    = _Path.Split('|');
            var c     = f.Panels[int.Parse(ss[1])].Rows[int.Parse(ss[3])].Controls[int.Parse(ss[5])];

            dict.Add("Action", c.Action);
            dict.Add("AddEmptyOption", c.AddEmptyOption);
            dict.Add("AfterScript", c.AfterScript);
            dict.Add("AutoPostBack", c.AutoPostBack);
            dict.Add("ControlAttributes", c.ControlAttributes);
            dict.Add("CustomHtml", c.CustomHtml);
            dict.Add("LabelAttributes", c.LabelAttributes);
            dict.Add("MustInput", c.MustInput);
            dict.Add("Name", c.Name);
            dict.Add("Options", c.Options);
            dict.Add("OptionType", c.OptionType);
            dict.Add("OuterAttributes", c.OuterAttributes);
            dict.Add("Text", c.Text);
            dict.Add("Type", c.Type);
            dict.Add("Value", c.Value);
            dict.Add("Width", c.Width);
            return(dict);
        }
Пример #12
0
        public override DFDictionary Get(FormM form, DFDictionary entity, ref string message)
        {
            var dict = new DFDictionary();
            var f    = SessionHelper.Get <FormM>("f");
            // Panel|0
            var _Path = entity["_Path"];
            var ss    = _Path.Split('|');
            var c     = f.Panels[int.Parse(ss[1])];

            dict.Add("Additional", c.Additional);
            dict.Add("AfterHtml", c.AfterHtml);
            dict.Add("AfterScript", c.AfterScript);
            dict.Add("BeforeHtml", c.BeforeHtml);
            dict.Add("PanelDesc", c.PanelDesc);
            dict.Add("PanelId", c.PanelId);
            dict.Add("PanelName", c.PanelName);
            dict.Add("PanelPlugins", c.PanelPlugins);
            dict.Add("PanelType", c.PanelType);
            dict.Add("Position", c.Position);
            dict.Add("TabContainer", c.TabContainer);
            dict.Add("ToolbarScript", c.ToolbarScript);
            return(dict);
        }