コード例 #1
0
        public ActionResult EditAttraction(Attraction attraction)
        {
            City city = GetHelper <City> .GetById(Globals.CITIES_API_LINK, attraction.city.id);

            Country country = GetHelper <Country> .GetById(Globals.COUNTRIES_API_LINK, city.country.id);

            Attraction updatedAttraction = new Attraction()
            {
                id      = attraction.id,
                name    = attraction.name,
                address = attraction.address,
                type    = attraction.type,
                city    = new City
                {
                    id      = city.id,
                    name    = city.name,
                    country = new Country
                    {
                        id   = country.id,
                        name = country.name
                    }
                }
            };

            UpdateHelper <Attraction> .UpdateEntity(Globals.ATTRACTION_API_LINK, updatedAttraction);

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public ViewResult Edit(int cityId)
        {
            ViewData["CountriesList"] = GetCountriesList();
            City city = GetHelper <City> .GetById(Globals.CITIES_API_LINK, cityId);

            return(View("Edit", city));
        }
コード例 #3
0
        public ViewResult Edit(int attractionId)
        {
            ViewData["CitiesList"] = GetCityList();
            Attraction attraction = GetHelper <Attraction> .GetById(Globals.ATTRACTION_API_LINK, attractionId);

            return(View("Edit", attraction));
        }
コード例 #4
0
        public ViewResult Edit(int subjectId)
        {
            ViewData["TeacherList"] = GetTeachersList();
            Subject subject = GetHelper <Subject> .GetById(Globals.SUBJECTS_API_LINK, subjectId);

            return(View("EditSubject", subject));
        }
コード例 #5
0
        //诊断管理
        public List <Disease_records_Model> Get_zdgl()
        {
            string  sql     = $"select createtime,sum(_money) Total,count(id) Patients from Disease_records group by createtime";
            DataSet dataSet = helper.GetDataSet(sql);

            return(GetHelper.DatatableTolist <Disease_records_Model>(dataSet.Tables[0]));
        }
コード例 #6
0
        ///Bll医生诊断   HCM添加
        /// <summary>
        /// 获取所属医生的患者资料  是否接诊 未0 已接诊1
        /// </summary>
        /// <param name="DoctorId">医生 id</param>
        /// <param name="seate">是否接诊 未0 已接诊1</param>
        /// <returns></returns>
        public List <Patient_Model> GetDoctPatiList(int DoctorId, int seate)
        {
            string  sql     = $"select * from patient where DoctorId={DoctorId} and seate={seate}";
            DataSet dataSet = helper.GetDataSet(sql);

            return(GetHelper.DatatableTolist <Patient_Model>(dataSet.Tables[0]));
        }
コード例 #7
0
        //已接诊
        public List <Disease_records_Model> Get_yes()
        {
            string  sql     = $"select *from Disease_records join patient on Disease_records.patient_Id=patient.id where seate=1";
            DataSet dataSet = helper.GetDataSet(sql);

            return(GetHelper.DatatableTolist <Disease_records_Model>(dataSet.Tables[0]));
        }
コード例 #8
0
        /// <summary>
        /// 注册方法
        /// </summary>
        /// <param name="m">数据</param>
        /// <returns></returns>
        public int GetDoctorAdd(DoctorLog_Model m)
        {
            string sql = GetHelper.GetAddSql(m, "id");
            int    h   = helper.ExceuteNonQuery(sql);

            return(h);
        }
コード例 #9
0
        /// <summary>
        /// 获取所属医生金额表
        /// </summary>
        /// <param name="Doctor_ID">医生id</param>
        /// <returns></returns>
        public List <Doctor_money_Model> GetDoctPatiList(int Doctor_ID)
        {
            string  sql     = $"select * from Doctor_money where Doctor_ID={Doctor_ID}";
            DataSet dataSet = helper.GetDataSet(sql);

            return(GetHelper.DatatableTolist <Doctor_money_Model>(dataSet.Tables[0]));
        }
コード例 #10
0
        /// <summary>
        /// 诊断报告表
        /// </summary>
        /// <param name="Disease_records_id">诊断记录表ID</param>
        /// <returns></returns>
        public List <Patient_Model> GetPati_DiagnosisList(int Disease_records_id)
        {
            string  sql     = $"select patient.*,describe,diagnosis from patient join Disease_records on patient.id=Disease_records.patient_Id where Disease_records.id={Disease_records_id}";
            DataSet dataSet = helper.GetDataSet(sql);

            return(GetHelper.DatatableTolist <Patient_Model>(dataSet.Tables[0]));
        }
コード例 #11
0
        //诊断列表
        public List <Disease_records_Model> Get_Administrationlist(string sickdate)
        {
            string  sql     = $"select* from Disease_records join patient on Disease_records.patient_Id = patient.id where Disease_records.createtime = '{sickdate}' ";
            DataSet dataSet = helper.GetDataSet(sql);

            return(GetHelper.DatatableTolist <Disease_records_Model>(dataSet.Tables[0]));
        }
コード例 #12
0
ファイル: BaseBLL.cs プロジェクト: tianjunfei001/seate003-Api
        //反填
        public T GetFanTable <T>(int id, string key)
        {
            string  sql     = GetHelper.GetFanSql <T>(id, key);
            DataSet dataSet = helper.GetDataSet(sql);

            return(GetHelper.DatatableTolist <T>(dataSet.Tables[0])[0]);
        }
コード例 #13
0
        private void textButtonOk_Click(object sender, EventArgs e)
        {
            try
            {
                _isOk = false;
                if (string.IsNullOrEmpty(textBoxInput.Text))
                {
                    MessageHelper.Popup(WinformRes.Input + ValidationRes.CanNotBeNull);
                    return;
                }

                if (VerificationRule.IsNullOrEmpty())
                {
                    _isOk = true;
                }
                else
                {
                    _isOk = GetHelper.VerifyPassword(textBoxInput.Text, VerificationRule, VerificationParams);
                }
                if (_isOk)
                {
                    _inputText = textBoxInput.Text;
                    Close();
                }
            }
            catch (Exception ex)
            {
                MessageHelper.Popup(ex.Message);
            }
        }
コード例 #14
0
ファイル: BaseBLL.cs プロジェクト: tianjunfei001/seate003-Api
        /// <summary>
        /// 显示表信息
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public List <T> GetShowTable <T>()
        {
            string  sql     = GetHelper.GetShowSql <T>();
            DataSet dataSet = helper.GetDataSet(sql);

            return(GetHelper.DatatableTolist <T>(dataSet.Tables[0]));
        }
コード例 #15
0
        /// <summary>
        /// 请求艺龙接口
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="request"></param>
        /// <param name="method"></param>
        /// <returns></returns>
        private static string RequestInterface <T>(T request, string method)
        {
            var requestContent = new BaseRequestEntity <T>()
            {
                Local = EnumLocal.zh_CN, Version = 1.22, Request = request
            };

            var str = JsonHelper.SerializeObject(requestContent);

            LogHelper.WriteLog("请求信息1:" + str, "ElongHotelInterface");
            DateTime now       = DateTime.Now;
            long     timestamp = ConvertDateTimeInt(now);
            string   sig       = MD5(timestamp + MD5(str + ApiGatewayConfig.APPKEY) + ApiGatewayConfig.SECRETKEY);

            StringBuilder sb = new StringBuilder();

            sb.Append("format=").Append("json").Append("&");
            sb.Append("method=").Append(method).Append("&");
            sb.Append("signature=").Append(sig).Append("&");
            sb.Append("user="******"&");
            sb.Append("timestamp=").Append(timestamp).Append("&");

            str = Uri.EscapeDataString(str);
            sb.Append("data=").Append(str);
            string url = string.Format(ApiGatewayConfig.URL_HTTPS, sb.ToString());

            LogHelper.WriteLog("请求信息2:" + url, "ElongHotelInterface");
            string res = GetHelper.GetUrl(url);

            LogHelper.WriteLog("响应信息:" + res, "ElongHotelInterface");
            return(res);
        }
コード例 #16
0
        public List <StarshipLim> GetStarshipByPage(int page = 1)
        {
            var url      = $"https://swapi.co/api/starships?page={page}";
            var starList = GetAsync <StarWarsEntityListLim <StarshipLim> >(url).Result;

            return(GetHelper.GetEnumeration(starList.Results));
        }
コード例 #17
0
        public static string GetToken()
        {
            var    timeStamp = GetTimeStamp();
            string tokenStr;

            if (AccesTokenTime != 0 && (timeStamp - AccesTokenTime) > 590 && (timeStamp - RefreshTokenTime) < 890)
            {
                tokenStr = GetHelper.GetUrl(ApiGatewayConfig.REFRESH_BASE_URL + "?AID="
                                            + ApiGatewayConfig.AID + "&SID=" + ApiGatewayConfig.SID
                                            + "&refresh_token=" + RefreshToken);
            }
            else
            {
                tokenStr = GetHelper.GetUrl(ApiGatewayConfig.TOKEN_BASE_URL + "?AID="
                                            + ApiGatewayConfig.AID + "&SID=" + ApiGatewayConfig.SID
                                            + "&KEY=" + ApiGatewayConfig.KEY);
            }
            ReturnToken rToken = JsonHelper.DeserializeJsonToObject <ReturnToken>(tokenStr);

            AccessToken      = rToken.Access_Token;
            RefreshToken     = rToken.Refresh_Token;
            AccesTokenTime   = timeStamp;
            RefreshTokenTime = timeStamp;
            return(AccessToken);
        }
コード例 #18
0
        //好评评价
        public Disease_records_Model Get_Acclaim(string id)
        {
            string  sql     = $"select * from Disease_records join patient on Disease_records.patient_Id=patient.id where Disease_records.id='{id}'";
            DataSet dataSet = helper.GetDataSet(sql);
            var     list    = GetHelper.DatatableTolist <Disease_records_Model>(dataSet.Tables[0]);

            return(list[0]);
        }
コード例 #19
0
        //健康档案
        public Patient_Model Get_By(string id)
        {
            string  sql     = $"select * from patient join Disease_records on Disease_records.patient_Id=patient.id where patient.id='{id}'";
            DataSet dataSet = helper.GetDataSet(sql);
            var     list    = GetHelper.DatatableTolist <Patient_Model>(dataSet.Tables[0]);

            return(list[0]);
        }
コード例 #20
0
        public ViewResult ViewStudents(int classId, string className)
        {
            IEnumerable <Student> students = GetHelper <Student> .GetAll("students").Where(s => s.@class != null && [email protected] == classId);

            SetClassName(classId);
            ViewData["classId"] = classId;
            return(View("Students", students));
        }
コード例 #21
0
        /// <summary>
        /// 医生绑定的银行卡
        /// </summary>
        /// <param name="id"></param>
        /// <param name="Doctor_ID"></param>
        /// <returns></returns>
        public List <Doctor_bankcard_Model> GetBindBank(int id, int Doctor_ID)
        {
            string  sql = $"select Doctor_bankcard.* from Doctor_money  join Doctor_bankcard on Doctor_money.id = Doctor_bankcard.Doctor_moneyId where Doctor_money.id={id} and Doctor_ID={Doctor_ID}";
            DataSet ds  = helper.GetDataSet(sql);
            List <Doctor_bankcard_Model> list = GetHelper.DatatableTolist <Doctor_bankcard_Model>(ds.Tables[0]);

            //Doctor_money_Model doc_money = list[0];
            return(list);
        }
コード例 #22
0
        public ActionResult EditSubject(Subject subject)
        {
            Teacher teacher = GetHelper <Teacher> .GetById(Globals.TEACHERS_API_LINK, subject.teacher.id);

            subject.teacher = teacher;
            UpdateHelper <Subject> .UpdateEntity(Globals.SUBJECTS_API_LINK, subject);

            return(RedirectToAction("Index"));
        }
コード例 #23
0
        public List <Doctor_money_Model> GetDoctor_money(int Doctor_ID)
        {
            string  sql = $"select * from Doctor_money where Doctor_ID = {Doctor_ID}";
            DataSet ds  = helper.GetDataSet(sql);
            List <Doctor_money_Model> list = GetHelper.DatatableTolist <Doctor_money_Model>(ds.Tables[0]);

            //Doctor_money_Model doc_money = list[0];
            return(list);
        }
コード例 #24
0
        // GET: Classes
        public ViewResult Index()
        {
            IEnumerable <Class> classes = GetHelper <Class> .GetAll("classes");

            classes = classes.OrderBy(c => c.id);
            if (classes == null)
            {
                ModelState.AddModelError(string.Empty, "Wystąpił błąd serwera - brak danych w bazie.");
            }
            return(View(classes));
        }
コード例 #25
0
        public IActionResult OutLogLogsExcel(int uid)
        {
            string    sql      = $"select l.id,l.uid,l.Create_Time,l.Log_Seate,l.Log_LP,l.Log_City from log_log l join users u on l.uid = u.uid where l.uid={uid};";
            DataSet   ds       = sqlServerHelper.GetDataSet(sql);
            DataTable dt       = ds.Tables[0];
            var       stream   = GetHelper.ExcelOut(dt);
            var       type     = "application/ectet-stream";
            var       filename = $"{DateTime.Now.ToString("yyyyMMddhhmmss")}.xls";

            return(File(stream.ToArray(), type, filename));
        }
コード例 #26
0
        // GET: Subjects
        public ViewResult Index()
        {
            IEnumerable <Subject> subjects = GetHelper <Subject> .GetAll("subjects");

            subjects = subjects.OrderBy(s => s.id);
            if (subjects == null)
            {
                ModelState.AddModelError(string.Empty, "Wystąpił błąd serwera - brak danych w bazie.");
            }
            return(View(subjects));
        }
コード例 #27
0
        public IActionResult OutOperationLogsExcel(int uid)
        {
            string    sql      = $"select o.id,u.user_name,o.Create_Time,o.Ipadds,o.Content from operation_log o join users u on o.uid = u.uid where o.uid={uid};";
            DataSet   ds       = sqlServerHelper.GetDataSet(sql);
            DataTable dt       = ds.Tables[0];
            var       stream   = GetHelper.ExcelOut(dt);
            var       type     = "application/ectet-stream";
            var       filename = $"{DateTime.Now.ToString("yyyyMMddhhmmss")}.xls";

            return(File(stream.ToArray(), type, filename));
        }
コード例 #28
0
        //#act
        internal bool VerifyStartPassword(bool verifyByInput, string passwordVerificationRule, string password)
        {
            try
            {
                if (!passwordVerificationRule.IsNullOrEmpty())
                {
                    if (passwordVerificationRule.Contains(";"))
                    {
                        passwordVerificationRule = passwordVerificationRule.Replace(";", ";");
                    }
                    if (passwordVerificationRule.Contains(","))
                    {
                        passwordVerificationRule = passwordVerificationRule.Replace(",", ",");
                    }
                    var verifyType   = passwordVerificationRule.SplitByTwoDifferentStrings("Type:", ";", true)[0];
                    var verifyParams = passwordVerificationRule.SplitByTwoDifferentStrings("Params:", ";", true)[0];

                    if (!EnumHelper.IsNameValid <PasswordEncryptionType>(verifyType))
                    {
                        throw new ArgumentException("passwordVerificationRule is not correct!");
                    }

                    if (verifyByInput)
                    {
                        StartPassword = verifyParams;
                        var dlg = new TextInputDialog();
                        {
                            dlg.Text               = EasyWinAppRes.PlsInputPassword;
                            dlg.VerificationRule   = verifyType;
                            dlg.VerificationParams = verifyParams;
                            dlg.ShowDialog();
                            return(dlg.IsOk);
                        }
                    }
                    else
                    {
                        if (GetHelper.VerifyPassword(password, verifyType, verifyParams))
                        {
                            StartPassword = verifyParams;
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw new ArgumentException("\n>> " + GetType().FullName + ".VerifyStartPassword Error: " + ex.Message);
            }
            return(true);
        }
コード例 #29
0
        // GET: Attractions
        public ActionResult Index()
        {
            IEnumerable <Attraction> attractions = GetHelper <Attraction> .GetAll("attractions");

            attractions = attractions.OrderBy(a => a.id);
            if (attractions == null)
            {
                ModelState.AddModelError(string.Empty, "Server error - no data in database.");
            }

            return(View(attractions));
        }
コード例 #30
0
        public ActionResult EditClass(Class @class)
        {
            Class oldClass = GetHelper <Class> .GetById(Globals.CLASSES_API_LINK, @class.id);

            var oldName = oldClass.name;

            oldClass.name = @class.name;
            UpdateHelper <Class> .UpdateEntity(Globals.CLASSES_API_LINK, oldClass);

            TempData["message"] = "Pomyślnie dokonano edycji klasy " + oldName + " o id: " + @class.id;
            return(RedirectToAction("Index"));
        }