Esempio n. 1
0
        protected virtual bool AJAX_Delete(string strObjectID)
        {
            bool boolReturn = false;

            try
            {
                T_PM_UserGroupInfoApplicationLogic instanceT_PM_UserGroupInfoApplicationLogic
                    = (T_PM_UserGroupInfoApplicationLogic)CreateApplicationLogicInstance(typeof(T_PM_UserGroupInfoApplicationLogic));
                T_PM_UserGroupInfoApplicationData appData = new T_PM_UserGroupInfoApplicationData();
                appData.OPCode   = ApplicationDataBase.OPType.ID;
                appData.ObjectID = strObjectID;
                appData          = instanceT_PM_UserGroupInfoApplicationLogic.Query(appData);
                if (appData.RecordCount > 0)
                {
                    appData = instanceT_PM_UserGroupInfoApplicationLogic.Delete(appData);
                    if (appData.ResultCode == ApplicationDataBase.ResultState.Succeed)
                    {
                        boolReturn = true;
                    }
                    else
                    {
                        boolReturn = false;
                    }
                }
                else
                {
                    boolReturn = false;
                }
            }
            catch (Exception)
            {
                boolReturn = false;
            }
            return(boolReturn);
        }
Esempio n. 2
0
        protected virtual string AJAX_QueryDataSet(string strFieldName, string strFieldValue)
        {
            string strReturn = string.Empty;

            try
            {
                T_PM_UserGroupInfoApplicationLogic instanceT_PM_UserGroupInfoApplicationLogic
                    = (T_PM_UserGroupInfoApplicationLogic)CreateApplicationLogicInstance(typeof(T_PM_UserGroupInfoApplicationLogic));
                T_PM_UserGroupInfoApplicationData appData = new T_PM_UserGroupInfoApplicationData();
                appData.Sort        = false;
                appData.SortField   = "ObjectID";
                appData.PageSize    = 10;
                appData.CurrentPage = 1;
                appData.OPCode      = ApplicationDataBase.OPType.ALL;
                switch (strFieldName)
                {
                case "ObjectID":
                    appData.ObjectID = Convert.ToString(strFieldValue);
                    break;

                case "UserGroupID":
                    appData.UserGroupID = Convert.ToString(strFieldValue);
                    break;

                case "UserGroupName":
                    appData.UserGroupName = Convert.ToString(strFieldValue);
                    break;

                case "UserGroupContent":
                    appData.UserGroupContent = Convert.ToString(strFieldValue);
                    break;

                case "UserGroupRemark":
                    appData.UserGroupRemark = Convert.ToString(strFieldValue);
                    break;

                case "DefaultPage":
                    appData.DefaultPage = Convert.ToString(strFieldValue);
                    break;

                case "UpdateDate":
                    appData.UpdateDate = Convert.ToDateTime(strFieldValue);
                    break;

                default:
                    appData.PageSize = 0;
                    break;
                }
                appData = instanceT_PM_UserGroupInfoApplicationLogic.Query(appData);
                if (appData.RecordCount > 0)
                {
                    strReturn = appData.ResultSet.GetXml();
                }
            }
            catch (Exception)
            {
                strReturn = string.Empty;
            }
            return(strReturn);
        }
Esempio n. 3
0
        protected virtual void CountAnyField()
        {
            T_PM_UserGroupInfoApplicationLogic instanceT_PM_UserGroupInfoApplicationLogic
                = (T_PM_UserGroupInfoApplicationLogic)CreateApplicationLogicInstance(typeof(T_PM_UserGroupInfoApplicationLogic));

            appData = instanceT_PM_UserGroupInfoApplicationLogic.Count(appData);
        }
Esempio n. 4
0
 protected virtual void QueryRecord()
 {
     if (GetQueryInputParameter())
     {
         T_PM_UserGroupInfoApplicationLogic instanceT_PM_UserGroupInfoApplicationLogic
                 = (T_PM_UserGroupInfoApplicationLogic)CreateApplicationLogicInstance(typeof(T_PM_UserGroupInfoApplicationLogic));
         appData = instanceT_PM_UserGroupInfoApplicationLogic.Query(appData);
     }
     else
     {
         // 对错误消息进行处理
         MessageContent = strMessageInfo;
         Session[ConstantsManager.SESSION_MESSAGE_TYPE] = "FaildPre";
     }
 }
