示例#1
0
        void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            DataRow dr = gridView1.GetDataRow(e.RowHandle);

            drDel = dr;

            if (e.Column.Name == "update")
            {
                FrmArticleEdit article = new FrmArticleEdit();
                article.indata(dr["opt_id"].ToString());
                article.ShowDialog();
                article.Dispose();
            }
            if (e.Column.Name == "del")
            {
                bool isDel = (bool)TmoServiceClient.InvokeServerMethodT <bool>(funCode.OptionalDelete, new object[] { dr["opt_id"].ToString() });
                if (isDel)
                {
                    DXMessageBox.Show("删除成功!", true);
                    GetData();
                }
                else
                {
                    DXMessageBox.Show("删除失败!", true);
                    drDel = null;
                }
            }
        }
示例#2
0
        private bool SubmitData()
        {
            string  content  = about_us.GetHtmlValue();
            DataSet dsConfig = TmoShare.getDataSetFromXML(strConfigXML, true);
            DataRow drConfig = dsConfig.Tables[0].NewRow();

            drConfig["c_id"]        = about_us.Tag == null ? "" : about_us.Tag.ToString();
            drConfig["field_name"]  = about_us.Name;
            drConfig["field_value"] = DESEncrypt.Encrypt(content);
            drConfig["remark"]      = aboutPage.Text;
            drConfig["c_type"]      = "1";//1-关于我们 2-联系我们
            dsConfig.Tables[0].Rows.Add(drConfig.ItemArray);
            string strAboutUs = dsConfig.GetXml();
            bool   flag       = Convert.ToBoolean(TmoServiceClient.InvokeServerMethodT <bool>(funCode.AddOrUpdateAboutUs, TmoComm.login_docInfo.doc_name, "bnys", strAboutUs));

            content = contact_us.GetHtmlValue();
            dsConfig.Tables[0].Rows.Clear();
            drConfig                = dsConfig.Tables[0].NewRow();
            drConfig["c_id"]        = contact_us.Tag == null ? "" : contact_us.Tag.ToString();
            drConfig["field_name"]  = contact_us.Name;
            drConfig["field_value"] = DESEncrypt.Encrypt(content);
            drConfig["remark"]      = contactPage.Text;
            drConfig["c_type"]      = "2";//1-关于我们 2-联系我们
            dsConfig.Tables[0].Rows.Add(drConfig.ItemArray);
            strAboutUs = dsConfig.GetXml();
            flag      &= Convert.ToBoolean(TmoServiceClient.InvokeServerMethodT <bool>(funCode.AddOrUpdateAboutUs, TmoComm.login_docInfo.doc_name, "bnys", strAboutUs));
            return(flag);
        }
        /// <summary>
        /// 提交问卷
        /// </summary>
        /// <returns></returns>
        public List <tmo_questionnaire_category> SubmitResult()
        {
            List <tmo_questionnaire_result> data = GetResult();
            var res = TmoServiceClient.InvokeServerMethodT <List <tmo_questionnaire_category> >(funCode.SubmitQuestionnaires, data);

            return(res);
        }
示例#4
0
        void btnSaveTmp_Click(object sender, EventArgs e)
        {
            if (_user == null)
            {
                return;
            }
            if (dateEditStart.EditValue == null || dateEditEnd.EditValue == null)
            {
                DXMessageBox.ShowWarning2("管理时间未填写完整!");
                xtraTabControlMain.SelectedTabPageIndex = 0;
                return;
            }
            else
            {
                if (dateEditStart.DateTime == DateTime.MinValue || dateEditEnd.DateTime == DateTime.MinValue || dateEditStart.DateTime > dateEditEnd.DateTime)
                {
                    DXMessageBox.ShowWarning2("管理时间填写不正确,请修改!");
                    xtraTabControlMain.SelectedTabPageIndex = 0;
                    return;
                }
            }

            string jsonData = GetDataJsonString();
            bool   suc      = TmoServiceClient.InvokeServerMethodT <bool>(funCode.SaveActionPlan, _user.user_id, _user.user_times, jsonData, null);

            if (suc)
            {
                DXMessageBox.Show("健康行动计划暂存成功!", true);
            }
            else
            {
                DXMessageBox.ShowError("健康行动计划暂存失败!");
            }
        }
