Ejemplo n.º 1
0
 public static string Identifier(this AppEnum app, ModeEnum mode)
 {
     switch (app)
     {
         case AppEnum.AppleMaps:
             switch (mode)
             {
                 case ModeEnum.Walking:
                     return MKDirectionsMode.Walking.ToString();
                 case ModeEnum.Driving:
                 case ModeEnum.Taxi:// it is supported, but there's no key for this...
                     return MKDirectionsMode.Driving.ToString();
                 case ModeEnum.Transit:
                     return MKDirectionsMode.Transit.ToString();
                 default: return null;
             }
         case AppEnum.GoogleMaps:
             switch (mode)
             {
                 case ModeEnum.Walking:
                     return "walking";
                 case ModeEnum.Bicycling:
                     return "bicycling";
                 case ModeEnum.Driving:
                 case ModeEnum.Taxi: // it is supported, but there's no key for this...
                     return "driving";
                 case ModeEnum.Transit:
                     return "transit";
                 default: return null;
             }
         default: return null;
     }
 }
Ejemplo n.º 2
0
        //新增修改用户
        public ActionResult AddUser(string userSysNo)
        {
            //StringBuilder sbReturn = new StringBuilder();
            //sbReturn.Append("[{\"id\":\"1\", \"orgName\":\"技术部\", \"orgNum\":\"1001\"},{\"id\":\"2\", \"orgName\":\"人事部\", \"orgNum\":\"1002\"}]");
            //ViewData["UserTypeList"] = sbReturn.ToString();
            //用户类型
            DataTable dtUserType = AppEnum.GetEnumKeyName(typeof(AppEnum.UserType));

            ViewData["dtUserType"] = dtUserType;
            int uSysNo = -9999;

            if (!string.IsNullOrEmpty(userSysNo))
            {
                uSysNo = Convert.ToInt32(userSysNo);
                string  sSQL       = " SELECT * FROM DWZUser WHERE SysNo = '" + uSysNo + "' ";
                DataSet dsUserInfo = SqlHelper.ExecuteDataSet(ConfigurationManager.ConnectionStrings["Conn_DWZ"].ToString(), sSQL);
                if (dsUserInfo != null && dsUserInfo.Tables.Count > 0)
                {
                    ViewData["uSysNo"] = uSysNo;
                    return(View(dsUserInfo));
                }
            }
            ViewData["uSysNo"] = uSysNo;
            return(View());
        }
Ejemplo n.º 3
0
        public string GetLatestArticleQADiv(int Type, int Top)
        {
            string  sql = "select top " + Top + " sysno,question,createtime from qa where status=0 and type=" + Type + " order by createtime desc";
            DataSet ds  = SqlHelper.ExecuteDataSet(sql);

            if (!Util.HasMoreRow(ds))
            {
                return("");
            }

            StringBuilder sb = new StringBuilder();

            sb.Append("<div id=zxzt class=panelr>");
            sb.Append("<div class=panelr_title1>");
            sb.Append("<div class=title>" + AppEnum.GetQAType(Type) + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='../Service/News.aspx?Type=Article&Type2=" + Type + "' style='color:#205E8A; padding-right:3px;'>更多...</a></div>");
            sb.Append("</div>");
            sb.Append("<div class=cxgg_content>");
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                sb.Append("<div class=cxgg_li><a href='../Service/NewsDetail.aspx?Type=Article&ID=" + Util.TrimIntNull(dr["sysno"].ToString()) + "'>" + Util.TrimNull(dr["question"]) + "</a></div>");
            }
            sb.Append("</div>");
            sb.Append("</div>");
            return(sb.ToString());
        }
Ejemplo n.º 4
0
        protected void FormPrepare()
        {
            switch (tab)
            {
            case 1:
                RadioButtonList1.DataSource     = AppEnum.GetGender();
                RadioButtonList1.DataTextField  = "value";
                RadioButtonList1.DataValueField = "key";
                RadioButtonList1.DataBind();
                District2.IsShowLatLng    = false;
                District2.IsShowOnlyChina = false;

                drpFateType.SelectedIndex  = drpFateType.Items.IndexOf(drpFateType.Items.FindByValue(m_user.FateType.ToString()));
                drpBirthType.SelectedIndex = drpBirthType.Items.IndexOf(drpBirthType.Items.FindByValue(m_user.IsShowBirth.ToString()));
                if (m_user.Birth != AppConst.DateTimeNull)
                {
                    DatePicker2.SelectedTime = m_user.Birth;
                }
                else
                {
                    DatePicker2.SelectedTime = new DateTime(1990, 1, 1);
                }
                if (m_user.HomeTown != AppConst.IntNull)
                {
                    District2.Area3SysNo = m_user.HomeTown;
                }
                if (m_user.Gender != AppConst.IntNull)
                {
                    RadioButtonList1.SelectedIndex = RadioButtonList1.Items.IndexOf(RadioButtonList1.Items.FindByValue(m_user.Gender.ToString()));
                }
                txtIntro.Text = m_user.Intro;
                break;
            }
        }
Ejemplo n.º 5
0
        private void barMainEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (e.Item.Tag != null)
            {
                string    strMenuName = e.Item.Tag.ToString();
                WsToolBar oToolButton = AppEnum.GetToolBarEnum(strMenuName);
                switch (oToolButton)
                {
                case WsToolBar.Enter:
                    this.mbllPopUpResult = true;
                    this.pmEnterForm();
                    break;

                case WsToolBar.Exit:
                    //this.DialogResult = DialogResult.Cancel;
                    this.mbllPopUpResult = false;
                    this.Hide();
                    break;

                case WsToolBar.Refresh:
                    this.pmRefreshBrowView();
                    break;
                }
            }
        }
Ejemplo n.º 6
0
        public void Import()
        {
            if (!AppConfig.IsImportable)
            {
                throw new BizException("Is Importable is false");
            }

            string  sql = " select top 1 * from Sys_Sync ";
            DataSet ds  = SqlHelper.ExecuteDataSet(sql);

            if (Util.HasMoreRow(ds))
            {
                throw new BizException("the table Sync is not empty");
            }

            TransactionOptions options = new TransactionOptions();

            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout        = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                SortedList sl = AppEnum.GetSync();
                foreach (int syncType in sl.Keys)
                {
                    SyncInfo oInfo = new SyncInfo();
                    oInfo.SyncType        = syncType;
                    oInfo.LastVersionTime = DateTime.Now;

                    new SyncDac().Insert(oInfo);
                }

                scope.Complete();
            }
        }
        /// <summary>
        /// Select a group of elements based on their periodic family
        /// </summary>
        /// <param name="family">The family to search for, from the AppEnum.Family enumerable</param>
        /// <returns>List of Element</returns>
        public IEnumerable<Element> SelectEachMember(AppEnum.Family family)
        {
            List<Element> searchResults = new List<Element>();
            //if there are no elements in the list
            if (!this.elements.Any())
            {
                //throw an exception
                throw new ArgumentException("EmptyList");
            }

            //otherwise, look through all the existing elements for any matches
            foreach (Element element in this.elements)
            {
                if (element.family == family)
                {
                    searchResults.Add(element);
                }
            }

            //if no matches were found, throw an exception
            if (!searchResults.Any())
            {
                throw new ArgumentException("FamilyMembersNotFound");
            }

            //otherwise, return the list of results
            return searchResults;
        }
Ejemplo n.º 8
0
        protected void BindList()
        {
            DataTable m_dt  = new DataTable();
            int       total = 0;

            switch (tab)
            {
            case 0:
                DropDownList1.DataSource     = AppEnum.GetCashReturnReason();
                DropDownList1.DataTextField  = "value";
                DropDownList1.DataValueField = "key";
                DropDownList1.DataBind();
                break;

            case 1:
                m_dt = ORD_ReturnCashBll.GetInstance().GetList(pagesize, pageindex, GetSession().CustomerEntity.SysNo, AppConst.IntNull, AppConst.IntNull, AppConst.IntNull, "", ref total);
                m_dt.Columns.Add("content");
                m_dt.Columns.Add("target");
                for (int i = 0; i < m_dt.Rows.Count; i++)
                {
                    if ((m_dt.Rows[i]["producttype"].ToString() == ((int)AppEnum.CashOrderType.consultget).ToString() || m_dt.Rows[i]["producttype"].ToString() == ((int)AppEnum.CashOrderType.consultpay).ToString()) &&
                        m_dt.Rows[i]["productsysno"] != null && m_dt.Rows[i]["productsysno"].ToString() != "")
                    {
                        try
                        {
                            DataTable tmp_dt = QA_OrderBll.GetInstance().GetOrderDetail(int.Parse(m_dt.Rows[i]["productsysno"].ToString()));
                            if (tmp_dt.Rows.Count > 0)
                            {
                                m_dt.Rows[i]["content"] = AppEnum.GetCashOrderType(int.Parse(m_dt.Rows[i]["producttype"].ToString()));
                                if (m_dt.Rows[i]["producttype"].ToString() == ((int)AppEnum.CashOrderType.consultget).ToString())
                                {
                                    m_dt.Rows[i]["target"] = tmp_dt.Rows[0]["questuname"].ToString();
                                }
                                else if (m_dt.Rows[i]["producttype"].ToString() == ((int)AppEnum.CashOrderType.consultpay).ToString())
                                {
                                    m_dt.Rows[i]["target"] = tmp_dt.Rows[0]["orderuname"].ToString();
                                }
                            }
                        }
                        catch { }
                    }
                }
                Repeater2.DataSource = m_dt;
                Repeater2.DataBind();
                break;
            }

            Pager1.url         = "MyAccount.aspx?tab=" + tab + "&pn=";
            Pager1.totalrecord = total;
            if (total % AppConst.PageSize == 0)
            {
                this.Pager1.total = total / pagesize;
            }
            else
            {
                this.Pager1.total = total / pagesize + 1;
            }
            this.Pager1.index    = pageindex;
            this.Pager1.numlenth = 3;
        }
Ejemplo n.º 9
0
 public static string Name(AppEnum app)
 {
     switch (app)
     {
         case AppEnum.AppleMaps:
             return "Apple Maps";
         case AppEnum.GoogleMaps:
             return "Google Maps";
         default: return string.Empty;
     }
 }
Ejemplo n.º 10
0
 public static string UrlScheme(this AppEnum app)
 {
     switch (app)
     {
         case AppEnum.AppleMaps:
             return string.Empty;
         case AppEnum.GoogleMaps:
             return "comgooglemaps://";
         default: return null;
     }
 }