Esempio n. 5
0
 protected virtual void ModifyRecord()
 {
     if (GetModifyInputParameter())
     {
         T_PM_UserGroupInfoApplicationLogic instanceT_PM_UserGroupInfoApplicationLogic
             = (T_PM_UserGroupInfoApplicationLogic)CreateApplicationLogicInstance(typeof(T_PM_UserGroupInfoApplicationLogic));
         // 主表修改
         appData = instanceT_PM_UserGroupInfoApplicationLogic.Modify(appData);
         // 相关表批量修改
         RelatedTableModifyBatch();
         MessageContent = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0015, new string[] { "用户组信息", "修改" }, strMessageInfo);
         string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0003, new string[] { (string)Session[ConstantsManager.SESSION_USER_LOGIN_NAME], "用户组信息", appData.UserGroupName.ToString(), "修改" });
         LogLibrary.LogWrite("A02", strLogContent, null, null, null);
         Page.CloseWindow(true);
     }
 }
Esempio n. 6
0
    protected void btnInfoFromDocBatch_Click(object sender, EventArgs e)
    {
        DataTable dt = new DataTable();

        dt = GetTemplateColumn(dt);
        dt = FileLibrary.GetDataFromWordBatch(ConstantsManager.WEBSITE_VIRTUAL_ROOT_DIR + "/" + ConstantsManager.UPLOAD_DOC_DIR + "/" + "T_PM_UserGroupInfo", dt, true, true);
        T_PM_UserGroupInfoApplicationLogic instanceT_PM_UserGroupInfoApplicationLogic = (T_PM_UserGroupInfoApplicationLogic)CreateApplicationLogicInstance(typeof(T_PM_UserGroupInfoApplicationLogic));

        foreach (DataRow dr in dt.Rows)
        {
            appData = new T_PM_UserGroupInfoApplicationData();

            int i = 0;

            appData = instanceT_PM_UserGroupInfoApplicationLogic.Add(appData);
        }
    }
Esempio n. 7
0
 protected virtual void DeleteRecord()
 {
     if (GetDeleteInputParameter())
     {
         T_PM_UserGroupInfoApplicationLogic instanceT_PM_UserGroupInfoApplicationLogic
                 = (T_PM_UserGroupInfoApplicationLogic)CreateApplicationLogicInstance(typeof(T_PM_UserGroupInfoApplicationLogic));
         appData = instanceT_PM_UserGroupInfoApplicationLogic.Delete(appData);
         string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0003, new string[] { (string)Session[ConstantsManager.SESSION_USER_LOGIN_NAME], "用户组信息", (string)appData.ObjectIDBatch, "删除" });
         LogLibrary.LogWrite("A02", strLogContent, null, null, null);
     }
     else
     {
         // 对错误消息进行处理
         MessageContent = strMessageInfo;
         Session[ConstantsManager.SESSION_MESSAGE_TYPE] = "FaildPre";
     }
 }
Esempio n. 8
0
 protected virtual void AddRecord()
 {
     if (GetAddInputParameter())
     {
         T_PM_UserGroupInfoApplicationLogic instanceT_PM_UserGroupInfoApplicationLogic
             = (T_PM_UserGroupInfoApplicationLogic)CreateApplicationLogicInstance(typeof(T_PM_UserGroupInfoApplicationLogic));
         // 添加主表
         appData = instanceT_PM_UserGroupInfoApplicationLogic.Add(appData);
         // 批量添加相关表
         RelatedTableAddBatch();
         if (appData.ResultCode == ApplicationDataBase.ResultState.Succeed)
         {
             MessageContent = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0015, new string[] { "用户组信息", "添加" }, strMessageInfo);
             string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0003, new string[] { (string)Session[ConstantsManager.SESSION_USER_LOGIN_NAME], "用户组信息", appData.UserGroupName.ToString(), "添加" });
             LogLibrary.LogWrite("A02", strLogContent, null, null, null);
             Page.CloseWindow(true);
         }
         else
         {
             MessageContent = MessageManager.GetMessageInfo(MessageManager.ERR_MSGID_0013, new string[] { "此编号", "用户组信息" }, strMessageInfo);
             Session[ConstantsManager.SESSION_MESSAGE_TYPE] = "FaildPre";
         }
     }
 }