示例#5
0
        void btnsave_Click(object sender, EventArgs e)
        {
            DataTable dt      = (DataTable)dgcTree.DataSource;
            string    xmldata = TmoShare.getXMLFromDataTable(dt);

            if (btnsave.Text == "修改")
            {
                bool isT = TmoServiceClient.InvokeServerMethodT <bool>(TmoCommon.funCode.TuijianUpdate, new object[] { xmldata });
                if (isT)
                {
                    DXMessageBox.Show("修改成功!", true);
                    DialogResult = DialogResult.OK;
                }
                else
                {
                    DXMessageBox.Show("修改失败!", true);
                }
            }
            else
            {
                bool isT = TmoServiceClient.InvokeServerMethodT <bool>(TmoCommon.funCode.TuijianZhi, new object[] { xmldata });
                if (isT)
                {
                    DXMessageBox.Show("添加成功!", true);
                    DialogResult = DialogResult.OK;
                }
                else
                {
                    DXMessageBox.Show("添加失败!", true);
                }
            }
        }
        void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            DataRow dr = gridView1.GetDataRow(e.RowHandle);

            if (e.Column.Name == "update")
            {
                ucSportDiaryAdd uclivingdiaryadd = new ucSportDiaryAdd();
                uclivingdiaryadd.Datarow = dr;
                uclivingdiaryadd.SetDate();
                DialogResult dialogresult = uclivingdiaryadd.ShowDialog();
                if (dialogresult == DialogResult.OK)
                {
                    GetData();
                }
                uclivingdiaryadd.Dispose();
            }
            if (e.Column.Name == "del")
            {
                object obj = TmoServiceClient.InvokeServerMethodT <bool>(funCode.DeleteProduct, dr["living_guid"].ToString());
                if (Convert.ToBoolean(obj))
                {
                    DXMessageBox.Show("删除成功!", true);
                    GetData();
                }
                else
                {
                    DXMessageBox.Show("删除失败!", true);
                }
            }
        }
示例#7
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            object obj = TmoServiceClient.InvokeServerMethodT <bool>(txtServerIP.Text, Convert.ToInt32(txtServerPort.Text), funCode.CheckLink);

            if (obj is bool && ((bool)obj))
            {
                ConfigHelper.UpdateConfig("ServerIP", txtServerIP.Text, true);
                ConfigHelper.UpdateConfig("ServerPort", txtServerPort.Text, true);
                TmoServiceClient.RefreshIpPort();
                TCPClient.Instance.ClostSocket();
                TCPClient._ip   = TmoServiceClient.Ip;
                TCPClient._port = TmoServiceClient.Port + 1;
                btnCloseSet_Click(null, null);
            }
            else
            {
                DXMessageBox.btnOKClick += (object sender0, EventArgs e0) =>
                {
                    ConfigHelper.UpdateConfig("ServerIP", txtServerIP.Text, true);
                    ConfigHelper.UpdateConfig("ServerPort", txtServerPort.Text, true);
                    TmoServiceClient.RefreshIpPort();
                    TCPClient.Instance.ClostSocket();
                    TCPClient._ip   = TmoServiceClient.Ip;
                    TCPClient._port = TmoServiceClient.Port + 1;
                    btnCloseSet_Click(null, null);
                };
                DXMessageBox.ShowQuestion("测试连接失败!\r\n是否继续保存该配置?", this);
            }
        }
示例#8
0
        /// <summary>
        /// 加载数据
        /// </summary>
        public void GetData(string user_times)
        {
            this.ShowWaitingPanel(() =>
            {
                try
                {
                    object objrisk = TmoServiceClient.InvokeServerMethodT <string>(funCode.SelectLookQuestionnaire, dr["user_id"].ToString(), user_times);
                    DataSet dsrisk = TmoShare.getDataSetFromXML(objrisk.ToString());

                    string strmlx = TmoServiceClient.InvokeServerMethodT <string>(funCode.Getdis_dic, new object[] { "" });
                    DataSet ds    = TmoShare.getDataSetFromXML(strmlx);
                    SetData(dsrisk, ds);
                    return(ds.Tables[0]);
                }
                catch
                { }
                return(null);
            }, x =>
            {
                try
                {
                    DataTable dt = x as DataTable;
                    if (dt != null)
                    {
                        FillTree(treeList1, dt);
                        treeList1.CollapseAll();
                    }
                }
                catch (Exception ex)
                {
                    LogHelper.Log.Error("实体加载数据出错", ex);
                    DXMessageBox.ShowWarning2("数据加载失败!请重试!");
                }
            });
        }