Ejemplo n.º 11
0
        public string GetRMASnapShot(RMAInfo oParam)
        {
            StringBuilder sb = new StringBuilder();

            if (oParam.ItemHash.Count > 0)
            {
                sb.Append("<table class=\"GridViewStyle\" cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"Table99\" style=\"width: 100%;border-collapse: collapse;\">");
                sb.Append("	<tr class=\"GridViewHeaderStyle\">");
                sb.Append("	 <td>" + oParam.RMAID + "</td>");
                sb.Append("	 <td>商品名称</td>");
                sb.Append("  <td>返修数量</td>");
                sb.Append("	 <td>返修类型</td>");
                sb.Append("  <td>返修原因</td>");
                sb.Append(" </tr>");
                Hashtable SysnoHt = new Hashtable();
                foreach (RMAItemInfo item in oParam.ItemHash.Values)
                {
                    SysnoHt.Add(item.ProductSysNo, item.ProductSysNo);
                }
                Hashtable PbHt = Icson.BLL.Basic.ProductManager.GetInstance().GetProductBoundle(SysnoHt);
                int       i    = 1;
                foreach (RMAItemInfo item in oParam.ItemHash.Values)
                {
                    if ((i % 2) != 0)
                    {
                        sb.Append("<tr class=\"GridViewRowStyle\" onmouseout=\"this.style.backgroundColor=currentcolor,this.style.fontWeight=&quot;&quot;;\" onmouseover=\"currentcolor=this.style.backgroundColor;this.style.backgroundColor=&quot;#d8e3e7&quot;,this.style.fontWeight=&quot;&quot;;jquery_Tools_showthis(this);\">");
                    }
                    else
                    {
                        sb.Append("<tr class=\"GridViewAlternatingRowStyle\" onmouseout=\"this.style.backgroundColor=currentcolor,this.style.fontWeight=&quot;&quot;;\" onmouseover=\"currentcolor=this.style.backgroundColor;this.style.backgroundColor=&quot;#d8e3e7&quot;,this.style.fontWeight=&quot;&quot;;jquery_Tools_showthis(this);\">");
                    }
                    i++;
                    foreach (ProductBasicInfo PbInfo in PbHt.Values)
                    {
                        if (PbInfo.SysNo == item.ProductSysNo)
                        {
                            sb.Append("<td>");
                            sb.Append(PbInfo.ProductID);
                            sb.Append("</td>");
                            sb.Append("<td>");
                            sb.Append(PbInfo.ProductName);
                            sb.Append("</td>");
                            break;
                        }
                    }
                    sb.Append(" <td>" + item.RMAQty.ToString() + "</td>");
                    sb.Append(" <td>" + AppEnum.GetRMAType(item.RMAType) + "</td>");
                    sb.Append(" <td>" + item.RMADesc + "</td>");
                    sb.Append("</tr>");
                }
                sb.Append("</table>");
            }
            return(sb.ToString());
        }
Ejemplo n.º 12
0
    public void LoadScene(AppEnum app)
    {
        AppConfigurations config = _importer.GetAppConfigs(app);
        var operation            = SceneManager.LoadSceneAsync(config.Scene.name, LoadSceneMode.Additive);

        operation.completed += _ =>
        {
            SceneManager.SetActiveScene(SceneManager.GetSceneByName(config.Scene.name));
        };

        _mainScreenObjects.SetActive(false);
    }
Ejemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region 初始化
            //Login(Request.RawUrl);
            WebForAnalyse.Master.AdminMaster m_master = (WebForAnalyse.Master.AdminMaster) this.Master;
            m_master.PageName = "八字组合设置";
            m_master.SetCate(WebForAnalyse.Master.AdminMaster.CateType.BaZi3);
            #endregion
            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                sysno = int.Parse(Request.QueryString["id"]);
            }
            if (!IsPostBack)
            {
                drpType.DataSource     = AppEnum.GetBaZiLogicType();
                drpType.DataTextField  = "value";
                drpType.DataValueField = "key";
                drpType.DataBind();
                drpType.Items.Insert(0, new ListItem("请选择", "-1"));

                if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
                {
                    PrepareForm();
                }

                int total = 0;
                LogicList = RSH_BaziLogicBll.GetInstance().GetList(1000, 1, "", sysno, ref total);

                DataTable m_dt = new DataTable();
                m_dt.Columns.Add("id");
                for (int i = 0; i < 50; i++)
                {
                    DataRow m_dr = m_dt.NewRow();
                    m_dr["id"] = i;
                    m_dt.Rows.Add(m_dr);
                }
                Repeater1.DataSource = m_dt;
                Repeater1.DataBind();

                //this.ClientScript.RegisterStartupScript(this.GetType(), "", "show(0);", true);
            }
            string jsstr = "";
            for (int i = 0; i <= int.Parse(HiddenField1.Value); i++)
            {
                jsstr += "show(" + i + ");";
            }
            string[] tmpstrs = HiddenField2.Value.Substring(1).Split(new char[] { '|' });
            for (int i = 0; i < tmpstrs.Length; i++)
            {
                jsstr += "convert(" + tmpstrs[i] + ");";
            }
            ScriptManager.RegisterStartupScript(UpdatePanel2, UpdatePanel2.GetType(), "", jsstr, true);
        }
Ejemplo n.º 14
0
 public static bool Supports(this AppEnum app, ModeEnum mode)
 {
     if (mode == ModeEnum.Default)
         return true;
     switch (app)
     {
         case AppEnum.AppleMaps:
             return mode != ModeEnum.Bicycling;
         case AppEnum.GoogleMaps:
             return true;
         default: return false;
     }
 }
Ejemplo n.º 15
0
        public ActionResult TestPageK(FormCollection form)
        {
            //用户类型
            DataTable dtUserType = AppEnum.GetEnumKeyName(typeof(AppEnum.UserType));

            ViewData["dtUserType"] = dtUserType;

            int pageIndex  = 1;
            int pageCount  = 2;
            int totalCount = 0;

            if (Request.Form["pageNum"] != null)
            {
                pageIndex = Convert.ToInt32(Request.Form["pageNum"]);
            }
            if (Request.Form["numPerPage"] != null)
            {
                pageCount = Convert.ToInt32(Request.Form["numPerPage"]);
            }
            //用户列表
            Hashtable ht        = new Hashtable();
            string    sUserID   = Request.Form["sUserID"];
            string    sUserType = Request.Form["sUserType"];
            string    sDesc     = Request.Form["orderDirection"];

            if (!string.IsNullOrEmpty(sUserID))
            {
                ht.Add("UserID", sUserID);
                ViewData["uUserID"] = sUserID;//
            }
            if (!string.IsNullOrEmpty(sUserType) && sUserType != "-9999")
            {
                ht.Add("UserType", sUserType);
                ViewData["uUserType"] = sUserType;//
            }
            if (string.IsNullOrEmpty(sDesc))
            {
                sDesc = "DESC";
            }
            ht.Add("Sort", sDesc);
            DataSet dsUserList = GetUserDs(pageIndex, pageCount, ht);

            totalCount             = Convert.ToInt32(dsUserList.Tables[1].Rows[0][0]);
            ViewData["dsUserList"] = dsUserList;

            ViewData["pageIndex"]  = pageIndex;
            ViewData["pageCount"]  = pageCount;
            ViewData["totalCount"] = totalCount;
            //return PartialView();
            return(View());
        }
Ejemplo n.º 16
0
        private void DoSync(int syncType)
        {
            string className = AppEnum.GetSync(syncType);
            Type   type      = Type.GetType(className);

            if (type == null)               //如果添加新的需要同步的类,就先在数据库里增加,在没有更新程序以前,className 应该是Unknown, Type.GetType的返回就会是null。
            {
                return;
            }
            MethodInfo     method = type.GetMethod("GetInstance");
            IInitializable iInit  = (IInitializable)method.Invoke(null, null);

            iInit.Init();
            RegisterLastVersion(syncType);
        }
Ejemplo n.º 17
0
        public static bool IsInstalled(this AppEnum app)
        {
            if (AppEnum.AppleMaps == app)
            {
                return(true);
            }

            var urlScheme = app.UrlScheme();

            if (urlScheme == null)
            {
                return(false);
            }

            return(UIApplication.SharedApplication.CanOpenUrl(new Foundation.NSUrl(urlScheme)));
        }
Ejemplo n.º 18
0
        public static double GetHeightToDrop(AppEnum.Level _level)
        {
            double result = 0;
            switch (_level)
            {
                case AppEnum.Level.level1:
                    result = AppConstant.Level1_Height_ToDrop;
                    break;
                case AppEnum.Level.level2:
                    result = AppConstant.Level2_Height_ToDrop;
                    break;
                case AppEnum.Level.level3:
                    result = AppConstant.Level3_Height_ToDrop;
                    break;
            }

            return result;
        }
Ejemplo n.º 19
0
        public static int GetPointsToAdd(AppEnum.Level _level)
        {
            int result = 0;
            switch (_level)
            {
                case AppEnum.Level.level1:
                    result = 100;
                    break;
                case AppEnum.Level.level2:
                    result = 250;
                    break;
                case AppEnum.Level.level3:
                    result = 500;
                    break;
            }

            return result;
        }
