Example #1
0
        public static Boolean DeleteReportFormats(FormatString String)
        {
            StringBuilder Sql_Delete = new StringBuilder();

            Sql_Delete.Append("Delete From sys_biz_ModuleFormatStrings Where FormatString ='");
            Sql_Delete.Append(String.FormatValue);
            Sql_Delete.Append("'");

            Boolean Result = false;

            try
            {
                object r = Agent.CallService("Yqun.BO.LoginBO.dll", "ExcuteCommand", new object[] { Sql_Delete.ToString() });
                Result = (Convert.ToInt32(r) == 1);
            }
            catch
            { }

            return(Result);
        }
Example #2
0
        public static Boolean UpdateReportFormats(FormatString String)
        {
            StringBuilder Sql_Select = new StringBuilder();

            Sql_Select.Append("Select ID,FormatStyle,FormatString From sys_biz_ModuleFormatStrings Where ID='");
            Sql_Select.Append(String.Index);
            Sql_Select.Append("'");

            DataTable Data = Agent.CallService("Yqun.BO.LoginBO.dll", "GetDataTable", new object[] { Sql_Select.ToString() }) as DataTable;

            if (Data != null && Data.Rows.Count > 0)
            {
                DataRow Row = Data.Rows[0];
                Row["ID"]           = String.Index;
                Row["FormatStyle"]  = String.FormatStyle;
                Row["FormatString"] = String.FormatValue;
            }
            else
            {
                DataRow Row = Data.NewRow();
                Row["ID"]           = String.Index;
                Row["FormatStyle"]  = String.FormatStyle;
                Row["FormatString"] = String.FormatValue;
                Data.Rows.Add(Row);
            }

            Boolean Result = false;

            try
            {
                object r = Agent.CallService("Yqun.BO.LoginBO.dll", "Update", new object[] { Data });
                Result = (Convert.ToInt32(r) == 1);
            }
            catch
            { }

            return(Result);
        }
Example #3
0
        private void Button_Delete_Click(object sender, EventArgs e)
        {
            FormatString      fs  = (FormatString)lBox_FormatString.SelectedItem;
            FormatStringGroup Fsg = Groups[rButton_Style];

            if (fs != null)
            {
                if (DialogResult.Yes == MessageBox.Show("确定删除格式串 ‘" + fs.FormatValue + "’ 吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information))
                {
                    DepositoryReportFormat.DeleteReportFormats(fs);
                    lBox_FormatString.Items.Remove(lBox_FormatString.SelectedItem);
                    Fsg.FormatStrings.Remove(fs);
                    if (lBox_FormatString.Items.Count > 0)
                    {
                        lBox_FormatString.SelectedIndex = 0;
                    }
                    else
                    {
                        tBox_FormatString.Text = "";
                    }
                }
            }
        }