示例#9
0
        void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            DataRow dr = gridView1.GetDataRow(e.RowHandle);

            drDel = dr;

            if (e.Column.Name == "del")
            {
                if (Convert.ToInt32(drDel["stock_num"].ToString()) > 0)
                {
                    DXMessageBox.Show("该产品还有库存,不能删除!", true);
                }
                else
                {
                    object obj = TmoServiceClient.InvokeServerMethodT <bool>(funCode.DeleteProduct, drDel["product_id"].ToString());
                    if (Convert.ToBoolean(obj))
                    {
                        DXMessageBox.Show("产品删除成功!", true);
                        GetData();
                    }
                    else
                    {
                        DXMessageBox.Show("产品删除失败!", true);
                    }
                }
            }
        }
示例#10
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            string hottype   = hottypea.EditValue.ToString();
            bool   issuccess = (bool)TmoServiceClient.InvokeServerMethodT <bool>(funCode.InputPersonNur, new object[] { user_id, user_times, hottype });

            if (issuccess)
            {
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();
            }

            else
            {
                DXMessageBox.Show("保存失败!", true);
            }


            #region  暂时注释
            //string strmlx = TmoReomotingClient.InvokeServerMethod(funCode.GetPersonNurData, new object[] { hottype }).ToString();
            //DataSet ds = TmoShare.getDataSetFromXML(strmlx);
            //if (TmoShare.DataSetIsNotEmpty(ds))
            //{
            //    DataTable dt = ds.Tables[0];
            //}
            #endregion
        }
        void DXMessageBox_btnOKClick(object sender, EventArgs e)
        {
            string user_idstr    = drdel["user_id"].ToString();
            string user_timesstr = drdel["user_times"].ToString();
            bool   isdel         = false;
            string reDel         = TmoServiceClient.InvokeServerMethodT <string>(funCode.ReportDel, new object[] { user_idstr, user_timesstr });

            if (reDel == "3")
            {
                DXMessageBox.ShowWarning2("已购买服务不能删除!");
                return;
            }
            if (reDel == "1")
            {
                isdel = true;
            }


            if (isdel)
            {
                DXMessageBox.Show("删除成功!", true);
                GetData();
            }
            else
            {
                DXMessageBox.Show("删除失败!", true);
            }
            drdel = null;
        }
示例#12
0
        void product_id_Click(object sender, EventArgs e)
        {
            //绑定产品单价 和库存
            if (this.product_id.EditValue == null || this.product_id.EditValue.ToString() == "0")
            {
                return;
            }
            string    productID = this.product_id.EditValue.ToString();
            string    parPrice  = "0.00";
            DataTable dtProduct = TmoServiceClient.InvokeServerMethodT <DataSet>(funCode.GetPublicList, "tmo_product_list", " is_del='1' and product_id=" + productID).Tables[0];

            if (TmoCommon.TmoShare.DataTableIsNotEmpty(dtProduct))
            {
                parPrice = dtProduct.Rows[0]["par_price"].ToString();
            }
            par_price.Text = parPrice;

            string    stockNum       = "0";
            DataTable dtProductStock = TmoServiceClient.InvokeServerMethodT <DataSet>(funCode.GetPublicList, "tmo_stock_list", " product_id=" + productID).Tables[0];

            if (TmoCommon.TmoShare.DataTableIsNotEmpty(dtProductStock))
            {
                stockNum = dtProductStock.Rows[0]["stock_num"].ToString();
            }
            stock_num.Text = stockNum;
        }
示例#13
0
        public void loadData(DataRow dr)
        {
            this.ShowWaitingPanel(() =>
            {
                userid = dr["user_id"].ToString();

                userTime       = dr["user_times"].ToString();
                string xmlData = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetAttach, new object[] { userid, userTime, "old" });
                if (xmlData != "")
                {
                    DataTable dt = TmoShare.getDataTableFromXML(xmlData);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        return(dt);
                    }
                    return(null);
                }

                return(null);
            }, x =>
            {
                if (x == null)
                {
                    return;
                }
                DataTable dt   = x as DataTable;
                DataRow drData = dt.Rows[0];
                htmlE1.Html    = drData["content"].ToString();
            });
        }