Ejemplo n.º 20
0
        public static string GetUrlBasedNodeTypeForFilter(string url,CalendarFilterProxy calendarFilter,AppEnum.CalendarFilterTypes calendarFilterType,AppEnum.ProviderType provider)
        {
            //string urlFilter = String.Empty;
            AppEnum.CalendarViewTypes calendarViewTypes = (AppEnum.CalendarViewTypes)Enum.Parse(typeof(AppEnum.CalendarViewTypes), calendarFilter.CalendarView, true);
            switch (calendarViewTypes)
            {
                //For Single Providers   --> "SimApp/Courses/CID/ROLE/UID/Assignments/SID/Appointments/Type/PatientVisit/SingleProvider/{0}/{1}/{2}/{3}/{4}"
                // Example                  --> "SimApp/Courses/CID/ROLE/UID/Assignments/SID/Appointments/Type/PatientVisit/SingleProvider/{YYYYMM}/{WeekOfYear}/{Day}/{ProviderId}/{DictionaryOfAppointments}"

                //For Multiple Providers --> "SimApp/Courses/CID/ROLE/UID/Assignments/SID/Appointments/Type/PatientVisit/SingleProvider/{0}/{1}/{2}/{3}"
                // Example                   --> "SimApp/Courses/CID/ROLE/UID/Assignments/SID/Appointments/Type/PatientVisit/MultipleProviders/{YYYYMM}/{WeekOfYear}/{Day}/{DictionaryOfAppointments}"
                case AppEnum.CalendarViewTypes.month:
                    url= url.Remove(url.IndexOf("/{1}"));
                    return url= string.Format(url, AppCommon.GetMonthNode(calendarFilter.StartDate));
                case AppEnum.CalendarViewTypes.resourceDay:
                case AppEnum.CalendarViewTypes.agendaDay:
                    if (calendarFilterType.Equals(AppEnum.CalendarFilterTypes.Provider) &&
                        provider == AppEnum.ProviderType.SingleProvider)
                    {
                        url = url.Remove(url.IndexOf("/{4}"));
                        url = string.Format(url, AppCommon.GetMonthNode(calendarFilter.StartDate), AppCommon.GetWeekNode(calendarFilter.StartDate),AppCommon.GetDayNode(calendarFilter.StartDate),calendarFilter.ProviderId);
                    }else{
                        url = url.Remove(url.IndexOf("/{3}"));
                         url = string.Format(url, AppCommon.GetMonthNode(calendarFilter.StartDate), AppCommon.GetWeekNode(calendarFilter.StartDate), AppCommon.GetDayNode(calendarFilter.StartDate));
                    }
                    break;
                case AppEnum.CalendarViewTypes.agendaWeek:
                    url = url.Remove(url.IndexOf("/{2}"));
                    if(calendarFilter.StartDate.Month!= calendarFilter.EndDate.Month)
                    {
                        url = string.Format(url, AppCommon.GetMonthNode(calendarFilter.StartDate), AppCommon.GetWeekNode(calendarFilter.StartDate))
                                + AppCommon.DataDelimiter + string.Format(url, AppCommon.GetMonthNode(calendarFilter.EndDate), AppCommon.GetWeekNode(calendarFilter.StartDate));
                    } else
                    {
                        url = string.Format(url, AppCommon.GetMonthNode(calendarFilter.StartDate),
                                      AppCommon.GetWeekNode(calendarFilter.StartDate));
                    }
                    break;
                case AppEnum.CalendarViewTypes.None:
                    url = url.Remove(url.IndexOf("/{0}"));
                    break;
            }
            return url;
        }
Ejemplo n.º 21
0
        public MessageMetadata GetMetadata(int userId)
        {
            var metadata = new MessageMetadata();

            using (var cn = new SqlConnection(this.executor.ConnectionString))
            {
                using (var cmd = new SqlCommand("GetMessagesMetadata", cn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add(new SqlParameter("userId", userId));
                    cn.Open();

                    using (var reader = cmd.ExecuteReader())
                    {
                        if (reader.HasRows)
                        {
                            // read enum types
                            while (reader.Read())
                            {
                                var appEnum = new AppEnum();
                                appEnum.ID              = reader.ValueOrDefault <int>("EnumID");
                                appEnum.Desc            = reader.ValueOrDefault <string>("EnumDesc");
                                appEnum.AppEnumTypeID   = reader.ValueOrDefault <int>("EnumTypeID");
                                appEnum.AppEnumTypeName = reader.ValueOrDefault <string>("EnumTypeName");
                                metadata.Enums.Add(appEnum);
                            }

                            // read churches
                            reader.NextResult();
                            while (reader.Read())
                            {
                                var church = new Church();
                                church.id   = reader.ValueOrDefault <int>("ChurchId");
                                church.Name = reader.ValueOrDefault <string>("Name");
                                metadata.Churches.Add(church);
                            }
                        }
                    }
                }
            }

            return(metadata);
        }
Ejemplo n.º 22
0
 public static MKDirectionsMode IdentifierApple(this AppEnum app, ModeEnum mode)
 {
     switch (app)
     {
         case AppEnum.AppleMaps:
             switch (mode)
             {
                 case ModeEnum.Walking:
                     return MKDirectionsMode.Walking;
                 case ModeEnum.Driving:
                 case ModeEnum.Taxi:// it is supported, but there's no key for this...
                     return MKDirectionsMode.Driving;
                 case ModeEnum.Transit:
                     return MKDirectionsMode.Transit;
                 default: return MKDirectionsMode.Default;
             }
         default: return MKDirectionsMode.Default;
     }
 }
Ejemplo n.º 23
0
 public void EliminatePoint(AppEnum.Level level)
 {
     switch (level)
     {
         case AppEnum.Level.level1:
             obaEliminatePoint600_01.SetValue(Storyboard.TargetNameProperty, imgEliminate60Points.Name);
             obaEliminatePoint600_02.SetValue(Storyboard.TargetNameProperty, imgEliminate60Points.Name);
             obaEliminatePoint600_03.SetValue(Storyboard.TargetNameProperty, imgEliminate60Points.Name);
             break;
         case AppEnum.Level.level2:
             obaEliminatePoint600_01.SetValue(Storyboard.TargetNameProperty, imgEliminate100Points.Name);
             break;
         case AppEnum.Level.level3:
             obaEliminatePoint600_01.SetValue(Storyboard.TargetNameProperty, imgEliminate200Points.Name);
             break;
     }
     StbEliminatePoint.Begin();
     StbEliminatePoint.Completed += new EventHandler(StbEliminatePoint_Completed);
 }
Ejemplo n.º 24
0
        public void LoginCheck(string username, string password)
        {
            USR_CustomerMod m_user = USR_CustomerBll.GetInstance().CheckUser(username, password);

            if (m_user.SysNo != AppConst.IntNull)//COOKIES验证成功
            {
                SetSession(m_user);
                //记住我
                if (CheckBox1.Checked)
                {
                    HttpCookie Cookie = CookiesHelper.GetCookie("upup1000");
                    if (Cookie == null || Cookie.Value == null || Cookie.Value == "")
                    {
                        Cookie = new HttpCookie("upup1000");
                        Cookie.Values.Add("uname", CommonTools.Encode(username));
                        Cookie.Values.Add("psd", CommonTools.Encode(password));
                        //设置Cookie过期时间
                        Cookie.Expires = DateTime.Now.AddYears(50);
                        CookiesHelper.AddCookie(Cookie);
                    }
                    else
                    {
                        CookiesHelper.SetCookie("upup1000", "uname", CommonTools.Encode(username), DateTime.Now.AddYears(50));
                        CookiesHelper.SetCookie("upup1000", "psd", CommonTools.Encode(password), DateTime.Now.AddYears(50));
                    }
                }
                LogManagement.getInstance().WriteTrace("前台会员登录", "Login", "IP:" + Request.UserHostAddress + "|UserID:" + GetSession().CustomerEntity.Email);
                //跳转
                if (Request.QueryString["url"] != null && Request.QueryString["url"] != "")
                {
                    Response.Redirect(Request.QueryString["url"]);
                }
                else
                {
                    Response.Redirect("../Qin/View/" + m_user.SysNo);
                }
            }
            else
            {
                password1Tip.InnerHtml = AppEnum.GetErrorType(2);
            }
        }
Ejemplo n.º 25
0
 public void AddPoint(AppEnum.Level level)
 {
     switch (level)
     {
         case AppEnum.Level.level1:
             obaStbAddPoint100_01.SetValue(Storyboard.TargetNameProperty, imgAdd100Points.Name);
             damStbAddPoint100_02.SetValue(Storyboard.TargetNameProperty, imgAdd100Points.Name);
             break;
         case AppEnum.Level.level2:
             obaStbAddPoint100_01.SetValue(Storyboard.TargetNameProperty, imgAdd250Points.Name);
             damStbAddPoint100_02.SetValue(Storyboard.TargetNameProperty, imgAdd250Points.Name);
             break;
         case AppEnum.Level.level3:
             obaStbAddPoint100_01.SetValue(Storyboard.TargetNameProperty, imgAdd500Points.Name);
             damStbAddPoint100_02.SetValue(Storyboard.TargetNameProperty, imgAdd500Points.Name);
             break;
     }
     StbAddPoint.Begin();
     StbAddPoint.Completed += new EventHandler(StbAddPoint_Completed);
 }
Ejemplo n.º 26
0
        public string BaziToHTML(BaZiMod mod)
        {
            string ret = "";

            ret += mod.BirthTime.Date.ToString("yyyy-MM-dd HH:mm") + "  (" + AppEnum.GetGender(mod.Gender) + ")<br />";
            ret += PublicValue.GetTianGan(mod.YearTG) + PublicValue.GetDiZhi(mod.YearDZ) + " " +
                   PublicValue.GetTianGan(mod.MonthTG) + PublicValue.GetDiZhi(mod.MonthDZ) + " " +
                   PublicValue.GetTianGan(mod.DayTG) + PublicValue.GetDiZhi(mod.DayDZ) + " " +
                   PublicValue.GetTianGan(mod.HourTG) + PublicValue.GetDiZhi(mod.HourDZ) + " " +
                   PublicValue.GetTianGan(BaZiBiz.GetInstance().MinuteTG(mod.HourTG, mod.BirthTime.Date.Minute + (mod.BirthTime.Date.Hour + 1) % 2 * 60)) +
                   PublicValue.GetDiZhi(BaZiBiz.GetInstance().MinuteDZ(mod.BirthTime.Date.Minute + (mod.BirthTime.Date.Hour + 1) % 2 * 60)) + " " +
                   "(" + PublicValue.GetDiZhi(mod.XunKong0) + PublicValue.GetDiZhi(mod.XunKong1) + "空)<br /><br />";
            ret += "大运:";
            for (int i = 0; i < dayun; i++)
            {
                ret += PublicValue.GetTianGan(mod.Dayun[i].YearTG) + PublicValue.GetDiZhi(mod.Dayun[i].YearDZ) + " " +
                       PublicValue.GetShiShen(PublicDeal.GetInstance().GZWuXing(new WuXingRelation(mod.Dayun[i].YearTG, mod.YearTG)).ShiShen) + "|";
            }
            ret += "<br />";
            ret += "始于:";
            for (int i = 0; i < dayun; i++)
            {
                ret += mod.Dayun[i].Begin.ToString() + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|";
            }
            ret += "<br />";
            ret += "流年:";
            for (int i = 0; i < 10; i++)
            {
                if (i != 0)
                {
                    ret += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                }
                for (int j = 0; j < dayun; j++)
                {
                    ret += PublicValue.GetTianGan(BaZiBiz.GetInstance().YearTG(mod.Dayun[j].Begin + i)) + PublicValue.GetDiZhi(BaZiBiz.GetInstance().YearDZ(mod.Dayun[j].Begin + i)) + " " +
                           PublicValue.GetShiShen(PublicDeal.GetInstance().GZWuXing(new WuXingRelation(BaZiBiz.GetInstance().YearTG(mod.Dayun[j].Begin + i), mod.DayTG)).ShiShen) + "|";
                }
                ret += "<br />";
            }
            return(ret);
        }
Ejemplo n.º 27
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["type"] == "logout")
         {
             Session[AppConfig.CustomerSession] = null;
             HttpCookie Cookie = CookiesHelper.GetCookie("upup1000");
             if (Cookie != null && Cookie.Value != null && Cookie.Value != "")
             {
                 CookiesHelper.SetCookie("upup1000", "uname", "", DateTime.Now.AddYears(-1));
                 CookiesHelper.SetCookie("upup1000", "psd", "", DateTime.Now.AddYears(-1));
             }
         }
         else if (Request.QueryString["error"] != null && Request.QueryString["error"] != "")
         {
             try
             {
                 email.Text             = Request.QueryString["email"];
                 password1Tip.InnerText = AppEnum.GetErrorType(int.Parse(Request.QueryString["error"]));
                 return;
             }
             catch
             { }
         }
         try
         {
             if (Request.Cookies["upup1000"]["uname"] != null && Request.Cookies["upup1000"]["uname"] != string.Empty &&
                 Request.Cookies["upup1000"]["psd"] != null && Request.Cookies["upup1000"]["psd"] != string.Empty)
             {
                 string username = CommonTools.Decode(Request.Cookies["upup1000"]["uname"]);
                 string password = CommonTools.Decode(Request.Cookies["upup1000"]["psd"]);
                 LoginCheck(username, password);
                 Response.Cache.SetCacheability(HttpCacheability.NoCache);
             }
         }
         catch { }
         Unnamed1.Focus();
     }
 }
