コード例 #1
0
        public JsonResult XGetReportColumn(string mOptionName)
        {
            var mTblName = mIBusi.SelectSingleReportHeader(mOptionName).Select(h => h.Tables).ToList();

            string[] TableArr = mTblName.FirstOrDefault().ToString().Trim().Split(new char[] { '.' }, StringSplitOptions.RemoveEmptyEntries);
            var      mData    = ctx.Set(Core.CoreCommon.GetTableType(TableArr.FirstOrDefault().ToString())) as IEnumerable <object>;

            List <string>     colname  = new List <string>();
            List <GridColumn> colModal = new List <GridColumn>();
            List <object>     result   = new List <object>();

            foreach (var Dt in mData)
            {
                foreach (var property in Dt.GetType().GetProperties())
                {
                    colname.Add(property.Name);

                    GridColumn gc = new GridColumn();
                    gc.name  = property.Name;
                    gc.index = property.Name;
                    colModal.Add(gc);
                }
                break;
            }

            result.Add(Core.CoreCommon.GetString(colname.ToArray()));
            result.Add(colModal);

            JsonResult JR = new JsonResult();

            JR.Data = Newtonsoft.Json.JsonConvert.SerializeObject(result);
            return(JR);
        }
コード例 #2
0
        public static void GetBuildNameByNumber()
        {
            int    BuildNumber = 251;
            String BuildName   = null;

            String Data = "000-010 = Hourly\n";

            Data += "011-020 = Nightly\n";
            Data += "021-030 = Beta\n";
            Data += "031-040 = Test\n";
            Data += "101-199 = Release Candidate\n";
            Data += "201-300 = Release";

            Dictionary <String, String> Dict = new Dictionary <String, String>();

            foreach (String Dt in Data.Split("\n"))
            {
                Dict.Add(Dt.Split("=")[0].Trim(), Dt.Split("=")[1].Trim());
            }

            foreach (KeyValuePair <String, String> DictEntry in Dict)
            {
                if (BuildNumber >= Convert.ToInt64(DictEntry.Key.Split("-")[0])
                    &&
                    BuildNumber <= Convert.ToInt64(DictEntry.Key.Split("-")[1]))
                {
                    BuildName = DictEntry.Value;
                    break;
                }
            }
            Console.Write(BuildName);
        }
コード例 #3
0
ファイル: Login.aspx.cs プロジェクト: bishalsarker/ischeduler
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            LoginP lp = new LoginP(txtUsername.Text, txtPassword.Text);

            if (lp.checkIfHasErrors() == true)
            {
                if (lp.getErrors()[0] == "500")
                {
                    Response.Redirect("~/error");
                }
                else
                {
                    err.Text = lp.getErrors()[0];
                }
            }
            else
            {
                Session["user"] = lp.getUserId();
                Dt     dt    = new Dt();
                string year  = dt.getYearVal().ToString();
                string month = dt.getMonthVal().ToString();
                string date  = dt.getDayVal().ToString();
                Response.Redirect("~/calender?y=" + year + "&m=" + month + "&d=" + date + "");
            }
        }
コード例 #4
0
 public void Append(Dt inDt)
 {
     locs.AddRange(inDt.locs);
     gblocks.AddRange(inDt.gblocks);
     itms.AddRange(inDt.itms);
     vars.AddRange(inDt.vars);
 }
コード例 #5
0
            public override ReturnMessageClass Export()
            {
                ReturnMessageClass msg = new ReturnMessageClass();

                msg.Status = ResultStatus.Fail;

                try {
                    FilePath = PbFunc.wf_copy_file(ProgramId, $"{ProgramId}_{AdjType}");

                    base.OpenFileAndSetYear();

                    string prepoStr = Dt.AsEnumerable().Any(d => d.Field <string>("prod_type") == "F") ? "期貨契約保證金及" : "";
                    foreach (DataRow dr in Dt.Rows)
                    {
                        string abbrName      = dr["KIND_ABBR_NAME"].AsString();
                        string abbrName_Desc = dr["rule_full_name"].AsString() + "交易規則";

                        base.GenKindNameList(dr, prepoStr, abbrName, abbrName_Desc);
                    }

                    string beginDate = Dt.Rows[0]["issue_begin_ymd"].AsDateTime("yyyyMMdd").AsTaiwanDateTime("{0}年{1}月{2}日", 3);
                    ReplaceElementWord(GenArrayTxt(KindNameList), beginDate, GenArrayTxt(KindNameList_Desc), GenArrayTxt(KindNameList));

                    Doc.Save(FilePath);
                    msg.Status = ResultStatus.Success;
                    return(msg);
                } catch (Exception ex) {
                    base.ErrorHandle(ex, msg);
                    return(msg);
                }
            }