示例#14
0
        public bool submit()
        {
            DataTable dt    = (DataTable)prodiclist.DataSource;
            DataTable dtNew = dt.Clone();

            foreach (DataRow row in dt.Rows)
            {
                if (row["isChange"].ToString() == "1")
                {
                    DataRow nowrow = dtNew.NewRow();
                    nowrow["project_id"]    = row["project_id"];
                    nowrow["solve_content"] = row["solve_content"];
                    dtNew.Rows.Add(nowrow);
                }
            }

            if (dtNew.Rows.Count > 0)
            {
                string allXml = TmoShare.getXMLFromDataTable(dtNew);
                bool   issuc  = (bool)TmoServiceClient.InvokeServerMethodT <bool>(funCode.updateAll, new object[] { allXml });
                return(issuc);
            }

            return(true);
        }
示例#15
0
        void linkdel_Click(object sender, EventArgs e)
        {
            if (CheckedRowIndexs.Count == 0)
            {
                return;
            }
            DataRow dr            = gridView1.GetDataRow(CheckedRowIndexs[0]);
            string  user_idstr    = dr["user_id"].ToString();
            string  user_timesstr = dr["user_times"].ToString();
            bool    isdel         = false;
            string  reDel         = TmoServiceClient.InvokeServerMethodT <string>(funCode.ReportDel, new object[] { user_idstr, user_timesstr });

            if (reDel == "3")
            {
                DXMessageBox.ShowWarning2("已购买服务不能删除!");
                return;
            }

            if (reDel == "1")
            {
                isdel = true;
            }

            if (isdel)
            {
                DXMessageBox.ShowWarning2("删除成功!");
            }
            else
            {
                DXMessageBox.ShowWarning2("删除失败!");
            }
            GetData();
        }
示例#16
0
 /// <summary>
 /// 加载数据
 /// </summary>
 public void GetData(string parentid = "0", string hotid = "0")
 {
     this.ShowWaitingPanel(() =>
     {
         try
         {
             string strmlx = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetNurData, new object[] { parentid, hotid });
             DataSet ds    = TmoShare.getDataSetFromXML(strmlx);
             if (TmoShare.DataSetIsNotEmpty(ds))
             {
                 return(ds.Tables[0]);
             }
         }
         catch
         { }
         return(null);
     }, x =>
     {
         try
         {
             var dt = x as DataTable;
             FillTree(treeList1, dt);
             treeList1.CollapseAll();
         }
         catch (Exception ex)
         {
             LogHelper.Log.Error("实体加载数据出错", ex);
             DXMessageBox.ShowWarning2("数据加载失败!请重试!");
         }
     });
 }