Ejemplo n.º 28
0
        private void barMainEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (e.Item.Tag != null)
            {
                string    strMenuName = e.Item.Tag.ToString();
                WsToolBar oToolButton = AppEnum.GetToolBarEnum(strMenuName);
                switch (oToolButton)
                {
                case WsToolBar.Print:
                    this.pmPrintData();
                    break;

                case WsToolBar.Save:
                    this.pmSaveData();
                    break;

                case WsToolBar.Exit:
                    this.Close();
                    break;
                }
            }
        }
Ejemplo n.º 29
0
        public List <AppEnum> GetProfileMetadata(int churchId, int userId)
        {
            var paramz = new List <SqlParameter>();

            paramz.Add(new SqlParameter("churchId", churchId));
            paramz.Add(new SqlParameter("userId", userId));

            Func <SqlDataReader, AppEnum> readFx = (reader) =>
            {
                var appEnum = new AppEnum();
                appEnum.ID              = reader.ValueOrDefault <int>("EnumID");
                appEnum.Desc            = reader.ValueOrDefault <string>("EnumDesc");
                appEnum.AppEnumTypeID   = reader.ValueOrDefault <int>("EnumTypeID");
                appEnum.AppEnumTypeName = reader.ValueOrDefault <string>("EnumTypeName");

                return(appEnum);
            };

            var list = _executor.ExecuteSql <AppEnum>("GetMemberProfileMetadata", CommandType.StoredProcedure, paramz, readFx);

            return(list);
        }
Ejemplo n.º 30
0
        [DisableAuditing]//不添加日志
        public PagedResultOutput <PageElementQueryDto> GetPageElementQuery(GetPageElementQueryInput input)
        {
            if (input.MaxResultCount <= 0)
            {
                input.MaxResultCount = SettingManager.GetSettingValue <int>(MySettingProvider.QuestionsDefaultPageSize);
            }

            var query = _pageElementRepository.GetAll()
                        //TODO:根据传入的参数添加过滤条件
                        //.WhereIf(input.PageElementCategoryId.HasValue, m => m.PageElementCategoryId == input.PageElementCategoryId)
                        .WhereIf(input.ElementType != 0, m => m.ElementType == input.ElementType)
                        .WhereIf(input.PagesId != 0, m => m.PageId == input.PagesId)
                        .WhereIf(!input.Keywords.IsNullOrWhiteSpace(), m => m.Title.Contains(input.Keywords)).OrderBy(input.Sorting);
            var totalCount = query.Count();
            var list       = query.ToList();

            List <PageElementQueryDto> PageElementlist = new List <PageElementQueryDto>();

            foreach (PageElementQueryDto item in list.MapTo <List <PageElementQueryDto> >())
            {
                if (item.LastModifierUserId != null)
                {
                    User user = _userManager.Users.FirstOrDefault(u => u.Id == item.LastModifierUserId.Value);
                    item.UserName = user.UserName + "[" + item.LastModificationTime + "]";
                }
                item.StatusName      = AppEnum.GetBiStatus(item.Status);
                item.ElementTypeName = AppEnum.GetElementType(item.ElementType);
                item.Icon            = "<i class=\"fa fa-arrows\"></i>";
                PageElementlist.Add(item);
            }
            return(new PagedResultOutput <PageElementQueryDto>
            {
                TotalCount = totalCount,
                Items = PageElementlist
            });
        }
Ejemplo n.º 31
0
        [DisableAuditing]//不添加日志
        public PagedResultOutput <PageQueryDto> GetPageQuery(GetPageQueryInput input)
        {
            if (input.MaxResultCount <= 0)
            {
                input.MaxResultCount = SettingManager.GetSettingValue <int>(MySettingProvider.QuestionsDefaultPageSize);
            }

            var query = _pageRepository.GetAll()
                        //TODO:根据传入的参数添加过滤条件
                        .WhereIf(input.Status != 0, m => m.Status == input.Status)
                        .WhereIf(input.PageType != 0, m => m.PageType == input.PageType)
                        .WhereIf(input.StoreId != 0, m => m.StoreId == input.StoreId)
                        .WhereIf(!input.Keywords.IsNullOrWhiteSpace(), m => m.Name.Contains(input.Keywords)).OrderBy(input.Sorting);
            var totalCount = query.Count();
            var list       = query.PageBy(input).ToList();
            List <PageQueryDto> Pagelist = new List <PageQueryDto>();

            foreach (PageQueryDto item in list.MapTo <List <PageQueryDto> >())
            {
                User user = _userManager.Users.FirstOrDefault(u => u.Id == item.CreatorUserId.Value);
                item.UserName = user.UserName;
                if (item.StoreId != null && item.StoreId != "0")
                {
                    item.StoreId = _storeAppService.GetStores(Convert.ToInt32(item.StoreId)).Title;
                }
                item.PageTypeName     = AppEnum.GetPageType(item.PageType);
                item.StatusName       = AppEnum.GetPageStatus(item.Status);
                item.PagePositionName = AppEnum.GetPagePosition(item.PagePosition);
                Pagelist.Add(item);
            }
            return(new PagedResultOutput <PageQueryDto>
            {
                TotalCount = totalCount,
                Items = Pagelist
            });
        }