コード例 #6
0
        /// <summary>
        /// Retrieves the insurance lookup tables from the web service and caches them.
        /// </summary>
        private void InitializeLocation()
        {
            try
            {
                lock (typeof(Locations))
                {
                    //AgencyID = GetAgencyID();
                    Order     DataConnection = new Order(Page);
                    DataTable Dt;
                    //Commented below lines on 10/16/2014- issue Location dropdown cache old values #Defect 1567
                    //if (Cache["Location"]==null)
                    //{
                    Dt = DataConnection.LookupDataSet("Insurance", "Location", new object[] { AgencyID }).Tables["LOCATION"];
                    DataRow Dr = Dt.NewRow();
                    Dr["Code"] = "All";
                    Dr["Desc"] = "All";
                    Dt.Rows.InsertAt(Dr, 0);

                    //Cache["Location"] = Dt;
                    _Locations.DataSource = Dt;
                    _Locations.DataBind();

                    //Commented below line on 10/16/2014- issue Location dropdown cache old values #Defect 1567
                    //}
                    DataConnection.Close();
                }
            }
            catch (Exception ex)
            {
                CSAAWeb.AppLogger.Logger.Log("Exception occurred in InitializeLocation method" + ex.ToString());
            }
        }
コード例 #7
0
 public void WriteXml(XmlWriter writer)
 {
     writer.WriteAttributeString("Dt", Dt.ToString());
     writer.WriteAttributeString("Anonymous", IP);
     writer.WriteAttributeString("Antivirus", MoneyOwned.ToString());
     writer.WriteAttributeString("Firewall", MoneyWon.ToString());
 }
コード例 #8
0
ファイル: DocumentStyle.cs プロジェクト: yunfandev/waslibs
        public void Reset(Control host)
        {
            H1.Reset(host);
            H2.Reset(host);
            H3.Reset(host);
            H4.Reset(host);
            H5.Reset(host);
            H6.Reset(host);
            BlockQuote.Reset(host);
            P.Reset(host);
            FigCaption.Reset(host);
            Pre.Reset(host);
            Dt.Reset(host);
            Dd.Reset(host);

            Li.Reset(host);

            A.Reset(host);
            Span.Reset(host);
            Label.Reset(host);
            Q.Reset(host);
            Cite.Reset(host);
            I.Reset(host);
            Em.Reset(host);
            Mark.Reset(host);
            Time.Reset(host);
            Code.Reset(host);
            Strong.Reset(host);
        }
コード例 #9
0
        public EditScheduleP getSch(string sid)
        {
            EditScheduleP info = new EditScheduleP();
            ScheduleM     sm   = new ScheduleM();

            sm.schedule_id = sid;
            sm             = sm.getSchedulesById();

            Dt dt = new Dt();

            info.schedule_title = sm.schedule_title;
            info.date           = sm.date;
            info.month          = sm.month;
            info.year           = sm.year;
            info.hour           = sm.hour;
            info.minute         = sm.minute;
            info.time           = sm.time;
            info.location       = sm.location;
            info.priority       = sm.priority;

            if (sm.response == "500")
            {
                info.serverResponse = "500";
            }

            return(info);
        }