示例#17
0
        public void Indata(string videoId)
        {
            if (!string.IsNullOrEmpty(videoId))
            {
                this.Text   = "视频修改";
                btnAdd.Text = "确定修改";
                isadd       = videoId;
                string  strmlx = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetVideoId, new object[] { videoId });
                DataSet ds     = TmoShare.getDataSetFromXML(strmlx);
                if (TmoShare.DataSetIsNotEmpty(ds))
                {
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    {
                        DataRow dr = ds.Tables[0].Rows[0];

                        txtvideoUrl.Text  = dr["video_url"].ToString();
                        txtvideoName.Text = dr["video_name"].ToString();
                    }
                }
            }
            else
            {
                this.Text   = "视频添加";
                btnAdd.Text = "确定添加";
                isadd       = "";
            }
        }
        private bool sendmessage(string openid, string userid)
        {
            DataSet dtWeiXinMsg = TmoShare.getDataSetFromXML(tmo_wechat_consulting);
            //dtWeiXinMsg.Tables[0].Clear();
            DataRow newRow = dtWeiXinMsg.Tables[0].NewRow();

            newRow["we_id"]         = openid;
            newRow["con_content"]   = "医生主动咨询";
            newRow["reply_content"] = ask_content.Text;
            newRow["input_time"]    = System.DateTime.Now;
            newRow["update_time"]   = System.DateTime.Now;

            newRow["user_id"] = userid;
            newRow["doc_id"]  = TmoComm.login_docInfo.doc_id.ToString();
            newRow["con_id"]  = Guid.NewGuid().ToString("N");
            dtWeiXinMsg.Tables[0].Rows.InsertAt(newRow, 0);
            dtWeiXinMsg.AcceptChanges();
            bool answer = (bool)(TmoServiceClient.InvokeServerMethodT <bool>(funCode.AddAsk, new object[] { TmoCommon.TmoShare.getXMLFromDataSet(dtWeiXinMsg) }));

            if (answer)
            {
                string  data = @"<data>
                                <first>
                                    <value></value>
                                    <color></color>
                                </first>
                                <keyword1>
                                    <value></value>
                                    <color></color>
                                </keyword1>
                                <keyword2>
                                    <value></value>
                                    <color></color>
                                </keyword2>
                                <remark>
                                    <value></value>
                                    <color></color>
                                </remark>        
                            </data>";
                DataSet ds   = TmoShare.getDataSetFromXML(data);

                ds.Tables["first"].Rows[0]["value"]    = "尊敬的用户,医生对您进行了提问:";
                ds.Tables["first"].Rows[0]["color"]    = TmoShare.RGBToWebColor(Color.Gray);
                ds.Tables["keyword1"].Rows[0]["value"] = "无";
                ds.Tables["keyword1"].Rows[0]["color"] = TmoShare.RGBToWebColor(Color.Gray);
                ds.Tables["keyword2"].Rows[0]["value"] = ask_content.Text;
                ds.Tables["keyword2"].Rows[0]["color"] = TmoShare.RGBToWebColor(Color.Gray);
                ds.Tables["remark"].Rows[0]["value"]   = "感谢您的使用!";
                ds.Tables["remark"].Rows[0]["color"]   = TmoShare.RGBToWebColor(Color.Gray);
                string content    = TmoCommon.TmoShare.GetXml_NO_TITLE(ds);
                string templateID = ConfigHelper.GetConfigString("WX_TEMPLATE_RSID");//模板
                string err_tip    = WeChatHelper.WXTemplateMsgSend(new object[] { "admin", openid, templateID, "", TmoShare.RGBToWebColor(Color.Green), content });

                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#19
0
 /// <summary>
 /// 加载数据
 /// </summary>
 public void GetData()
 {
     this.ShowWaitingPanel(() =>
     {
         try
         {
             string strmlx = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetMedicalInUser, new object[] { _user_id, _dc });
             DataTable dt  = TmoShare.getDataTableFromXML(strmlx);
             if (TmoShare.DataTableIsNotEmpty(dt))
             {
                 return(dt);
             }
             return(null);
         }
         catch
         { }
         return(null);
     }, x =>
     {
         try
         {
             DataTable dt = x as DataTable;
             SetPiont(dt);
         }
         catch (Exception ex)
         {
             LogHelper.Log.Error("实体加载数据出错", ex);
             DXMessageBox.ShowWarning2("数据加载失败!请重试!");
         }
     });
 }
        private void ComboBoxBind()
        {
            try
            {
                DataTable wzds = TmoServiceClient.InvokeServerMethodT <DataSet>(funCode.GetPublicList, "tmo_product_type", "is_del='1' ").Tables[0];

                if (TmoShare.DataTableIsNotEmpty(wzds))
                {
                    this.BindDataTable(productType, wzds, "type_name", "type_id");
                }
                DataTable ztdt = TmoServiceClient.InvokeServerMethodT <DataSet>(funCode.GetPublicList, "tmo_product_list", " is_del='1' ").Tables[0];

                if (TmoShare.DataTableIsNotEmpty(ztdt))
                {
                    this.BindDataTable(productId, ztdt, "product_name", "product_id");
                }
                DataTable ysdt = Tmo_FakeEntityClient.Instance.GetData("tmo_sell_list", new[] { "distinct(doc_code) as doc_code" }, "is_del='1'");
                if (TmoShare.DataTableIsNotEmpty(ysdt))
                {
                    this.BindDataTable(docCode, ysdt, "doc_code", "doc_code");
                }
            }
            catch (Exception)
            {
            }
        }
示例#21
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(user_id.Text))
            {
                DXMessageBox.ShowWarning2("证件号不能为空!");
                return;
            }
            bool idCard = Convert.ToBoolean(TmoServiceClient.InvokeServerMethodT <bool>(funCode.CheckIDCard, user_id.Text));

            if (idCard)
            {
                DXMessageBox.ShowWarning2("用户ID不存在!");
                return;
            }
            if (string.IsNullOrWhiteSpace(diary_date.Text))
            {
                DXMessageBox.ShowWarning2("日期不能为空!");
                return;
            }
            string  result = "-2";
            string  data   = diary_date.Text;
            DataSet ds     = TmoShare.getDataSetFromXML(xmlTargetAppend, true);
            DataRow dr     = ds.Tables[0].NewRow();

            try
            {
                foreach (DevExpress.XtraEditors.PanelControl temp in this.Controls)
                {
                    foreach (Control det in temp.Controls)
                    {
                        foreach (DataColumn dc in ds.Tables[0].Columns)
                        {
                            if (det.Name == dc.ColumnName)
                            {
                                dr[dc] = det.Text;
                            }
                        }
                    }
                }
            }
            catch { DXMessageBox.ShowError("指标补充失败!", this); }
            ds.Tables[0].Rows.Add(dr);
            ds.AcceptChanges();
            TmoServiceClient.InvokeServerMethodT <string>(funCode.CreatePointsUser, user_id.Text);
            result = (TmoServiceClient.InvokeServerMethodT <int>(funCode.AddTargetAppend, TmoShare.getXMLFromDataSet(ds))).ToString();
            if (Convert.ToInt16(result) >= 0)
            {
                DXMessageBox.Show("指标补充成功!", true);
                if (this.ParentForm != null)
                {
                    this.ParentForm.DialogResult = DialogResult.OK;
                    this.ParentForm.Close();
                }
            }
            else
            {
                DXMessageBox.ShowError("指标补充失败!", this);
            }
        }
示例#22
0
        /// <summary>
        /// 加载数据
        /// </summary>
        public void GetData()
        {
            this.ShowWaitingPanel(() =>
            {
                try
                {
                    string projecttype = "";
                    string project     = "";
                    if (!string.IsNullOrEmpty("全部类型"))
                    {
                        project = txtproject.Text;
                    }

                    string strmlx = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetProjectDic, new object[] { projecttype, project, "" });
                    DataSet ds    = TmoShare.getDataSetFromXML(strmlx);
                    if (TmoShare.DataSetIsNotEmpty(ds))
                    {
                        return(ds.Tables[0]);
                    }

                    return(null);
                }
                catch
                {
                }

                return(null);
            }, x =>
            {
                try
                {
                    DataTable dt = x as DataTable;
                    // prodiclist.DataSource = dt;

                    //treeListFood.ClearNodes();
                    //if (treeListFood.Nodes.Count == 0)
                    //{
                    //    treeListFood.AppendNode(new object[] { "膳食分类", "", "", "", "", "", "", "-1", "" }, -1);
                    //}
                    //else
                    //{
                    //    treeListFood.Nodes[0]["Fc_Name"] = "膳食分类";
                    //    treeListFood.Nodes[0]["Fc_Pid"] = "-1";
                    //}
                    if (dt == null)
                    {
                        return;
                    }
                    FillTree(prodiclist, dt);
                    prodiclist.CollapseAll();
                }
                catch (Exception ex)
                {
                    LogHelper.Log.Error("实体加载数据出错", ex);
                    DXMessageBox.ShowWarning2("数据加载失败!请重试!");
                }
            });
        }
示例#23
0
 void AddUserToSelected(Userinfo user)
 {
     if (user != null && SelectedUsers.All(x => x.user_id != user.user_id))
     {
         user = TmoServiceClient.InvokeServerMethodT <Userinfo>(funCode.GetUserInfo, user.user_id);
         SelectedUsers.Add(user);
     }
     gridControlSelected.RefreshDataSource();
 }
        static bool SyncDeviceTool_SubmitDataMethod(SyncDevice sDev, object submitData)
        {
            string submitStr = submitData as string;

            if (sDev.deviceType == SyncDeviceType.ALKBP || sDev.deviceType == SyncDeviceType.ALKBG || sDev.deviceType == SyncDeviceType.JBQ)
            {
                return(TmoServiceClient.InvokeServerMethodT <bool>(funCode.AddMonitorData, submitStr));
            }
            return(false);
        }
