Пример #1
0
        public static bool Delete(string Code)
        {
            StringBuilder Sql_Select = new StringBuilder();

            //增加查询条件Scdel=0   2013-10-19
            Sql_Select.Append("Select * From sys_biz_Sheet Where Scdel=0 and CatlogCode like '");
            Sql_Select.Append(Code);
            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)
            {
                foreach (DataRow Row in Data.Rows)
                {
                    String             Index         = Row["ID"].ToString();
                    SheetConfiguration Configuration = DepositorySheetConfiguration.InitConfiguration(Index);
                    DepositorySheetConfiguration.Delete(Configuration);
                }
            }
            //增加字段Scts_1,Scdel 之后 删除操作只做伪删除,便于数据同步     2013-10-15
            StringBuilder Sql_Delete = new StringBuilder();

            //Sql_Delete.Append("Delete From sys_biz_SheetCatlog Where CatlogCode like '");
            //Sql_Delete.Append(Code);
            //Sql_Delete.Append("%'");
            Sql_Delete.Append("Update sys_biz_SheetCatlog Set Scts_1='" + DateTime.Now + "',Scdel=1");
            Sql_Delete.Append(" Where CatlogCode like '");
            Sql_Delete.Append(Code);
            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);
        }
Пример #2
0
        private void ConditionItemSelector_Load(object sender, EventArgs e)
        {
            String ErrorInfo = "";

            ProgressScreen.Current.ShowSplashScreen();
            this.AddOwnedForm(ProgressScreen.Current);

            try
            {
                SheetInfo = DepositorySheetConfiguration.InitConfiguration(SheetIndex);

                ProgressScreen.Current.SetStatus = "正在初始化表单‘" + SheetInfo.Description + "’";

                fpSpread1.Sheets.Clear();
                SheetView SheetView = Serializer.LoadObjectXml(typeof(SheetView), SheetInfo.SheetStyle, "SheetView") as SheetView;
                SheetView.SheetName     = SheetInfo.Description;
                SheetView.OperationMode = OperationMode.ReadOnly;
                fpSpread1.Sheets.Add(SheetView);

                if (SheetInfo.DataTableSchema.Schema != null)
                {
                    foreach (FieldDefineInfo field in SheetInfo.DataTableSchema.Schema.FieldInfos)
                    {
                        SheetView.Cells[field.RangeInfo].BackColor = Color.LightPink;
                        SheetView.Cells[field.RangeInfo].Tag       = field;
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorInfo = ex.Message;
            }

            this.RemoveOwnedForm(ProgressScreen.Current);
            ProgressScreen.Current.CloseSplashScreen();
            Activate();

            if (ErrorInfo != "")
            {
                MessageBox.Show("加载表单出错!\r\n原因:" + ErrorInfo, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }