Пример #1
0
        public FrmPrintTT_SOCTHDA_HDDT(bool isND51)
        {
            InitializeComponent();
            SmLib.SysFunc.LoadIcon(this);
            GridSearch.LocalSysObj = StartUp.SysObj;
            IsND51 = isND51;
            if (isND51)
            {
                GridSearch.ReportGroupName = StartUp.DsTrans.Tables[0].DefaultView[0]["ma_file"].ToString();
            }
            else
            {
                GridSearch.ReportGroupName = StartUp.CommandInfo["rep_file"].ToString();
            }
            GridSearch.XGReport.RecordActivated += new EventHandler <Infragistics.Windows.DataPresenter.Events.RecordActivatedEventArgs>(XGReport_RecordActivated);

            if (BindingSysObj.GetOption("M_LAN").ToString().Equals("V"))
            {
                btnExport.Content = BindingSysObj.GetSysVar("M_EXPORT_SIGN").ToString();
            }
            else
            {
                btnExport.Content = BindingSysObj.GetSysVar2("M_EXPORT_SIGN").ToString();
            }
        }
Пример #2
0
        public string GetNewSoct(string ma_qs)
        {
            string cmd;
            int    M_AUTO_SOCT = Convert.ToInt16(BindingSysObj.GetOption("M_AUTO_SOCT").ToString());

            switch (M_AUTO_SOCT)
            {
            case 1:
                cmd = "SELECT transform, so_ct + 1 as so_ct FROM dmqs WHERE ma_qs = '" + ma_qs.Trim() + "'";
                break;

            default:
                cmd = cmd = "EXEC  [GetNewSoct] '" + ma_qs.Trim() + "'";
                break;
            }
            DataTable tbTmp = BindingSysObj.ExcuteReader(new SqlCommand(cmd)).Tables[0];

            if (tbTmp.Rows.Count > 0)
            {
                DataRow row = tbTmp.Rows[0];
                if (row[1] != null && row[1] != DBNull.Value)
                {
                    string so_ct_new = row[1].ToString();
                    return(string.Format(row[0].ToString(), Convert.ToDouble(so_ct_new)));
                }
            }
            return("");
        }