示例#25
0
        /// <summary>
        /// 检查服务器连接
        /// </summary>
        /// <returns></returns>
        private bool CheckLink()
        {
            object obj = TmoServiceClient.InvokeServerMethodT <bool>(funCode.CheckLink);

            if (obj is bool)
            {
                return((bool)obj);
            }
            return(false);
        }
示例#26
0
        public static void createReport(string userId)
        {
            if (string.IsNullOrWhiteSpace(userId))
            {
                return;
            }

            DataSet ds = TmoShare.getDataSetFromXML(riskxml, true);

            if (ds.Tables[0].Rows.Count == 0)
            {
                ds.Tables[0].Rows.Add(ds.Tables[0].NewRow());
            }
            ds.Tables[0].Rows[0]["user_id"] = userId;

            string  riskDxml  = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetTimes, new object[] { userId });
            DataSet riskState = TmoShare.getDataSetFromXML(riskDxml);

            if (riskState != null && riskState.Tables.Count > 0 && riskState.Tables[0] != null && riskState.Tables[0].Rows.Count > 0)
            {
                if (riskState.Tables[0].Rows[0] != null && riskState.Tables[0].Rows[0]["isrisk"].ToString() == "1")
                {
                    ds.Tables[0].Rows[0]["user_time"] = riskState.Tables[0].Rows[0]["user_times"];
                    string selexml = TmoShare.getXMLFromDataSet(ds);
                    string strmlx  = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetRiskData, new object[] { selexml });
                    ds = TmoShare.getDataSetFromXML(strmlx);

                    string c = CreateReport.pphase_Result(ds.Tables[0], ds.Tables[1], "1");
                    if (c == "1")
                    {
                        DXMessageBox.ShowWarning2("生成评估数据成功,请到输出报告查看!");
                    }
                    else if (c == "2")
                    {
                        DXMessageBox.ShowWarning2("生成评估数据失败");
                    }
                    else
                    {
                        DXMessageBox.ShowSuccess("恭喜您,您的身体非常健康\r\n我们暂时无法给你出报告!");
                    }
                }
                else if (riskState.Tables[0].Rows[0] != null && riskState.Tables[0].Rows[0]["isrisk"].ToString() == "2")
                {
                    DXMessageBox.ShowWarning2("已经评估过!");
                }
                else
                {
                    DXMessageBox.ShowWarning2("问卷处于暂存状态,请填写完成问卷!");
                }
            }
            else
            {
                DXMessageBox.ShowWarning2("暂时不能评估");
            }
        }
示例#27
0
        public void GetData()
        {
            this.ShowWaitingPanel(() =>
            {
                try
                {
                    DsQueryXml = TmoShare.getDataSetFromXML(SubmitXml, true);
                    if (DsQueryXml.Tables[0].Rows.Count == 0)
                    {
                        DsQueryXml.Tables[0].Rows.Add(DsQueryXml.Tables[0].NewRow());
                    }
                    DsQueryXml.Tables[0].Rows[0]["page_size"] = _pageSize.ToString();
                    DsQueryXml.Tables[0].Rows[0]["now_page"]  = _currentPage.ToString();
                    DsQueryXml.Tables[0].Rows[0]["user_id"]   = _uid;
                    DsQueryXml.Tables[0].Rows[0]["mt_code"]   = _dicCode;
                    string dd       = nurtype.EditValue.ToString();
                    string sqlWhere = "and a.mt_time>='" + this.startTime.EditValue + "'" + " and a.mt_time<='" + this.endDate.EditValue + "'";
                    DsQueryXml.Tables[0].Rows[0]["mt_time"] = sqlWhere;

                    string selexml = TmoShare.getXMLFromDataSet(DsQueryXml);

                    string strmlx    = TmoServiceClient.InvokeServerMethodT <string>(funCode.GetMonitorDataBy, new object[] { selexml });
                    _dsGetDataResult = TmoShare.getDataSetFromXML(strmlx);
                    if (TmoShare.DataSetIsNotEmpty(_dsGetDataResult))
                    {
                        return(_dsGetDataResult.Tables[1]);
                    }
                    else
                    {
                        return(null);
                    }
                }
                catch
                { }
                return(null);
            }, x =>
            {
                try
                {
                    var dt = x as DataTable;
                    if (_dicCode != "99")
                    {
                        SetContorl(dt, _dicNamevalue);
                    }
                    else
                    {
                        SetXueYaContorl(dt);
                    }
                }
                catch (Exception ex)
                {
                }
            });
        }