Esempio n. 9
0
    protected void btnInfoFromDS_Click(object sender, EventArgs e)
    {
        int totalCount  = 0;
        int importCount = 0;
        int updateCount = 0;

        try
        {
            var appDatas = T_PM_UserGroupInfoApplicationData.GetDataFromDataFile <T_PM_UserGroupInfoApplicationData>(InfoFromDoc.Text, true, true, recordStartLine: T_PM_UserGroupInfoContants.ImportDataSetStartLineNum);
            T_PM_UserGroupInfoApplicationLogic instanceT_PM_UserGroupInfoApplicationLogic = (T_PM_UserGroupInfoApplicationLogic)CreateApplicationLogicInstance(typeof(T_PM_UserGroupInfoApplicationLogic));
            totalCount = appDatas.Count;
            foreach (var app in appDatas)
            {
                if (!UserGroupID.Text.IsHtmlNullOrWiteSpace())
                {
                    app.UserGroupID = Convert.ToString(UserGroupID.Text);
                }

                if (!UserGroupName.Text.IsHtmlNullOrWiteSpace())
                {
                    app.UserGroupName = Convert.ToString(UserGroupName.Text);
                }

                if (!UserGroupContent.Text.IsHtmlNullOrWiteSpace())
                {
                    app.UserGroupContent = Convert.ToString(UserGroupContent.Text);
                }

                if (!UserGroupRemark.Text.IsHtmlNullOrWiteSpace())
                {
                    app.UserGroupRemark = Convert.ToString(UserGroupRemark.Text);
                }

                if (!DefaultPage.Text.IsHtmlNullOrWiteSpace())
                {
                    app.DefaultPage = Convert.ToString(DefaultPage.Text);
                }

                app.UpdateDate = DateTime.Now;
                instanceT_PM_UserGroupInfoApplicationLogic.Add(app);
                if (app.ResultCode == RICH.Common.Base.ApplicationData.ApplicationDataBase.ResultState.Succeed)
                {
                    importCount++;
                }
                else
                {
                    app.OPCode = RICH.Common.Base.ApplicationData.ApplicationDataBase.OPType.PK;
                    instanceT_PM_UserGroupInfoApplicationLogic.Modify(app);
                    if (app.ResultCode == RICH.Common.Base.ApplicationData.ApplicationDataBase.ResultState.Succeed)
                    {
                        updateCount++;
                    }
                }
            }
            MessageContent += @"<font color=""green"">共{0}条数据,导入数据{1}条,更新数据{2}条。</font>".FormatInvariantCulture(totalCount, importCount, updateCount);
        }
        catch (Exception ex)
        {
            MessageContent += @"<font color=""red"">导入数据过程出错:{0}<br/>共{1}条数据,已导入数据{2}条,已更新数据{3}条。</font>".FormatInvariantCulture(ex.Message, totalCount, importCount, updateCount);
        }
    }
Esempio n. 10
0
        protected virtual bool AJAX_Modify(string strFieldName, string strFieldValue, string strObjectID)
        {
            bool boolReturn = false;

            try
            {
                T_PM_UserGroupInfoApplicationLogic instanceT_PM_UserGroupInfoApplicationLogic
                    = (T_PM_UserGroupInfoApplicationLogic)CreateApplicationLogicInstance(typeof(T_PM_UserGroupInfoApplicationLogic));
                T_PM_UserGroupInfoApplicationData appData = new T_PM_UserGroupInfoApplicationData();
                appData.OPCode   = ApplicationDataBase.OPType.ID;
                appData.ObjectID = strObjectID;
                appData          = instanceT_PM_UserGroupInfoApplicationLogic.Query(appData);
                if (appData.RecordCount > 0)
                {
                    switch (strFieldName)
                    {
                    case "ObjectID":
                        appData.ObjectID = Convert.ToString(strFieldValue);
                        break;

                    case "UserGroupID":
                        appData.UserGroupID = Convert.ToString(strFieldValue);
                        break;

                    case "UserGroupName":
                        appData.UserGroupName = Convert.ToString(strFieldValue);
                        break;

                    case "UserGroupContent":
                        appData.UserGroupContent = Convert.ToString(strFieldValue);
                        break;

                    case "UserGroupRemark":
                        appData.UserGroupRemark = Convert.ToString(strFieldValue);
                        break;

                    case "DefaultPage":
                        appData.DefaultPage = Convert.ToString(strFieldValue);
                        break;

                    case "UpdateDate":
                        appData.UpdateDate = Convert.ToDateTime(strFieldValue);
                        break;
                    }
                    appData = instanceT_PM_UserGroupInfoApplicationLogic.Modify(appData);
                    if (appData.ResultCode == ApplicationDataBase.ResultState.Succeed)
                    {
                        boolReturn = true;
                    }
                    else
                    {
                        boolReturn = false;
                    }
                }
                else
                {
                    boolReturn = false;
                }
            }
            catch (Exception)
            {
                boolReturn = false;
            }
            return(boolReturn);
        }