コード例 #10
0
        /// <summary>
        /// Parse XML and create the expected table.
        /// </summary>
        /// <param name="board_xml">XML buffer to be parse</param>
        virtual protected void ParseXml(XmlReader board_xml)
        {
            if (board_xml.NodeType == XmlNodeType.EndElement && board_xml.Name == CurrentElementName)
            {
                NewElement = true;
            }

            if (board_xml.NodeType == XmlNodeType.Element && NewElement == true)
            {
                NewElement         = false;
                CurrentElementName = board_xml.Name;
                Dr = Dt.NewRow();
                AddBoardFieldToTable();
                AddNameFieldToTable(CurrentElementName);
                Dt.Rows.Add(Dr);

                var currentelementName = board_xml.Name;
                board_xml.Read();
                if (board_xml.NodeType == XmlNodeType.Text)
                {
                    AddValueFieldToTable(board_xml.Value);
                }
                else if (board_xml.NodeType == XmlNodeType.Element)
                {
                    ParseXml(board_xml);
                }
            }
        }
コード例 #11
0
        private void LoadTreeData()
        {
            try
            {
                CTMList = Dt.Rows.Cast <DataRow>()
                          .Where(r => Equals(r["Type"], "CTM_erver"))
                          .ToDictionary(r => (string)r["Name"], r => (int)r["ID"]);
                Dt.BeginLoadData();
                UpdateComponentsParents();
                // AddFakeEMDatabases(Dt);
                AddRootNode(true ? "All Computers" : "Main Computer");
                if (true)
                {
                    var nodeId = GetMaxId(Dt);
                    var hosts  = AddHostNodes(Dt, ref nodeId);
                    AddAlternativeHosts(Dt, hosts, ref nodeId);
                }
                UpdateParentPaths(Dt);
                // UpdateFakeParentPaths(Dt);
                SetTreeTableStatuses(Dt);

                Dt.EndLoadData();
            }
            catch (Exception e)
            {
                var sMsg = string.Format("Failed to enforce Type tree table constraints on Init: {0}", e.Message);
            }
        }
コード例 #12
0
        public void CargarComboBox()
        {
            DataSet   Ds;
            DataTable Dt;
            String    cmd = string.Format("select Codigo_Estudiante, Nombre_Estudiante from Estudiante");

            Ds = Utilidades.Ejecutar(cmd);

            Dt = Ds.Tables[0];
            DataRow fila = Dt.NewRow();

            fila["Nombre_Estudiante"] = "seleccione estudiante";
            Dt.Rows.InsertAt(fila, 0);
            comboBox1.ValueMember   = "Codigo_Estudiante";
            comboBox1.DisplayMember = "Nombre_Estudiante";
            comboBox1.DataSource    = Dt;

            cmd = string.Format("select ID_Servicio , Descripcion from Servicio");
            Ds  = Utilidades.Ejecutar(cmd);

            Dt = Ds.Tables[0];
            DataRow fil = Dt.NewRow();

            fil["Descripcion"] = "seleccione Servicio";
            Dt.Rows.InsertAt(fil, 0);
            comboBox2.ValueMember   = "ID_Servicio";
            comboBox2.DisplayMember = "Descripcion";
            comboBox2.DataSource    = Dt;
        }
コード例 #13
0
        public void Load(ClsDataAccess Da, string Condition = "")
        {
            string OtherCondition = "";

            if (this.mOtherLoadCondition != "")
            {
                OtherCondition = " And " + this.mOtherLoadCondition;
            }

            DataTable Dt;
            DataRow   Dr;

            if (Condition == "")
            {
                Dt = Methods_Query.GetQuery(Da, this.mViewName, "*", "1 = 0");
                Dr = Dt.NewRow();
            }
            else
            {
                Dt = Methods_Query.GetQuery(Da, this.mViewName, "*", Condition + OtherCondition);
                if (Dt.Rows.Count > 0)
                {
                    Dr = Dt.Rows[0];
                }
                else
                {
                    Dr = Dt.NewRow();
                }
            }

            this.mDr = Dr;
        }
コード例 #14
0
        public static double COS(Dt p1, Dt p2, Dt p3)
        {
            double tmp1 = (p1.getX() - p3.getX()) * (p2.getX() - p3.getX()) + (p1.getY() - p3.getY()) * (p2.getY() - p3.getY());
            double tmp2 = Math.Sqrt((p3.getX() - p1.getX()) * (p3.getX() - p1.getX()) + (p3.getY() - p1.getY()) * (p3.getY() - p1.getY()));
            double tmp3 = Math.Sqrt((p2.getX() - p3.getX()) * (p2.getX() - p3.getX()) + (p2.getY() - p3.getY()) * (p2.getY() - p3.getY()));

            return(tmp1 / tmp2 / tmp3);
        }
