Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnExcel_Click(object sender, EventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.Filter = "Excel文件|*.xls";

            if (sfd.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    DisplayTips("正在导出数据集......");

                    string fileName = sfd.FileName;

                    if (!fileName.EndsWith(".xls"))
                    {
                        fileName += ".xls";
                    }

                    this.c1FlexGridDataset.SaveGrid(fileName, FileFormatEnum.Excel, FileFlags.IncludeFixedCells);

                    CloseTips();

                    CommonFunctions.MsgInfo("文件" + fileName + "保存成功!!!");
                }
                catch (Exception ex)
                {
                    CloseTips();
                    CommonFunctions.MsgError("导出数据集失败,失败原因:" + ex.Message);
                }
            }
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnClearCompare_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("你真的要清除已对照标志吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk);

            if (dr == DialogResult.Yes)
            {
                string SQLString = string.Format(@"UPDATE  HIS_InterfaceHN.dbo.Interface_AddMatch
                                                    SET     CompareStatus = 2");

                try
                {
                    int temp = Alif.DBUtility.DbHelperSQL.ExecuteSql(SQLString);

                    if (temp > 0)
                    {
                        CommonFunctions.MsgInfo("清除已对照记录成功,清除已对照记录" + temp + "条!!!");
                        return;
                    }
                    CommonFunctions.MsgError("没有清除任何已对照记录,请查看是否存在医院目录匹配信息!!!");
                }
                catch (Exception ex)
                {
                    CommonFunctions.MsgError("清除已对照标志发生错误,错误原因:" + ex.Message);
                }
            }
        }
Exemple #3
0
        /// <summary>
        /// 更新UI控件中的内容
        /// </summary>
        /// <param name="flag"></param>
        /// <param name="context"></param>
        public virtual void UpdateUIControlContext(object context)
        {
            Parameter parameter = (Parameter)context;

            if (parameter.Object == null)
            {
                switch (parameter.Name)
                {
                case UIMsg.Close:
                    CloseTips();
                    break;

                case UIMsg.Display:
                    DisplayTips(parameter.Value);
                    break;

                case UIMsg.MsgError:
                    CommonFunctions.MsgError(parameter.Value);
                    break;

                case UIMsg.MsgInfo:
                    CommonFunctions.MsgInfo(parameter.Value);
                    break;

                case UIMsg.WriteMsg:
                    WriteTips(parameter.Value);
                    break;

                default:
                    break;
                }
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string id   = this.txtBoxID.Text.Trim();
            string name = this.txtBoxName.Text.Trim();

            if (string.Empty == id)
            {
                CommonFunctions.MsgInfo("接口函数编码不能为空!!!");

                this.txtBoxID.Focus();

                return;
            }
            if (string.Empty == name)
            {
                CommonFunctions.MsgInfo("接口函数名称不能为空!!!");

                this.txtBoxName.Focus();

                return;
            }
            try
            {
                string SQLString = string.Empty;

                SQLString = string.Format(@"IF EXISTS ( SELECT  *
                                                FROM    HIS_InterfaceHN.dbo.Func
                                                WHERE   FuncID = '{0}' AND Name='{1}' )
                                        BEGIN
                                            RAISERROR('已经存在对应编号和名称的接口编码!!!',16,1);
                                        END
                                    ELSE
                                        BEGIN
                                            INSERT  INTO HIS_InterfaceHN.dbo.Func
                                                    ( FuncID ,
                                                        Name ,
                                                        Details
		                                            )
                                            VALUES  ( N'{0}' , -- ID - nvarchar(50)
                                                        N'{1}' , -- Name - nvarchar(50)
                                                        N''  -- Details - nvarchar(512)
		                                            )
                                        END", id, name);

                Alif.DBUtility.DbHelperSQL.ExecuteSql(SQLString);

                CommonFunctions.MsgInfo("添加成功!!!");

                this.txtBoxID.Clear();
                this.txtBoxName.Clear();

                this.txtBoxID.Focus();
            }
            catch (Exception ee)
            {
                CommonFunctions.MsgError("添加接口函数失败失败原因:" + ee.Message);
            }
        }
Exemple #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void c1FlexGridInterfaceJC_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (this._selectedC1FlexGridAddMatchRowIndex > 0 && this._selectedC1FlexGridJCCenterDirRowIndex > 0)
            {
                string addMatchID    = this.c1FlexGridAddMatch.Rows[this._selectedC1FlexGridAddMatchRowIndex]["ID"].ToString().Trim();
                string jcDirID       = this.c1FlexGridInterfaceJC.Rows[this._selectedC1FlexGridJCCenterDirRowIndex]["ID"].ToString().Trim();
                string compareStatus = this.c1FlexGridAddMatch.Rows[this._selectedC1FlexGridAddMatchRowIndex]["CompareStatus"].ToString().Trim();
                string uploadStatus  = this.c1FlexGridAddMatch.Rows[this._selectedC1FlexGridAddMatchRowIndex]["UploadStatus"].ToString().Trim();

                if ("已对照" == compareStatus && "已上传" == uploadStatus)
                {
                    return;
                }

                if ("已对照" == compareStatus)
                {
                    DialogResult dr = MessageBox.Show("你真的要更新这条已对照的匹配信息吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk);

                    if (dr != DialogResult.Yes)
                    {
                        return;
                    }
                }

                try
                {
                    DisplayTips("正在更新新增医院目录匹配信息,请稍后......");

                    IDataParameter[] parameters = new IDataParameter[2];

                    parameters[0] = new SqlParameter("@addMatchID", addMatchID);
                    parameters[1] = new SqlParameter("@CenterDirID", jcDirID);

                    Alif.DBUtility.DbHelperSQL.RunProcedure("HIS_InterfaceHN.dbo.P_UpdateAddMatch", parameters, "P_UpdateAddMatch");

                    CloseTips();

                    CommonFunctions.MsgInfo("正在更新新增医院目录匹配信息成功!!!");

                    this.btnQueryData.PerformClick();
                }
                catch (Exception ex)
                {
                    CloseTips();
                    CommonFunctions.MsgError("更新新增医院目录匹配信息错误,错误原因:" + ex.Message);
                }
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnParameterToClass_Click(object sender, EventArgs e)
        {
            List <string> listParameterName = new List <string>();

            string datasetName = "入参";

            if (!this.c1FlexGridPara.Cols.Contains("参数说明"))
            {
                CommonFunctions.MsgError("没有任何入参,不能生成类!!!");
            }

            for (int i = 1; i < this.c1FlexGridPara.Rows.Count; i++)
            {
                string temp = this.c1FlexGridPara.Rows[i]["参数说明"].ToString().Trim();

                if (temp != datasetName)
                {
                    datasetName = temp;

                    listParameterName.Add(datasetName);
                }
            }

            if (listParameterName.Count <= 0)
            {
                CommonFunctions.MsgError("没有任何参数,将不生成任何参数对应的类!!!");
                return;
            }

            foreach (string dataset in listParameterName)
            {
                StringBuilder sb = new StringBuilder();

                string tempParameterName = dataset;

                tempParameterName = this.lblID.Text.Trim() + "_Parameter" + "_" + tempParameterName;

                sb.AppendLine("public class " + tempParameterName);
                sb.AppendLine("{");
                sb.AppendLine("#region 属性");
                sb.AppendLine();

                for (int i = 1; i < this.c1FlexGridPara.Rows.Count; i++)
                {
                    string temp = this.c1FlexGridPara.Rows[i]["参数说明"].ToString().Trim();

                    if (dataset == temp)
                    {
                        string des  = this.c1FlexGridPara.Rows[i]["入参说明"].ToString().Trim();
                        string name = this.c1FlexGridPara.Rows[i]["入参"].ToString().Trim();

                        sb.AppendLine(string.Format("[Description(\"{0}\")]", des));
                        sb.AppendLine("public string " + name + " { get; set; }");
                        sb.AppendLine();
                    }
                }

                sb.AppendLine("#endregion");
                sb.AppendLine();

                sb.AppendLine("/// <summary>");
                sb.AppendLine("/// 设置属性值");
                sb.AppendLine("/// </summary>");
                sb.AppendLine("/// <param name=\"name\">名称</param>");
                sb.AppendLine("/// <param name=\"value\">值</param>");
                sb.AppendLine("public void SetAttributeValue(string name, string value)");
                sb.AppendLine("{");
                sb.AppendLine("switch (name)");
                sb.AppendLine("{");

                for (int i = 1; i < this.c1FlexGridPara.Rows.Count; i++)
                {
                    string temp = this.c1FlexGridPara.Rows[i]["参数说明"].ToString().Trim();

                    if (dataset == temp)
                    {
                        string name = this.c1FlexGridPara.Rows[i]["入参"].ToString().Trim();
                        string des  = this.c1FlexGridPara.Rows[i]["入参说明"].ToString().Trim();

                        sb.AppendLine(string.Format("case \"{0}\"://{1}", name, des));
                        sb.AppendLine(string.Format("this.{0} = value;", name));
                        sb.AppendLine("break;");
                    }
                }

                sb.AppendLine("default:");
                sb.AppendLine("break;");
                sb.AppendLine("}");
                sb.AppendLine("}");
                sb.AppendLine("}");

                string filePath = Application.StartupPath + "\\ToClass";

                if (!System.IO.Directory.Exists(filePath))
                {
                    System.IO.Directory.CreateDirectory(filePath);
                }

                filePath = System.IO.Path.Combine(filePath, tempParameterName + ".cs");

                System.IO.StreamWriter sw = new System.IO.StreamWriter(filePath, true);
                sw.WriteLine(sb.ToString());
                sw.Close();
                sw.Dispose();
            }

            CommonFunctions.MsgInfo("生成参数对应的类成功,一共生成了" + listParameterName.Count + "个文件!!!");
        }