Ejemplo n.º 32
0
        public ReportMetadata GetMetadata(int churchId, int userId)
        {
            var metadata = new ReportMetadata();

            using (var cn = new SqlConnection(_executor.ConnectionString))
            {
                using (var cmd = new SqlCommand("GetReportMetadata", cn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add(new SqlParameter("churchId", churchId));
                    cmd.Parameters.Add(new SqlParameter("userId", userId));
                    cn.Open();

                    using (var reader = cmd.ExecuteReader())
                    {
                        if (reader.HasRows)
                        {
                            // read enum types
                            while (reader.Read())
                            {
                                var appEnum = new AppEnum();
                                appEnum.ID                = reader.ValueOrDefault <int>("EnumID");
                                appEnum.Desc              = reader.ValueOrDefault <string>("EnumDesc");
                                appEnum.AppEnumTypeID     = reader.ValueOrDefault <int>("EnumTypeID");
                                appEnum.AppEnumTypeName   = reader.ValueOrDefault <string>("EnumTypeName");
                                appEnum.OptionsEnumTypeID = reader.ValueOrDefault <int>("OptionsEnumTypeID");

                                metadata.Enums.Add(appEnum);
                            }

                            // read churches
                            reader.NextResult();
                            while (reader.Read())
                            {
                                var church = new Church();
                                church.id   = reader.ValueOrDefault <int>("Id");
                                church.Name = reader.ValueOrDefault <string>("Name");

                                metadata.Churches.Add(church);
                            }

                            // read teams
                            reader.NextResult();
                            while (reader.Read())
                            {
                                var team = new NtccSteward.Core.Models.Team.Team();
                                team.Id   = reader.ValueOrDefault <int>("TeamId");
                                team.Name = reader.ValueOrDefault <string>("Name");

                                metadata.Teams.Add(team);
                            }

                            // read members
                            reader.NextResult();
                            while (reader.Read())
                            {
                                var member = new Core.Models.Members.Member();
                                member.id        = reader.ValueOrDefault <int>("Id");
                                member.FirstName = reader.ValueOrDefault <string>("FirstName");
                                member.LastName  = reader.ValueOrDefault <string>("LastName");
                                member.TeamId    = reader.ValueOrDefault <int>("TeamId");

                                metadata.Members.Add(member);
                            }
                        }
                    }
                }
            }

            return(metadata);
        }
Ejemplo n.º 33
0
        private void barMainEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (e.Item.Tag != null)
            {
                string    strMenuName = e.Item.Tag.ToString();
                WsToolBar oToolButton = AppEnum.GetToolBarEnum(strMenuName);
                switch (oToolButton)
                {
                case WsToolBar.Enter:
                    this.pmEnterForm();
                    break;

                case WsToolBar.Insert:
                    if (App.PermissionManager.CheckPermission(TASKNAME, AuthenType.CanInsert, App.AppUserName, App.AppUserID))
                    {
                        this.mFormEditMode = UIHelper.AppFormState.Insert;
                        this.pmLoadEditPage();
                    }
                    else
                    {
                        MessageBox.Show("äÁèÁÕÊÔ·¸Ôì㹡ÒÃà¾ÔèÁ¢éÍÁÙÅ !", "Application Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }

                    break;

                case WsToolBar.Update:
                    if (App.PermissionManager.CheckPermission(TASKNAME, AuthenType.CanEdit, App.AppUserName, App.AppUserID))
                    {
                        this.mFormEditMode = UIHelper.AppFormState.Edit;
                        this.pmLoadEditPage();
                    }
                    else
                    {
                        MessageBox.Show("äÁèÁÕÊÔ·¸Ôì㹡ÒÃá¡é䢢éÍÁÙÅ !", "Application Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }

                    break;

                case WsToolBar.Delete:
                    if (App.PermissionManager.CheckPermission(TASKNAME, AuthenType.CanDelete, App.AppUserName, App.AppUserID))
                    {
                        this.pmDeleteData();
                    }
                    else
                    {
                        MessageBox.Show("äÁèÁÕÊÔ·¸Ôì㹡ÒÃź¢éÍÁÙÅ !", "Application Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }

                    break;

                case WsToolBar.Search:
                    this.pmSearchData();
                    break;

                case WsToolBar.Undo:
                    if (MessageBox.Show("¡àÅÔ¡¡ÒÃá¡éä¢ ?", "Application confirm message", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        this.pmGotoBrowPage();
                    }
                    break;

                case WsToolBar.Save:
                    this.pmSaveData();
                    break;

                case WsToolBar.Refresh:
                    this.pmRefreshBrowView();
                    break;
                }
            }
        }
Ejemplo n.º 34
0
 private string GetAppointments(Appointment appointmentDocument, AppEnum.AppointmentTypes typeOfAppointment)
 {
     IAppointmentTypeStrategy appointmentType = null;
     if (typeOfAppointment == AppEnum.AppointmentTypes.PatientVisit)
     {
         //appointmentType = new PatientVisitStrategy((PatientVisit)appointmentDocument);
         appointmentType = new AppointmentStrategy<PatientVisit>((PatientVisit)appointmentDocument);
     }
     else if (typeOfAppointment == AppEnum.AppointmentTypes.Block)
     {
         //appointmentType = new BlockStrategy((BlockAppointment)appointmentDocument);
         appointmentType = new AppointmentStrategy<BlockAppointment>((BlockAppointment)appointmentDocument);
     }
     else if (typeOfAppointment == AppEnum.AppointmentTypes.Other)
     {
         //appointmentType = new BlockStrategy((BlockAppointment)appointmentDocument);
         appointmentType = new AppointmentStrategy<OtherAppointment>((OtherAppointment)appointmentDocument);
     }
     if (appointmentType != null)
     {
         return appointmentType.GenerateAppointments();
     }
     return "";
 }
Ejemplo n.º 35
0
        private void SaveAppointment(string appointmentGuidUrl, Appointment toSaveAppointment, DropBoxLink dropBoxLink, bool isDateChanged, Appointment appointmentAlreadyExist, AppEnum.EditStatus occurenceStatus)
        {
            //  appointmentGuidUrl null
            if (AppCommon.CheckIfStringIsEmptyOrNull(appointmentGuidUrl))
            { // create mode
                if (toSaveAppointment.Recurrence == null)
                { // save non Recurrence patient Visit Appointment
                    SaveActualAppointment("", toSaveAppointment, dropBoxLink);
                }
                else
                {// save Recurrence patient Visit Appointment
                    SaveActualAppointmentRecurrence("", toSaveAppointment, dropBoxLink);
                }
            }
            else
            {    // edit mode

                switch (occurenceStatus)
                {
                    case AppEnum.EditStatus.All:
                        DeleteAndCreateNewAppointment(toSaveAppointment, dropBoxLink, appointmentAlreadyExist);
                        break;
                    case AppEnum.EditStatus.Current:
                        if (isDateChanged)
                        {
                            // delete current appoint from reccurence & create new non recurring appointment
                            // from recurrence to new appointment (non-recurrence)
                            DeleteFromRecurrenceCreateNewNonRecurrenceAppointment(toSaveAppointment, dropBoxLink, appointmentAlreadyExist, occurenceStatus);
                        }
                        else
                        { // Update an appointment  from recurrence list
                            //toSaveAppointment.CreatedBy = appointmentAlreadyExist.CreatedBy;
                            //toSaveAppointment.CreatedTimeStamp = appointmentAlreadyExist.CreatedTimeStamp;
                            //toSaveAppointment.ChartTimeStamp = appointmentAlreadyExist.ChartTimeStamp;
                            //toSaveAppointment.Signature = appointmentAlreadyExist.Signature;
                            SetAppointmentAduitFieldsValues(toSaveAppointment, appointmentAlreadyExist);
                            toSaveAppointment.Recurrence = null;
                            toSaveAppointment.RecurrenceGroup = appointmentAlreadyExist.RecurrenceGroup;
                            SaveActualAppointment(appointmentGuidUrl, toSaveAppointment, dropBoxLink);
                        }
                        break;
                    case AppEnum.EditStatus.None:
                        //  Appointment from DB has no recurrence  but  Appointment  from edited has recurrence then  change is for Non Recurrence To Recurrence
                        if (AppCommon.CheckIfStringIsEmptyOrNull(appointmentAlreadyExist.RecurrenceGroup) && (toSaveAppointment.Recurrence != null))
                        {
                            UpdateSaveAppointmentNonRecurrenceToRecurrence(appointmentGuidUrl, toSaveAppointment, dropBoxLink, appointmentAlreadyExist);
                        }
                        //  Patient Visit from DB has no recurrence  but Patient Visit from edited has no recurrence then  change is for Non Recurrence To non Recurrence
                        else if (AppCommon.CheckIfStringIsEmptyOrNull(appointmentAlreadyExist.RecurrenceGroup) && (toSaveAppointment.Recurrence == null))
                        {
                            //toSaveAppointment.CreatedBy = appointmentAlreadyExist.CreatedBy;
                            //toSaveAppointment.CreatedTimeStamp = appointmentAlreadyExist.CreatedTimeStamp;
                            //toSaveAppointment.ChartTimeStamp = appointmentAlreadyExist.ChartTimeStamp;
                            //toSaveAppointment.Signature = appointmentAlreadyExist.Signature;

                            SetAppointmentAduitFieldsValues(toSaveAppointment, appointmentAlreadyExist);

                            if (isDateChanged)
                            {
                                DeleteAndCreateNewAppointment(toSaveAppointment, dropBoxLink, appointmentAlreadyExist);
                            }
                            else
                            {
                                SaveActualAppointment(appointmentGuidUrl, toSaveAppointment, dropBoxLink);
                            }
                        }
                        break;
                }

                //if (isDateChanged)
                //{ // if date changed in edit mode delete  all Recurrence and patient Visit Appointment list  and create new appointment
                //    DeleteAndCreateNewAppointment(appointmentGuidUrl, toSaveAppointment, dropBoxLink, appointmentAlreadyExist);
                //}
                //else
                //{ // if date not change then change need to be done only on current & fucutre date appointmnet.

                //    // Patient Visit from DB and Patient Visit from edited  both has Recurrence then  chnage is for Recurrence To Recurrence
                //    if (!AppCommon.CheckIfStringIsEmptyOrNull(appointmentAlreadyExist.RecurrenceGroup) && (toSaveAppointment.Recurrence != null))
                //    {
                //        UpdateSaveAppointmentRecurrenceToRecurrence(appointmentGuidUrl, toSaveAppointment, dropBoxLink, appointmentAlreadyExist);
                //    }
                //    //  Patient Visit from DB has recurrence  but Patient Visit from edited has no recurrence then  chnage is for Recurrence To non Recurrence
                //    else if (!AppCommon.CheckIfStringIsEmptyOrNull(appointmentAlreadyExist.RecurrenceGroup) && (toSaveAppointment.Recurrence == null))
                //    {
                //        UpdateSaveAppointmentRecurrenceToNonRecurrence(toSaveAppointment, dropBoxLink, appointmentAlreadyExist);
                //    }

                //}
            }
        }
Ejemplo n.º 36
0
        private void BindPage()
        {
            //Bind CustomerInfo
            this.lblName.Text      = oSession.sCustomer.CustomerName;
            this.lblAddr.Text      = oSession.sCustomer.DwellAddress;
            this.lblPhone.Text     = oSession.sCustomer.Phone;
            this.lblCellPhone.Text = oSession.sCustomer.CellPhone;
            this.lblZip.Text       = oSession.sCustomer.DwellZip;
            AreaInfo area = ASPManager.GetInstance().LoadArea(oSession.sCustomer.DwellAreaSysNo);

            this.lblProvince.Text = area.ProvinceName;
            this.lblCity.Text     = area.CityName;
            this.lblDistrict.Text = area.DistrictName;

            //修改部分显示

            txtRname.Text = soInfo.ReceiveName;

            txtRCellPhone.Text = soInfo.ReceiveCellPhone;
            txtRPhone.Text     = soInfo.ReceivePhone;
            if (oSession.sCustomer.DwellAreaSysNo != 1)//这个是new user的默认值。
            {
                RArea.AreaSysNo = soInfo.ReceiveAreaSysNo;
            }
            txtRaddress.Text = soInfo.ReceiveAddress;
            txtRzip.Text     = soInfo.ReceiveZip;

            //Bind SO
            //Bind SOMaster
            this.lblSOID.Text             = soInfo.SOID;
            this.lblReceiveName.Text      = soInfo.ReceiveName;
            this.lblReceiveAddr.Text      = soInfo.ReceiveAddress;
            this.lblReceivePhone.Text     = soInfo.ReceivePhone;
            this.lblReceiveCellPhone.Text = soInfo.ReceiveCellPhone;
            this.lblReceiveZip.Text       = soInfo.ReceiveZip;
            area = ASPManager.GetInstance().LoadArea(soInfo.ReceiveAreaSysNo);
            this.lblReceiveProvince.Text = area.ProvinceName;
            this.lblReceiveCity.Text     = area.CityName;
            this.lblReceiveDistrict.Text = area.DistrictName;
            ShipTypeInfo stInfo = ASPManager.GetInstance().LoadShipType(soInfo.ShipTypeSysNo);
            PayTypeInfo  ptInfo = ASPManager.GetInstance().LoadPayType(soInfo.PayTypeSysNo);

            this.lblShipType.Text       = stInfo.ShipTypeName;
            this.lblPayType.Text        = ptInfo.PayTypeName;
            this.lblPointAmt.Text       = soInfo.PointAmt.ToString();
            this.lblPointPay.Text       = soInfo.PointPay.ToString();
            this.lblFreeShipFeePay.Text = Util.ToMoney(soInfo.FreeShipFeePay).ToString();
            this.lblPremiumAmt.Text     = soInfo.PremiumAmt.ToString(AppConst.DecimalFormatWithCurrency);
            this.lblShipPrice.Text      = soInfo.ShipPrice.ToString(AppConst.DecimalFormatWithCurrency);
            this.lblPayPrice.Text       = soInfo.PayPrice.ToString(AppConst.DecimalFormatWithCurrency);
            if (soInfo.PayPrice > 0)
            {
                this.trPayPrice.Visible = true;
            }
            else
            {
                this.trPayPrice.Visible = false;
            }
            this.lblSOAmt.Text = soInfo.SOAmt.ToString(AppConst.DecimalFormatWithCurrency);
            //this.lblDiscountAmt.Text = soInfo.DiscountAmt.ToString(AppConst.DecimalFormatWithCurrency);
            this.lblDiscountAmt.Text = Convert.ToDecimal(soInfo.DiscountAmt + soInfo.CouponAmt).ToString(AppConst.DecimalFormatWithCurrency);
            //if(soInfo.DiscountAmt>0)
            //    this.trSaleRule.Visible = true;
            //else
            //    this.trSaleRule.Visible = false;
            if ((soInfo.DiscountAmt + soInfo.CouponAmt) > 0)
            {
                this.trSaleRule.Visible = true;
            }
            else
            {
                this.trSaleRule.Visible = false;
            }

            decimal total    = soInfo.GetTotalAmt();
            decimal subTotal = total - soInfo.PayPrice;
            decimal endMoney = SaleManager.GetInstance().GetEndMoney(soInfo);
            decimal change   = total - endMoney;

            this.lblSubSum.Text     = subTotal.ToString(AppConst.DecimalFormatWithCurrency);
            this.lblTotalMoney.Text = endMoney.ToString(AppConst.DecimalFormatWithCurrency);
            this.lblChange.Text     = change.ToString(AppConst.DecimalFormatWithCurrency);
            this.lblSOWeight.Text   = soInfo.GetTotalWeight().ToString();
            this.lblStatus.Text     = AppEnum.GetSOStatus(soInfo.Status);
            this.lblSODate.Text     = soInfo.OrderDate.ToString(AppConst.DateFormat);
            if (soInfo.Memo == "")
            {
                lblMemo.Text    = "没有留言!";
                txtMessage.Text = "没有留言!";
            }
            else
            {
                this.lblMemo.Text = soInfo.Memo;
                txtMessage.Text   = soInfo.Memo;
            }
            //Bind SOItem Table
            this.BindSOItem();
            //Bind SaleRule Table
            this.BindSaleRule();
            //Set visible
            if (soInfo.Status == (int)AppEnum.SOStatus.Origin)
            {
                this.btnCancel.Visible = true;
            }
            else
            {
                this.btnCancel.Visible = false;
            }

            if (soInfo.HasExpectQty == (int)AppEnum.YNStatus.Yes)
            {
                this.dgItem.Columns[5].Visible = true;
            }
            else
            {
                this.dgItem.Columns[5].Visible = false;
            }
        }
Ejemplo n.º 37
0
 private string FormatAppointmentUrl(string url, DateTime appointmentDate, string providerId, string appointmentGuid, AppEnum.ProviderType providerType)
 {
     string appointmentUrl = "";
     switch (providerType)
     {
         case AppEnum.ProviderType.SingleProvider:
             appointmentUrl = string.Format(url, string.Format(AppCommon.CalendarYearMonthNode, appointmentDate), AppCommon.GetWeekNode(appointmentDate), AppCommon.GetDayNode(appointmentDate), providerId, ((AppCommon.CheckIfStringIsEmptyOrNull(appointmentGuid)) ? "{0}" : appointmentGuid));
             break;
         case AppEnum.ProviderType.MultiProvider:
             appointmentUrl = string.Format(url, string.Format(AppCommon.CalendarYearMonthNode, appointmentDate), AppCommon.GetWeekNode(appointmentDate), AppCommon.GetDayNode(appointmentDate), ((AppCommon.CheckIfStringIsEmptyOrNull(appointmentGuid)) ? "{0}" : appointmentGuid));
             break;
     }
     return appointmentUrl;
 }
Ejemplo n.º 38
0
 private bool CancelAppointment(string appointmentUrl, Appointment appointmentToCancel, DropBoxLink dropBoxLink, AppEnum.EditStatus occurrenceStatus)
 {
     switch (occurrenceStatus)
     {
         case AppEnum.EditStatus.All:
             CancelRecurringAppointment(appointmentUrl, appointmentToCancel, dropBoxLink);
             break;
         case AppEnum.EditStatus.None:
         case AppEnum.EditStatus.Current:
             CancelActualAppointment(appointmentUrl, appointmentToCancel, dropBoxLink);
             break;
     }
     return true;
 }
Ejemplo n.º 39
0
        public static int GetPointsToEliminate(AppEnum.Level _level)
        {
            int result = 0;
            switch (_level)
            {
                case AppEnum.Level.level1:
                    result = 60;
                    break;
                case AppEnum.Level.level2:
                    result = 100;
                    break;
                case AppEnum.Level.level3:
                    result = 200;
                    break;
            }

            return result;
        }
Ejemplo n.º 40
0
 /// <summary>
 /// Get appointments for calendar filter
 /// </summary>
 /// <param name="calendarFilterObject"></param>
 /// <param name="filterType"></param>
 /// <returns></returns>
 public IList<CalendarEventProxy> GetAppointmentsForCalendar(CalendarFilterProxy calendarFilterObject, AppEnum.CalendarFilterTypes filterType)
 {
     IList<Appointment> appointmentsList = _appointmentDocument.GetAppointments(calendarFilterObject, filterType);
     IList<CalendarEventProxy> calendarEvents = GetAppointmentsForCalendar(appointmentsList.ToList(), calendarFilterObject.CalendarView);
     return calendarEvents;
 }
Ejemplo n.º 41
0
        //Choose Calculation
        private void ChooseCalculation(AppEnum.Level _level, ref int resultOfCalculation, ref string resultToAddToJar)
        {
            int firstNumber = 0;
            int secondNumber = 0;

            switch (_level)
            {
                case AppEnum.Level.level1:
                    firstNumber = Commons.GetRandomNumber(AppConstant.Level1_Number_From, AppConstant.Level1_Number_To);
                    secondNumber = Commons.GetRandomNumber(AppConstant.Level1_Number_From, AppConstant.Level1_Number_To);
                    break;
                case AppEnum.Level.level2:
                    firstNumber = Commons.GetRandomNumber(AppConstant.Level2_Number_From, AppConstant.Level2_Number_To);
                    secondNumber = Commons.GetRandomNumber(AppConstant.Level2_Number_From, AppConstant.Level2_Number_To);
                    break;
                case AppEnum.Level.level3:
                    firstNumber = Commons.GetRandomNumber(AppConstant.Level3_Number_From, AppConstant.Level3_Number_To);
                    secondNumber = Commons.GetRandomNumber(AppConstant.Level3_Number_From, AppConstant.Level3_Number_To);
                    break;
            }
            AppEnum.Calculation calcul = Commons.GetRandomCalculation();

            switch (calcul)
            {
                case AppEnum.Calculation.mathAdd:
                    resultOfCalculation = firstNumber + secondNumber;
                    resultToAddToJar = firstNumber + " + " + secondNumber;
                    break;
                case AppEnum.Calculation.mathdEliminate:
                    resultOfCalculation = firstNumber - secondNumber;
                    resultToAddToJar = firstNumber + " - " + secondNumber;
                    break;
            }
        }
Ejemplo n.º 42
0
 //private void UpdateSaveAppointmentRecurrenceToNonRecurrence(Appointment toSaveAppointment, DropBoxLink dropBoxLink, Appointment appointmentAlreadyExist)
 //{
 //    if (!AppCommon.CheckIfStringIsEmptyOrNull(appointmentAlreadyExist.RecurrenceGroup))
 //    {
 //        appointmentAlreadyExist = DeleteRecurrenceAppointment(toSaveAppointment, appointmentAlreadyExist, dropBoxLink, AppEnum.EditStatus.All);
 //    }
 //    SetAuditFields(toSaveAppointment, true, dropBoxLink);
 //    toSaveAppointment.CreatedBy = appointmentAlreadyExist.CreatedBy;
 //    toSaveAppointment.CreatedTimeStamp = appointmentAlreadyExist.CreatedTimeStamp;
 //    SaveActualAppointment("", toSaveAppointment, dropBoxLink);
 //}
 //private void UpdateSaveAppointmentRecurrenceToRecurrence(string appointmentGuidUrl, Appointment toSaveAppointment, DropBoxLink dropBoxLink, Appointment appointmentAlreadyExist)
 //{
 //    AppEnum.ApplicationRole dropBoxLinkUserRole = AppCommon.GetCurrentUserRole(dropBoxLink.UserRole);
 //    IList<string> appointmentExistRecurrenceList = new List<string>();
 //    Appointment eachRecurrenceListAppointmentDbItem = null;
 //    if (!AppCommon.CheckIfStringIsEmptyOrNull(appointmentGuidUrl))
 //    {
 //        DateTime startDateTime = (appointmentAlreadyExist.StartDateTime.Date).Add(toSaveAppointment.StartDateTime.TimeOfDay);
 //        DateTime endDateTime = (appointmentAlreadyExist.EndDateTime.Date).Add(toSaveAppointment.EndDateTime.TimeOfDay);
 //        toSaveAppointment.StartDateTime = startDateTime;
 //        toSaveAppointment.EndDateTime = endDateTime;
 //        IList<Appointment> appointmentsListToSchedule = new List<Appointment>();
 //        if (toSaveAppointment is PatientVisit)
 //        {
 //            IList<PatientVisit> patientVisitAppointmentsListToSchedule = JsonSerializer.DeserializeObject<IList<PatientVisit>>(GetAppointments((PatientVisit)toSaveAppointment, AppEnum.AppointmentTypes.PatientVisit));
 //            appointmentsListToSchedule = patientVisitAppointmentsListToSchedule.Cast<Appointment>().ToList<Appointment>();
 //        }
 //        else if (toSaveAppointment is BlockAppointment)
 //        {
 //            IList<BlockAppointment> blockAppointmentsListToSchedule = JsonSerializer.DeserializeObject<IList<BlockAppointment>>(GetAppointments((BlockAppointment)toSaveAppointment, AppEnum.AppointmentTypes.Block));
 //            appointmentsListToSchedule = blockAppointmentsListToSchedule.Cast<Appointment>().ToList<Appointment>();
 //        }
 //        foreach (string appointmentItem in appointmentAlreadyExist.Recurrence.RecurrenceList)
 //        {
 //            if (toSaveAppointment is PatientVisit)
 //            {
 //                eachRecurrenceListAppointmentDbItem = _patientVisitAppointmentDocument.Get(appointmentItem);
 //            }
 //            else if (toSaveAppointment is PatientVisit)
 //            {
 //                eachRecurrenceListAppointmentDbItem = _blockAppointmentDocument.Get(appointmentItem);
 //            }
 //            Appointment toSaveAppointmentType = appointmentsListToSchedule.SingleOrDefault(pv => pv.StartDateTime.Date.Equals(eachRecurrenceListAppointmentDbItem.StartDateTime.Date));
 //            if (toSaveAppointmentType != null)
 //            {
 //                toSaveAppointmentType.CreatedBy = appointmentAlreadyExist.CreatedBy;
 //                toSaveAppointmentType.CreatedTimeStamp = appointmentAlreadyExist.CreatedTimeStamp;
 //                SetAuditFields(toSaveAppointmentType, true, dropBoxLink);
 //                ClearAppointmentRecurrenceGroup(toSaveAppointmentType);
 //                toSaveAppointmentType.RecurrenceGroup = appointmentAlreadyExist.RecurrenceGroup;
 //                SaveActualAppointment(appointmentItem, toSaveAppointmentType, dropBoxLink);
 //            }
 //        }
 //    }
 //}
 /// <summary>
 /// delete  patient Visit Appointment
 /// </summary>
 /// <param name="appointmentToSave"></param>
 /// <param name="dropBoxLink"> </param>
 /// <param name="recurrenceEditStatus"></param>
 /// <param name="appointmentAlreadyExist"> </param>
 /// <returns></returns>
 public Appointment DeleteAppointmentType(Appointment appointmentToSave, DropBoxLink dropBoxLink, AppEnum.EditStatus recurrenceEditStatus, Appointment appointmentAlreadyExist)
 {
     if (!AppCommon.CheckIfStringIsEmptyOrNull(appointmentAlreadyExist.Url))
     {
         if (AppCommon.CheckIfStringIsEmptyOrNull(appointmentAlreadyExist.RecurrenceGroup))
         {// delete the single appointment
             DeleteAnAppointment(appointmentAlreadyExist.Url);
         }
         else
         {// delete the Recurrence Appointment
             appointmentAlreadyExist = DeleteRecurrenceAppointment(appointmentAlreadyExist, dropBoxLink, recurrenceEditStatus);
         }
     }
     return appointmentAlreadyExist;
 }
Ejemplo n.º 43
0
 /// <summary>
 /// To get the action to perform from the flags
 /// </summary>
 /// <param name="statusOfAttachment"></param>
 /// <param name="persistentImage"></param>
 /// <param name="transientImage"></param>
 /// <returns></returns>
 private AppEnum.AttachmentActions GetActionToPerformForAttachment(AppEnum.AttachmentFlagsForStatus statusOfAttachment, string persistentImage, string transientImage)
 {
     switch (statusOfAttachment)
     {
         case AppEnum.AttachmentFlagsForStatus.ExistsInDbNotInUi:
             return AppEnum.AttachmentActions.RemovePersistent;
         case AppEnum.AttachmentFlagsForStatus.ExistsInUiNotInDb:
             return AppEnum.AttachmentActions.CreatePersistent;
         case AppEnum.AttachmentFlagsForStatus.NotExistsInUiAndDb:
             return AppEnum.AttachmentActions.None;
         case AppEnum.AttachmentFlagsForStatus.ExistsInUiAndDb:
             {
                 if (persistentImage.Equals(transientImage))
                 {
                     return AppEnum.AttachmentActions.None;
                 }
                 return AppEnum.AttachmentActions.RemoveTransientPersistentAndCreatePersistent;
             }
     }
     return AppEnum.AttachmentActions.None;
 }
Ejemplo n.º 44
0
 /// <summary>
 /// To move transient images from Attachment/Transient to Attachment/Persistent
 /// </summary>
 /// <param name="attachmentActions"></param>
 /// <param name="persistentImage"></param>
 /// <param name="transientImage"></param>
 /// <param name="imgReference"></param>
 private void CheckAndMoveTransientImages(AppEnum.AttachmentActions attachmentActions, string persistentImage, string transientImage, out string imgReference)
 {
     string persistentImageTemp = String.Empty;
     switch (attachmentActions)
     {
         case AppEnum.AttachmentActions.RemovePersistent:
             RemoveAttachment(persistentImage);
             persistentImageTemp = String.Empty;
             break;
         case AppEnum.AttachmentActions.RemoveTransientPersistentAndCreatePersistent:
             {
                 RemoveAttachment(persistentImage);
                 MoveTransientToPersistentAttachment(transientImage, out persistentImageTemp);
             }
             break;
         case AppEnum.AttachmentActions.CreatePersistent:
             {
                 MoveTransientToPersistentAttachment(transientImage, out persistentImageTemp);
             }
             break;
         case AppEnum.AttachmentActions.None:
             imgReference = persistentImage;
             return;
     }
     imgReference = persistentImageTemp;
 }
Ejemplo n.º 45
0
        public string GetAreaQADiv(Hashtable ht, string Position, int Top)
        {
            DataSet ds         = OnlineListQAManager.GetInstance().GetOnlineListQADs(ht, Top);
            int     QAType     = Int32.Parse(ht["QAType"].ToString());
            string  QATypeName = AppEnum.GetQAType(QAType);

            if (!Util.HasMoreRow(ds))
            {
                return("");
            }

            StringBuilder sb = new StringBuilder();

            if (Position == "Left")
            {
                sb.Append("<div id=fl_yxxt class=panel>");
                sb.Append("<div class=panel_title>");
                sb.Append("<div class=panel_more><a href='../Service/News.aspx?Type=Article&Type2=" + QAType + "' style='color:#205E8A;' target='_blank'>更多...</a></div>");
                sb.Append(QATypeName + "</div>");
                sb.Append("<div class=panel_content>");
                sb.Append("<div class=c_yxxt>");
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    if (Util.TrimNull(dr["Question"]).Length > 20)
                    {
                        sb.Append("<span><a href='../Service/NewsDetail.aspx?Type=Article&ID=" + Util.TrimIntNull(dr["SysNo"]) + "' target='_blank'>" + Util.TrimNull(dr["Question"]).Substring(0, 20) + "..." + "</a></span>");
                    }
                    else
                    {
                        sb.Append("<span><a href='../Service/NewsDetail.aspx?Type=Article&ID=" + Util.TrimIntNull(dr["SysNo"]) + "' target='_blank'>" + Util.TrimNull(dr["Question"]) + "</a></span>");
                    }
                }
                sb.Append("</div>");
                sb.Append("</div>");
                sb.Append("</div>");
            }
            else if (Position == "Right")
            {
                sb.Append("<div id=fl_ztlb class=panelr>");
                sb.Append("<div class=panelr_title>");
                sb.Append("<div class=panelr_more><a href='../Service/News.aspx?Type=Article&Type2=" + QAType + "' style='color:#205E8A;' target='_blank'>更多...</a></div>");
                sb.Append(QATypeName + "</div>");
                sb.Append("<div class=panelr_content>");
                sb.Append("<div class=c_zxdc>");

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    if (Util.TrimNull(dr["Question"]).Length > 20)
                    {
                        sb.Append("<div class=c_zxgg_li><a href='../Service/NewsDetail.aspx?Type=Article&ID=" + Util.TrimIntNull(dr["SysNo"]) + "' target='_blank'>" + Util.TrimNull(dr["Question"]).Substring(0, 20) + "..." + "</a></div>");
                    }
                    else
                    {
                        sb.Append("<div class=c_zxgg_li><a href='../Service/NewsDetail.aspx?Type=Article&ID=" + Util.TrimIntNull(dr["SysNo"]) + "' target='_blank'>" + Util.TrimNull(dr["Question"]) + "</a></div>");
                    }
                }
                sb.Append("</div>");
                sb.Append("</div>");
                sb.Append("</div>");
            }

            return(sb.ToString());
        }
Ejemplo n.º 46
0
 private void DeleteFromRecurrenceCreateNewNonRecurrenceAppointment(Appointment toSaveAppointment, DropBoxLink dropBoxLink, Appointment appointmentAlreadyExist, AppEnum.EditStatus occurenceStatus)
 {
     //Appointment deletedAppointmentExist = DeleteAppointmentType(toSaveAppointment, dropBoxLink, occurenceStatus, appointmentAlreadyExist);
     DeleteAppointmentType(toSaveAppointment, dropBoxLink, occurenceStatus, appointmentAlreadyExist);
     //toSaveAppointment.CreatedBy = appointmentAlreadyExist.CreatedBy;
     //toSaveAppointment.CreatedTimeStamp = appointmentAlreadyExist.CreatedTimeStamp;
     //toSaveAppointment.ChartTimeStamp = appointmentAlreadyExist.ChartTimeStamp;
     //toSaveAppointment.Signature = appointmentAlreadyExist.Signature;
     SetAppointmentAduitFieldsValues(toSaveAppointment, appointmentAlreadyExist);
     toSaveAppointment.Recurrence = null;
     SaveActualAppointment("", toSaveAppointment, dropBoxLink);
 }
Ejemplo n.º 47
0
        public static string GetDocumentPath(DocumentPath.Module documentPath, string courseId, string scenarioId, AppEnum.ApplicationRole role,
                                           string userId, string customValue)
        {
            List<string> nodeList = new List<string>();
            string currentUserRole = AppCommon.GetRoleDescription(role);
            if (documentPath == DocumentPath.Module.Masters)
            {
                nodeList.Add(GetMasterDocumentPath());
            }
            else if (documentPath == DocumentPath.Module.Attachments)
            {
                nodeList.Add(GetAttachmentDocumentPath());
            }
            else
            {
                nodeList.Add(GetBaseDocumentPath(courseId, currentUserRole));
            }
            bool isAdminUser = IsAdmin(currentUserRole);
            if (isAdminUser)
            {
            }
            else
            {
                nodeList.Add(userId);
                nodeList.Add(AssignmentNode);
                nodeList.Add(scenarioId);
            }
            switch (documentPath)
            {
                case DocumentPath.Module.PatientVisitAppointment:
                case DocumentPath.Module.BlockAppointment:
                case DocumentPath.Module.OtherAppointment:
                case DocumentPath.Module.RecurrenceGroup:
                    {
                        if (isAdminUser)
                        {

                        }
                        else
                        {

                            nodeList.Add(AppointmentNode);
                            if (documentPath == DocumentPath.Module.RecurrenceGroup)
                            {
                                nodeList.Add("Recurrence");
                                nodeList.Add("{0}");
                            }
                            else
                            {
                                nodeList.Add("Type");
                                switch (documentPath)
                                {
                                    case DocumentPath.Module.PatientVisitAppointment:
                                        {
                                            nodeList.Add("PatientVisit");

                                            break;
                                        }
                                    case DocumentPath.Module.OtherAppointment:
                                        {
                                            nodeList.Add("Other");
                                            break;
                                        }
                                    case DocumentPath.Module.BlockAppointment:
                                        {
                                            nodeList.Add("Block");
                                            break;
                                        }
                                }
                                nodeList.Add(customValue);
                                nodeList.Add("{0}");
                                switch (customValue)
                                {
                                    case AppConstants.CalendarMonthFilters:
                                        break;
                                    default:
                                        nodeList.Add("{1}");
                                        nodeList.Add("{2}");
                                        nodeList.Add("{3}");
                                        AppEnum.ProviderType providerType = (!AppCommon.CheckIfStringIsEmptyOrNull(customValue) ? (AppEnum.ProviderType)Enum.Parse(typeof(AppEnum.ProviderType), customValue) : AppEnum.ProviderType.SingleProvider);
                                        if (providerType == AppEnum.ProviderType.SingleProvider)
                                        {
                                            nodeList.Add("{4}");
                                        }
                                        break;
                                }
                            }
                        }
                        break;
                    }
                case DocumentPath.Module.LCMFolders:
                    {
                        nodeList.Add("{0}");//Based on foldertype substitute with either QuestionBank,AssignmentRepository etc.,
                        nodeList.Add("SubFolders{1}");
                        break;
                    }
                case DocumentPath.Module.Assignments:
                    {
                        if (isAdminUser)
                        {
                            switch (customValue)
                            {
                                case AppConstants.Create:
                                    {
                                        nodeList.Add(AdminAssignmentRepository + "{0}");
                                        nodeList.Add(AssignmentNode);
                                        nodeList.Add("{1}");
                                        break;
                                    }
                                default:
                                    {
                                        nodeList.Add(AdminAssignmentRepository);
                                        break;
                                    }
                            }
                        }
                        break;
                    }
                case DocumentPath.Module.Patients:
                    {

                        switch (customValue)
                        {
                            case AppConstants.Read:
                                {
                                    nodeList.Add(isAdminUser ? AdminPatientRepository : PatientsNode);
                                    break;
                                }
                            case AppConstants.Create:
                                {
                                    if (isAdminUser)
                                    {
                                        nodeList.Add(AdminPatientRepository);
                                    }
                                    nodeList.Add(PatientsNode);
                                    nodeList.Add("{0}");
                                    break;
                                }
                            default:
                                {
                                    break;
                                }
                        }

                        break;
                    }
                case DocumentPath.Module.QuestionBank:
                    {
                        if (isAdminUser)
                        {
                            switch (customValue)
                            {
                                case AppConstants.Create:
                                    {
                                        nodeList.Add(AdminQuestionBank + "{0}");
                                        nodeList.Add(QuestionItems);
                                        nodeList.Add("{1}");
                                        break;
                                    }
                                default:
                                    {
                                        nodeList.Add(AdminQuestionBank);
                                        break;
                                    }
                            }

                        }
                        break;
                    }

                case DocumentPath.Module.Attachments:
                    {
                        switch (customValue)
                        {
                            case AppConstants.TransientAttachment:
                                {
                                    nodeList.Add(AppConstants.TransientAttachment);
                                    break;
                                }
                            default:
                                {
                                    nodeList.Add(AppConstants.PersistentAttachment);
                                    break;
                                }
                        }
                        nodeList.Add("{0}");
                        break;
                    }
                case DocumentPath.Module.SkillSets:
                    {
                        if (isAdminUser)
                        {

                            switch (customValue)
                            {
                                case AppConstants.Create:
                                    nodeList.Add(AdminSkillsetRepository + "{0}");// {0} will be replaced with FOLDER text
                                    nodeList.Add(Skillsets);
                                    nodeList.Add("{1}"); // {1} will be replaces with NEW GUID value for each skillset
                                    break;
                                default:
                                    nodeList.Add(AdminSkillsetRepository);
                                    break;
                            }
                        }
                        break;
                    }
                case DocumentPath.Module.ReferralForm:
                case DocumentPath.Module.PriorAuthorizationForm:
                case DocumentPath.Module.PatientRecordsAccessForms:
                case DocumentPath.Module.MedicalRecordsReleaseDocument:
                case DocumentPath.Module.BillOfRights:
                case DocumentPath.Module.NoticeOfPrivacyPractice:
                    {
                        if (isAdminUser)
                        {
                        }
                        else
                        {

                            nodeList.Add(PatientNode);
                            nodeList.Add("{0}");//Patient Guid Value
                            switch (documentPath)
                            {
                                case DocumentPath.Module.ReferralForm:
                                    {
                                        nodeList.Add("ReferralForms");
                                        break;
                                    }
                                case DocumentPath.Module.PriorAuthorizationForm:
                                    {
                                        nodeList.Add("PriorAuthorizationRequestForms");
                                        break;
                                    }
                                case DocumentPath.Module.PatientRecordsAccessForms:
                                    {
                                        nodeList.Add("PatientRecordsAccessForms");
                                        break;
                                    }
                                case DocumentPath.Module.MedicalRecordsReleaseDocument:
                                    {
                                        nodeList.Add("MedicalRecordsReleaseDocument");
                                        break;
                                    }
                                case DocumentPath.Module.BillOfRights:
                                    {
                                        nodeList.Add("BillOfRights");
                                        break;
                                    }
                                case DocumentPath.Module.NoticeOfPrivacyPractice:
                                    {
                                        nodeList.Add("NoticeOfPrivacyPractice");
                                        break;
                                    }
                                default: { break; }
                            }
                            if (documentPath != DocumentPath.Module.BillOfRights)
                            {
                                nodeList.Add("{1}");//Form Guid
                            }
                        }
                        break;
                    }
                case DocumentPath.Module.Masters:
                    {
                        switch (customValue)
                        {
                            case AppConstants.BillofRights:
                                {
                                    nodeList.Add("Forms");
                                    nodeList.Add(AppConstants.BillofRights);
                                    break;
                                }
                            case AppConstants.NoticePrivacyPractice:
                                {
                                    nodeList.Add("Forms");
                                    nodeList.Add(AppConstants.NoticePrivacyPractice);
                                    break;
                                }
                            case AppConstants.ApplicationModule:
                                {
                                    nodeList.Add(AppConstants.ApplicationModule);
                                    break;
                                }
                            case AppConstants.Competencies:
                                {
                                    nodeList.Add(AppConstants.Competencies + "{0}{1}");
                                    break;
                                }
                            case AppConstants.CompetencySource:
                                {
                                    nodeList.Add(AppConstants.CompetencySource);
                                    nodeList.Add("{0}");
                                    break;
                                }
                            case AppConstants.QuestionType:
                                {
                                    nodeList.Add(AppConstants.QuestionType);
                                    break;
                                }
                            default: { break; }
                        }
                        break;
                    }
                default:
                    {
                        break;
                    }
            }
            return string.Join("/", nodeList);
        }
Ejemplo n.º 48
0
 /// <summary>
 /// delete Recurrence Appointment 
 /// </summary>
 /// <param name="appointmentExist"></param>
 /// <param name="dropBoxLink"></param>
 /// <param name="recurrenceEditStatus"></param>
 /// <returns></returns>
 private Appointment DeleteRecurrenceAppointment(Appointment appointmentExist, DropBoxLink dropBoxLink, AppEnum.EditStatus recurrenceEditStatus)
 {
     // get the Url of Recurrence Appointment
     if (appointmentExist.Recurrence.RecurrenceList != null && appointmentExist.Recurrence.RecurrenceList.Count > 0)
     {
         string recurrenceGroupUrl = FormatRecurrenceGroupUrl(_recurrenceDocument.GetAssignmentUrl(dropBoxLink, DocumentPath.Module.RecurrenceGroup), appointmentExist.RecurrenceGroup);
         recurrenceGroupUrl = string.Format(recurrenceGroupUrl, appointmentExist.RecurrenceGroup);
         switch (recurrenceEditStatus)
         {
             case AppEnum.EditStatus.All:
                 DeleteAppointmentList(appointmentExist);
                 string deleteRecurrenceGroup;
                 _recurrenceDocument.Delete(recurrenceGroupUrl, out deleteRecurrenceGroup);
                 break;
             case AppEnum.EditStatus.Current:
                 DeleteAnAppointment(appointmentExist.Url);
                 List<string> appointmentSavedUrl = appointmentExist.Recurrence.RecurrenceList.Where(app => !(app.Equals(appointmentExist.Url))).ToList();
                 SaveAppointmentUrlRecurrenceGroup(appointmentSavedUrl, dropBoxLink, appointmentExist.RecurrenceGroup);
                 break;
         }
     }
     return appointmentExist;
 }
Ejemplo n.º 49
0
        /// <summary>
        /// this method will be invoked by appointment controller. Base method 
        /// </summary>
        /// <param name="appointmentGuid"></param>
        /// <param name="toSaveAppointment"></param>
        /// <param name="dropBoxLink"></param>
        /// <param name="occurrenceStatus"></param>
        public string SaveAppointmentType(string appointmentGuid, Appointment toSaveAppointment, DropBoxLink dropBoxLink, AppEnum.EditStatus occurrenceStatus)
        {
            bool isDateChanged = false;
            Appointment appointmentExist = null;
            string returnString = "";

            if (toSaveAppointment is PatientVisit)
            {
                if (!AppCommon.CheckIfStringIsEmptyOrNull(appointmentGuid))
                {
                    appointmentExist = GetPatientVisitAppointment(appointmentGuid, dropBoxLink);
                    isDateChanged = CheckIsDataChange(appointmentExist, toSaveAppointment);
                }

            }
            else if (toSaveAppointment is BlockAppointment)
            {
                if (!AppCommon.CheckIfStringIsEmptyOrNull(appointmentGuid))
                {
                    appointmentExist = GetBlockAppointment(appointmentGuid, dropBoxLink);
                    isDateChanged = CheckIsDataChange(appointmentExist, toSaveAppointment);
                }
            }
            else if (toSaveAppointment is OtherAppointment)
            {
                if (!AppCommon.CheckIfStringIsEmptyOrNull(appointmentGuid))
                {
                    appointmentExist = GetOtherAppointment(appointmentGuid, dropBoxLink);
                    isDateChanged = CheckIsDataChange(appointmentExist, toSaveAppointment);
                }
            }

            if (toSaveAppointment.Status == (int)AppEnum.AppointmentStatus.Canceled)
            {
                if (!AppCommon.CheckIfStringIsEmptyOrNull(appointmentGuid))
                {
                    if (appointmentExist != null)
                    {
                        appointmentExist.ReasonForCancellation = toSaveAppointment.ReasonForCancellation;
                        CancelAppointment(appointmentGuid, appointmentExist, dropBoxLink, occurrenceStatus);
                    }
                    returnString = AppConstants.Cancelled;
                }
            }
            else
            {
                SetAuditFieldsForAppointment(appointmentGuid, toSaveAppointment, dropBoxLink);
                SaveAppointment(appointmentGuid, toSaveAppointment, dropBoxLink, isDateChanged, appointmentExist, occurrenceStatus);
                returnString = AppConstants.AppointmentSave;
            }

            return returnString;
        }
Ejemplo n.º 50
0
 public AppConfigurations GetAppConfigs(AppEnum app)
 {
     return(_configurationDictionary[app]);
 }