Exemple #1
0
        /// <summary>
        /// 保存事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            WaitDialogForm waitForm = new WaitDialogForm("正在批量保存数据...", "请稍等");

            try
            {
                string    messageAll  = "";
                bool      hasSave     = true;
                DataTable dataTablePL = gridControl1.DataSource as DataTable;
                if (dataTablePL == null || dataTablePL.Rows.Count <= 0)
                {
                    return;
                }
                foreach (DataRow item in dataTablePL.Rows)
                {
                    if ((bool)item["check"] != true)
                    {
                        continue;
                    }
                    string hisrowflow = Guid.NewGuid().ToString();
                    string groupflow  = item["groupflow"].ToString();
                    foreach (var inItem in dicitemList[groupflow])
                    {
                        string message    = "";
                        bool   itemresult = m_InCommonNoteBiz.SaveIncommonNoteItem(inItem, ref message);
                        if (!itemresult)
                        {
                            hasSave    = false;
                            messageAll = message;
                        }
                        InCommonNoteBiz.AddInCommonColHistory(inItem, hisrowflow);
                    }
                    InCommonNoteBiz.AddInCommonRowHistory(dicitemList[groupflow][0], hisrowflow);
                }
                if (hasSave == false)
                {
                    MyMessageBox.Show("保存失败!" + messageAll, 1);
                }
                else
                {
                    MyMessageBox.Show("保存成功!", 1);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.StackTrace);
            }
            finally
            {
                waitForm.Close();
            }
        }
Exemple #2
0
        private void Save()
        {
            UCRecordDateTime uCRecordDateTime = scorlInfo.Controls["uCRecordDateTime"] as UCRecordDateTime;
            UCRecordDoctor   uCRecordDoctor   = scorlInfo.Controls["uCRecordDoctor"] as UCRecordDoctor;
            string           datestr          = uCRecordDateTime.GetDate();
            string           timestr          = uCRecordDateTime.GetTime();
            string           recordDoc        = uCRecordDoctor.GetDoc();
            string           message          = "";

            foreach (var item in scorlInfo.Controls)
            {
                if (item is ucLabText)
                {
                    bool getResult = (item as ucLabText).GetInCommonNoteItemSave(ref message);
                    if (getResult == false)
                    {
                        m_app.CustomMessageBox.MessageShow(message);
                        return;
                    }
                }
            }
            if (inCommonNoteBiz == null)
            {
                inCommonNoteBiz = new InCommonNoteBiz(m_app);
            }
            foreach (var item in m_InCommonNoteTab.InCommonNoteItemList)
            {
                item.RecordDate       = datestr;
                item.RecordTime       = timestr;
                item.RecordDoctorName = recordDoc;
                inCommonNoteBiz.SaveIncommonNoteItem(item, ref message);
            }
            DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("保存成功");
            inCommonNoteBiz.GetDetaliInCommonNote(ref m_inCommonNote);
            m_InCommonNoteTab = m_inCommonNote.InCommonNoteTabList.Find(a => a.InCommonNote_Tab_Flow == m_InCommonNoteTab.InCommonNote_Tab_Flow);
            InitData();
        }
Exemple #3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                string messageAll = "";
                bool   hasSave    = true;

                //保存修改的数据
                foreach (List <InCommonNoteItemEntity> itemList in dicitemListChanged.Values)
                {
                    string hisrowflow = Guid.NewGuid().ToString();
                    foreach (var item in itemList)
                    {
                        string message    = "";
                        bool   itemresult = m_InCommonNoteBiz.SaveIncommonNoteItem(item, ref message);
                        if (!itemresult)
                        {
                            hasSave    = false;
                            messageAll = message;
                        }
                        InCommonNoteBiz.AddInCommonColHistory(item, hisrowflow);
                    }
                    InCommonNoteBiz.AddInCommonRowHistory(itemList[0], hisrowflow);
                }
                if (hasSave == false)
                {
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("保存失败!" + messageAll, 1);
                    return;
                }
                //保存删除的数据
                //foreach (var itemDelList in dicitemListDel.Values)
                //{
                //    foreach (var item in itemDelList)
                //    {
                //        string message = "";
                //        if (string.IsNullOrEmpty(item.InCommonNote_Item_Flow)) continue;
                //        item.Valide = "0";
                //        bool itemresult = m_InCommonNoteBiz.SaveIncommonNoteItem(item, ref message);
                //        if (!itemresult)
                //        {
                //            hasSave = false;
                //            messageAll = message;
                //        }
                //    }
                //}

                if (hasSave == false)
                {
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("保存失败!" + messageAll, 1);
                }
                else
                {
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("保存成功!", 1);
                    GetData();
                    txtSearch_EditValueChanged(null, null);
                    dicitemListChanged = new Dictionary <string, List <InCommonNoteItemEntity> >();
                    dicitemListDel     = new Dictionary <string, List <InCommonNoteItemEntity> >();
                }
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(ex.StackTrace);
            }
        }