コード例 #15
0
        internal void Add(Dictionary <string, string> myData)
        {
            DataRow drAdd = Dt.NewRow();

            foreach (var item in myData)
            {
                drAdd[item.Key] = item.Value;
            }
            Dt.Rows.Add(drAdd);
        }
コード例 #16
0
ファイル: DocumentStyle.cs プロジェクト: yunfandev/waslibs
        public void Merge(params DocumentStyle[] styles)
        {
            if (styles != null)
            {
                foreach (var style in styles)
                {
                    Section.Merge(style.Section);
                    Article.Merge(style.Article);
                    Header.Merge(style.Header);
                    Footer.Merge(style.Footer);
                    Main.Merge(style.Main);
                    Figure.Merge(style.Figure);
                    Details.Merge(style.Details);
                    Summary.Merge(style.Summary);
                    Div.Merge(style.Div);
                    Ul.Merge(style.Ul);
                    Ol.Merge(style.Ol);
                    Dl.Merge(style.Dl);
                    Td.Merge(style.Td);

                    Table.Merge(style.Table);

                    Img.Merge(style.Img);
                    YouTube.Merge(style.YouTube);
                    Channel9.Merge(style.Channel9);

                    H1.Merge(style.H1);
                    H2.Merge(style.H2);
                    H3.Merge(style.H3);
                    H4.Merge(style.H4);
                    H5.Merge(style.H5);
                    H6.Merge(style.H6);
                    BlockQuote.Merge(style.BlockQuote);
                    P.Merge(style.P);
                    FigCaption.Merge(style.FigCaption);
                    Pre.Merge(style.Pre);
                    Dt.Merge(style.Dt);
                    Dd.Merge(style.Dd);

                    Li.Merge(style.Li);

                    A.Merge(style.A);
                    Span.Merge(style.Span);
                    Label.Merge(style.Label);
                    Q.Merge(style.Q);
                    Cite.Merge(style.Cite);
                    I.Merge(style.I);
                    Em.Merge(style.Em);
                    Mark.Merge(style.Mark);
                    Time.Merge(style.Time);
                    Code.Merge(style.Code);
                    Strong.Merge(style.Strong);
                }
            }
        }
コード例 #17
0
ファイル: Login.aspx.cs プロジェクト: bishalsarker/ischeduler
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["user"] != null)
     {
         Dt     dt    = new Dt();
         string year  = dt.getYearVal().ToString();
         string month = dt.getMonthVal().ToString();
         string date  = dt.getDayVal().ToString();
         Response.Redirect("~/calender?y=" + year + "&m=" + month + "&d=" + date + "");
     }
 }
コード例 #18
0
 public int CompareTo(Attacks other)
 {
     try
     {
         return(Dt.CompareTo(other.Dt));
     }
     catch (Exception e)
     {
         throw;
     }
 }
コード例 #19
0
 private void ChangeRefreshMethod()
 {
     if (RadioButton)
     {
         Dt.Start();
     }
     else
     {
         Dt.Stop();
     }
 }