示例#28
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(ExName) || by == null)
            {
                DXMessageBox.ShowWarning("请先选择文件再进行上传操作!");
                return;
            }

            string watingstr = "检验报告单上传中";

            this.ShowWaitingPanel(() =>
            {
                if (!isupdate)
                {
                    bool isscul = TmoServiceClient.InvokeServerMethodT <bool>(funCode.InsertAttach, new object[] { by, userid, userTime, ExName });
                    return(isscul);
                }
                else
                {
                    bool isscul = TmoServiceClient.InvokeServerMethodT <bool>(funCode.UpdateAttach, new object[] { atId, by, ExName });
                    return(isscul);
                }
            },
                                  o =>
            {
                bool isscul = Convert.ToBoolean(o);

                if (!isupdate)
                {
                    if (isscul)
                    {
                        DXMessageBox.Show("上传检验报告单成功", true);
                        this.Close();
                    }
                    else
                    {
                        DXMessageBox.ShowWarning2("上传检验报告单失败!\n可能是文件过大或者网络不好");
                    }
                }
                else
                {
                    if (isscul)
                    {
                        DXMessageBox.Show("修改上传检验报告单成功", true);
                        this.Close();
                    }
                    else
                    {
                        DXMessageBox.ShowWarning2("修改上传检验报告单失败!\n可能是文件过大或者网络不好");
                    }
                }
            }, watingstr);
        }
        protected override DataSet GetDataMethod(FE_GetDataParam getDataParam)
        {
            string  user_id    = Userinfo == null ? "" : Userinfo.user_id;
            int     user_times = Userinfo == null ? 0 : Userinfo.user_times;
            DataSet ds         = TmoServiceClient.InvokeServerMethodT <DataSet>(funCode.GetProResult, user_id, user_times, "");

            if (ds != null && ds.Tables.Count > 0)
            {
                ds.Tables[0].TableName = "tmo_data";
            }
            return(ds);
        }
示例#30
0
        private void ComboBoxBind()
        {
            try
            {
                DataTable wzds = TmoServiceClient.InvokeServerMethodT <DataSet>(funCode.GetPublicList, "tmo_product_type", "is_del='1' ").Tables[0];

                if (TmoShare.DataTableIsNotEmpty(wzds))
                {
                    this.BindDataTable(productType, wzds, "type_name", "type_id");
                }

                DataTable ztdt = TmoServiceClient.InvokeServerMethodT <DataSet>(funCode.GetPublicList, "tmo_product_list", " is_del='1' ").Tables[0];

                if (TmoShare.DataTableIsNotEmpty(ztdt))
                {
                    this.BindDataTable(productName, ztdt, "product_name", "product_id");
                }

                DataTable ysdt = Tmo_FakeEntityClient.Instance.GetData("tmo_sell_list", new[] { "distinct(doc_code) as doc_code" }, "is_del='1'");
                if (TmoShare.DataTableIsNotEmpty(ysdt))
                {
                    this.BindDataTable(docName, ysdt, "doc_code", "doc_code");
                }

                var param = new FE_GetDataParam()
                {
                    Columns        = { "distinct(tmo_sell_list.identity)", "name" },
                    Sources        = "tmo_sell_list",
                    JoinConditions = { new JoinCondition()
                                       {
                                           JoinType = EmJoinType.LeftJoin, Table = "tmo_userinfo", OnCol = "identity"
                                       } }
                };
                param.AddWhere("tmo_sell_list.is_del='1'");

                DataSet ds = Tmo_FakeEntityClient.Instance.GetData(param);
                if (TmoShare.DataSetIsNotEmpty(ds))
                {
                    if (ds.Tables.Contains("tmo_data"))
                    {
                        DataTable yhdt = ds.Tables["tmo_data"];
                        if (TmoShare.DataTableIsNotEmpty(yhdt))
                        {
                            this.BindDataTable(receiveCode, yhdt, "name", "identity");
                        }
                    }
                }
            }
            catch (Exception)
            {
            }
        }