Пример #1
0
 private void comboBoxEdit1_Properties_Click(object sender, EventArgs e)
 {
     frmDykSelector dlg = new frmDykSelector();
     PJ_dyk dyk = null;
     PJ_dyk parentObj = Client.ClientHelper.PlatformSqlMap.GetOne<PJ_dyk>("where dx='23配电线路产权维护范围协议书' and sx='维护界限划分原则' and parentid=''");
     if (parentObj != null)
     {
         dlg.ucpJ_dykSelector1.ParentObj = parentObj;
         //dlg.TxtMemo = txt;
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             comboBoxEdit1.Text = dlg.ucpJ_dykSelector1.GetSelectedRow().nr4;
         }
     }
     //frmCqSelector fcs = new frmCqSelector();
     //if (fcs.ShowDialog()==DialogResult.OK)
     //{
     //    comboBoxEdit1.Text = fcs.dynr;
     //}
 }
Пример #2
0
 /// <summary>
 /// 显示短语库选择器		
 /// </summary>
 /// <param name="dx">记录表中文名,要和短语库对上,否则没有记录</param>
 /// <param name="sx">属性中文名</param>
 /// <returns></returns>
 public static void SelectSDDyk(string dx, string sx, MemoEdit txt)
 {
     //2011.06.20 rabbit edit 
     //2011.10.23 胡建林 edit 
     frmDykSelector dlg = new frmDykSelector();
     PJ_dyk parentObj = Client.ClientHelper.PlatformSqlMap.GetOne<PJ_dyk>(string.Format("where dx='{0}' and sx='{1}' and parentid=''", dx, sx));
     if (parentObj != null)
     {
         dlg.ucpJ_dykSelector1.ParentObj = parentObj;
         if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             txt.EditValue = dlg.ucpJ_dykSelector1.GetSelectedRow().nr;
         }
     }
     else
     {
         MsgBox.ShowWarningMessageBox("短语库中没有找到 记录表中文名为 " + dx + " 属性为 " + sx + " 的记录");
     }
 }
Пример #3
0
 private void comboBoxEdit10_Properties_Click(object sender, EventArgs e) {
     frmDykSelector dlg = new frmDykSelector();
     PJ_dyk dyk = null;
     PJ_dyk parentObj = Client.ClientHelper.PlatformSqlMap.GetOne<PJ_dyk>("where dx='台区' and sx='运行班次' and parentid=''");
     if (parentObj != null) {
         dlg.ucpJ_dykSelector1.ParentObj = parentObj;
         // dlg.TxtMemo = txt;
         if (dlg.ShowDialog() == DialogResult.OK) {
             comboBoxEdit10.Text = dlg.ucpJ_dykSelector1.GetSelectedRow().nr;
         }
     }
 }
Пример #4
0
        /// <summary>
        /// 多级短语时使用此方法
        /// </summary>
        /// <param name="dx"></param>
        /// <param name="sx"></param>
        /// <param name="txt">最多4级</param>
        /// <returns></returns>
        public static PJ_dyk SelectSDDyk(string dx, string sx, params TextEdit[] txt)
        {
            frmDykSelector dlg = new frmDykSelector();
            PJ_dyk dyk = null;
            PJ_dyk parentObj = Client.ClientHelper.PlatformSqlMap.GetOne<PJ_dyk>(string.Format("where dx='{0}' and sx='{1}' and parentid=''", dx, sx));
            if (parentObj != null)
            {
                dlg.ucpJ_dykSelector1.ParentObj = parentObj;

                if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {

                    dyk = dlg.ucpJ_dykSelector1.GetSelectedRow();
                    int len = txt.Length > 4 ? 4 : txt.Length;
                    for (int i = 0; i < len; i++)
                    {
                        if (i == 0)
                            txt[i].EditValue = dyk.nr;
                        else if (i == 1)
                            txt[i].EditValue = dyk.nr2;
                        else if (i == 2)
                            txt[i].EditValue = dyk.nr3;
                        else if (i == 3)
                            txt[i].EditValue = dyk.nr4;
                    }
                }
            }
            return dyk;
        }