コード例 #20
0
        private void k100_()
        {
            try
            {
                Barco = Barcode.Text + "\n";
                DataTable Datatable  = new DataTable();
                DataTable _datatable = new DataTable();

                var OracleData = new Assest.OrcDataAcess();
                OracleData.Show(Datatable);
                listStrings.Clear();
                listStrings1.Clear();
                listStrings2.Clear();
                liqua.Clear();
                liststring4.Clear();

                foreach (DataRow Dt in Datatable.Rows)
                {
                    listStrings.Add(Dt.Field <string>("BARCODE"));
                    listStrings1.Add(Dt.Field <string>("NAME"));
                    listStrings2.Add(Dt.Field <string>("PRICE"));
                    liqua.Add(Dt.Field <string>("QUANTITY"));
                    liststring4.Add(Dt.Field <String>("ID"));
                    liststring8.Add(Dt.Field <String>("Dis"));
                }

                int numric = 0;

                for (int i = 0; i < listStrings.Count; i++)
                {
                    if (listStrings[i] == Barcode.Text || listStrings[i] == Barcode.Text + "\n")
                    {
                        Name.Text  = listStrings1[i];
                        price.Text = getwholeprice(i, listStrings2, liststring8).ToString();
                        Quan_li    = int.Parse(liqua[i]);
                        id_li      = liststring4[i];
                        numric++;
                        break;
                    }
                }
                if (numric == 0)
                {
                    DXMessageBox.Show("لم يتم العثور على نتيجة", "خطـأ", MessageBoxButton.OK, MessageBoxImage.Error);
                    Exists = 0;
                }
                if (numric != 0)
                {
                    Exists = 1;
                    PPP();
                }
            }
            catch (Exception ex) { }
        }
コード例 #21
0
        internal void Remove(Dictionary <string, string> myData)
        {
            string strSearch = SearchString(myData);

            DataRow[] drUpdate = Dt.Select(strSearch);

            if (drUpdate != null)
            {
                foreach (DataRow dr in drUpdate)
                {
                    dr.Delete();
                }
            }
        }
コード例 #22
0
ファイル: FrmManageUser2.cs プロジェクト: leofemmy/TSS_Ogun
 void AddDataRowToDataTable(ref List <AppAccessDisplay> Dt, List <AppAccessDisplay> Dtt)
 {
     if (Dtt != null)
     {
         if (Dt == null)
         {
             Dt = Dtt;
         }
         else
         {
             Dt.AddRange(Dtt);
         }
     }
 }
コード例 #23
0
 public WeatherData MapToWeatherData()
 {
     return(new WeatherData
     {
         Condition = FormatGeneralConditions(),
         Temperature = Main.Temp,
         Pressure = Main.Pressure,
         Humidity = Main.Humidity,
         WindSpeed = Wind.Speed,
         Coordinates = Coord,
         City = Name,
         Provider = Provider,
         DateTime = Dt.FromUnixTime()
     });
 }
コード例 #24
0
        public void InsertDateAndTime(string FldName, Object Data)
        {
            string   sData = "";
            DateTime Dt;

            if (sData == null)
            {
                sData = "NULL";
            }
            else
            {
                Dt    = (DateTime)Data;
                sData = "'{DATE}'";
                sData = sData.Replace("{DATE}", Dt.ToString("yyyy-MM-dd HH:mm:ss"));
            }
            InsertData("DATE", FldName, sData);
        }
コード例 #25
0
ファイル: FrmManageUser2.cs プロジェクト: leofemmy/TSS_Ogun
 void AddDataRowToDataTable2(ref List <AppAccessDisplay> Dt, List <AppAccessDisplay> Dtt)
 {
     if (Dtt != null)
     {
         if (Dt == null)
         {
             Dt = Dtt;
         }
         else
         {
             List <AppAccessDisplay> lol = Dt;
             var str = lol.Select(q => q.Entity.ModulesCode);
             Dt.AddRange(Dtt.Where(p => !str.Contains(p.Entity.ModulesCode)));
             lol = null;
         }
     }
 }
コード例 #26
0
        /// <summary>
        /// Retrieves the insurance lookup tables from the web service and caches them.
        /// </summary>
        private void Initialize()
        {
            lock (typeof(RevenueProduct))
            {
                Order     DataConnection = new Order(Page);
                DataTable Dt;
//				if (Cache["INS_Product_Type"]==null)
//				{
//					Dt = DataConnection.LookupDataSet("Insurance", "ProductTypes").Tables["INS_Product_Type"];
                if (Cache["All_INS_Product_Types"] == null)
                {
                    //START Modified by Cognizant on 12/10/2004
                    //To call the WebMethod GetAllProductTypes to fetch all Insurance Product Types (Both IIB and WU products)
                    Dt = DataConnection.LookupDataSet("Insurance", "GetAllProductTypes").Tables["All_INS_Product_Types"];
                    //END
                    //PAS AZ product configuration: Start added data view to sort the product type to be displayed in the product type drop down by cognizant on 03/15/2012
                    DataView productView = Dt.DefaultView;
                    productView.Sort = "Description";
                    Dt = productView.ToTable();
                    //PAS AZ product configuration: End added data view to sort the product type to be displayed in the product type drop down by cognizant on 03/15/2012
                    if (Dt.Rows.Count > 1)
                    {
                        DataRow Row = Dt.NewRow();
                        Row["ID"]          = "-1";
                        Row["Description"] = "All";
                        Dt.Rows.InsertAt(Row, 0);
                    }

                    //Cache["INS_Product_Type"] = Dt;
                    Cache["All_INS_Product_Types"] = Dt;
                }
                if (Cache["INS_Revenue_Type"] == null)
                {
                    Dt = DataConnection.LookupDataSet("Insurance", "RevenueTypes").Tables["INS_Revenue_Type"];
                    if (Dt.Rows.Count > 1)
                    {
                        DataRow Row = Dt.NewRow();
                        Row["ID"]          = "-1";
                        Row["Description"] = "All";
                        Dt.Rows.InsertAt(Row, 0);
                    }
                    Cache["INS_Revenue_Type"] = Dt;
                }
                DataConnection.Close();
            }
        }
コード例 #27
0
        internal void Update(Dictionary <string, string> myCurrentData, Dictionary <string, string> myNewData)
        {
            string strSearch = SearchString(myCurrentData);

            DataRow[] drUpdate = Dt.Select(strSearch);

            if (drUpdate != null)
            {
                foreach (DataRow dr in drUpdate)
                {
                    foreach (var item in myNewData)
                    {
                        dr[item.Key] = item.Value;
                    }
                }
            }
        }
コード例 #28
0
            protected override void ReplaceElementWord(params string[] args)
            {
                ReplaceXmlInnterText(Doc.GetElementsByTagName("主旨")[0].ChildNodes[0], "#kind_name_list#", args[0]);
                ReplaceXmlInnterText(Doc.GetElementsByTagName("主旨")[0].ChildNodes[0], "#issue_begin_ymd#", args[1]);
                ReplaceXmlInnterText(Doc.GetElementsByTagName("段落")[0].ChildNodes[0].ChildNodes[0], "#full_name_llist#", args[2]);
                ReplaceXmlInnterText(Doc.GetElementsByTagName("段落")[0].ChildNodes[1].ChildNodes[0], "#kind_name_list#", args[3]);

                //當 amt_type ="F" 時 文字不同, 特殊處理
                if (Dt.Select("amt_type = 'F'").Count() > 0)
                {
                    ReplaceXmlInnterText(Doc.GetElementsByTagName("主旨")[0].ChildNodes[0], "#amt_type#", "金額");
                }
                else
                {
                    ReplaceXmlInnterText(Doc.GetElementsByTagName("主旨")[0].ChildNodes[0], "#amt_type#", "適用比例");
                }
            }
コード例 #29
0
        public void InsertDate(string FldName, Object Data)
        {
            string   sData = "";
            DateTime Dt;

            if (Data == null || Data.ToString() == "")
            {
                sData = "NULL";
            }
            else
            {
                // Dt = (DateTime)Data;
                Dt    = DateTime.Parse(Data.ToString());
                sData = "'{DATE}'";
                sData = sData.Replace("{DATE}", Dt.ToString(Lib.BACK_END_DATE_FORMAT));
            }
            InsertData("DATE", FldName, sData);
        }
コード例 #30
0
        public HttpResponseMessage GetSubmitDataInfo(Dt info)
        {
            string result = string.Empty;

            try
            {
                RuleQuery_Reported_Data ruleInfo = new RuleQuery_Reported_Data();
                DataTable dtPre = ruleInfo.GetSubmitDataInfo_CQ(info.fldstcode, info.fldYWType, info.fldJCType, info.fldLevel, info.fldBeginDate, info.fldEndDate, info.fldTpyeNums, info.fldSource);
                result = rule.JsonStr("ok", "", dtPre);
            }
            catch (Exception e)
            {
                result = rule.JsonStr("error", e.Message, "");
            }
            return(new HttpResponseMessage {
                Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json")
            });
        }