コード例 #1
0
    static void Main(string[] args)
    {
        DataLogic obj = new DataLogic();

        obj.CsvToJson();
        obj.WriteData();
    }
コード例 #2
0
        static void Main(string[] args)
        {
            //var model1 = new Manage_Type() { TypeName = "CorporateManuals", ParentId = "1" };
            //var list = RecursionAnalyseExecel("1.xlsx", model1.Id, 0);
            //list.Add(model1);

            //var model2 = new Manage_Type() { TypeName = "ProcessAbbreviation", ParentId = "1" };
            //var list2 = RecursionAnalyseExecel("2.xlsx", "1d9e56bd-3064-4dc8-aeef-5c4479903b05");
            // list2.Add(model2);

            //var model3 = new Manage_Type() { TypeName = "Document Category", ParentId = "1" };
            //var list3 = RecursionAnalyseExecel("1.xlsx", "c649b8f3-8675-4e2d-8333-545a19010b47",2);
            //  list3.Add(model3);

            DataLogic dal = new DataLogic();

            var bb = dal.Query <Manage_Type>();
            var cc = bb.Select(x => x.AdminName);

            var ss = cc.First();

            Console.WriteLine("-----------------------");
            Console.WriteLine(ss);
            //Console.WriteLine();
            //list.AddRange(list2);
            //list.AddRange(list3);


            //list3.ForEach(x => dal.Add(x));
            //var res = dal.SaveChange();
            // Console.WriteLine(res.Key + res.Value);
            Console.Read();
        }
コード例 #3
0
        public void DelOrder(string tgl)
        {
            string User = HttpContext.Current.Session["NAMA"].ToString();
            string Nik  = HttpContext.Current.Session["NIK"].ToString();

            DataLogic.DeleteOrder(tgl, Nik, User);
        }
コード例 #4
0
        private void toolDelete_Click(object sender, EventArgs e)
        {
            if (dgvPayType.Rows.Count == 0)
            {
                return;
            }
            string strPayTypeCode = dgvPayType.CurrentRow.Cells["PayTypeCode"].Value.ToString();

            if (new Useful().IsExistConstraint("PayType", strPayTypeCode))
            {
                MessageBox.Show("已发生业务关系,无法删除", "软件提示");
                return;
            }
            string    strSql = "Delete From PayType Where PayTypeCode = '" + strPayTypeCode + "'";
            DataLogic dal    = new DataLogic();

            if (MessageBox.Show("确定要删除吗?", "软件提示", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
            {
                if (pt.Delete(dal, strSql))
                {
                    dgvPayType.DataSource = pt.GetDataTable("PayType", "");
                    MessageBox.Show("删除成功", "软件提示");
                }
                else
                {
                    MessageBox.Show("删除失败", "软件提示");
                }
            }
        }
コード例 #5
0
        public ActionResult SignUp(Customer customer)
        {
            if (ModelState.IsValid)
            {
                if (customer.ID != null)
                {
                    int recordsUpdated = DataLogic.UpdateCustomer(
                        customer.ID,
                        customer.FirstName,
                        customer.LastName,
                        customer.Occupation,
                        customer.City,
                        customer.State,
                        customer.Email,
                        customer.ImageURL);
                }
                else
                {
                    int recordsCreated = DataLogic.CreateCustomer(
                        customer.FirstName,
                        customer.LastName,
                        customer.Occupation,
                        customer.City,
                        customer.State,
                        customer.Email,
                        customer.ImageURL);
                }
                return(RedirectToAction("CustomerList"));
            }

            return(View());
        }
コード例 #6
0
    private void LoadLogicContent()
    {
        for (int i = 0; i < CurrentJsonData.Count; i++)
        {
            int    ID   = (int)CurrentJsonData [i] ["ID"];
            string Name = CurrentJsonData [i] ["Name"].ToString();
            List <LogicTypeContent> TypeList = new List <LogicTypeContent> ();

            for (int x = 0; x < CurrentJsonData[i]["Content"].Count; x++)
            {
                int    TypeID          = (int)CurrentJsonData [i] ["Content"] [x] ["ID"];
                string TypeName        = CurrentJsonData [i] ["Content"] [x] ["Name"].ToString();
                string TypeDescription = CurrentJsonData [i] ["Content"] [x] ["Description"].ToString();
                List <LogicSubTypeContent> SubTypeList = new List <LogicSubTypeContent> ();

                for (int y = 0; y < CurrentJsonData[i]["Content"][x]["SubtypeList"].Count; y++)
                {
                    int    SubtypeID               = (int)CurrentJsonData [i] ["Content"] [x] ["SubtypeList"] [y] ["ID"];
                    string SubtypeName             = CurrentJsonData[i]["Content"][x]["SubtypeList"][y]["Name"].ToString();
                    string SubtypeDescription      = CurrentJsonData [i] ["Content"] [x] ["SubtypeList"] [y] ["Description"].ToString();
                    LogicSubTypeContent NewSubtype = new LogicSubTypeContent(SubtypeID, SubtypeName, SubtypeDescription);
                    SubTypeList.Add(NewSubtype);
                }
                LogicTypeContent NewType = new LogicTypeContent(TypeID, TypeName, TypeDescription, SubTypeList);
                TypeList.Add(NewType);
            }

            DataLogic newlogic = new DataLogic(ID, Name, TypeList);
            CurrentDataLogic.Add(newlogic);
        }
    }
コード例 #7
0
        public bool IsExistSaleBillNo(string strSaleBillNo)
        {
            DataLogic dal = new DataLogic();

            try
            {
                //创建SqlParameter对象,并赋值
                SqlParameter param = new SqlParameter("@SaleBillNo", SqlDbType.VarChar);
                param.Value = strSaleBillNo;
                //创建泛型
                List <SqlParameter> parameters = new List <SqlParameter>();
                parameters.Add(param);
                //把泛型中的元素复制到数组中
                SqlParameter[] inputParameters = parameters.ToArray();
                DataTable      dt = dal.GetDataTable("P_IsExistSaleBillNo", inputParameters);
                if (Convert.ToInt32(dt.Rows[0][0]) > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "软件提示");
                throw ex;
            }
        }
コード例 #8
0
        public void ImportProj()
        {
            try
            {
                System.Diagnostics.Debug.WriteLine("Shenmue HD Tools - Core Module");
                string directory = null, file = null;

                OpenFileDialog newPathDlg = new OpenFileDialog();
                newPathDlg.Filter = "Shenmue HD ModTools Cache (*.shdcache)|*.shdcache";

                if (newPathDlg.ShowDialog() == DialogResult.OK)
                {
                    file      = newPathDlg.FileName;
                    directory = Path.GetDirectoryName(file);
                    loadedVFS = file;

                    List <DataEntry> readedFiles = new DataLogic().LoadCache(file, directory);

                    Program.MainWindowCore.toolStripStatusLabel1.Text = "Loading finished! (" + newPathDlg.FileName + ", " + readedFiles.Count + " files)";
                    Program.MainWindowCore.listViewMain.Visible       = true;
                }
            }
            catch (IOException e)
            {
                Program.MainWindowCore.toolStripStatusLabel1.Text = "Error at loadData: " + e.TargetSite;
            }
        }
コード例 #9
0
 public DataValue(DataLogic logic, int type, float value, int pass, int fail)
 {
     Logic = logic;
     Type  = type;
     Value = value;
     Pass  = pass;
     Fail  = fail;
 }
コード例 #10
0
        public void RegCard(string nik, string nama, string cardid, string role)
        {
            int stat = DataLogic.RegKartu(nik, nama, cardid, role);

            Context.Response.Clear();
            Context.Response.ContentType = "application/text";
            Context.Response.Write(stat);
        }
コード例 #11
0
        public void CheckToken(string token)
        {
            string stat = DataLogic.CheckToken(token);

            Context.Response.Clear();
            Context.Response.ContentType = "application/text";
            Context.Response.Write(stat);
        }
コード例 #12
0
 void Start()
 {
     dash      = false;
     godMode   = false;
     dataLogic = GameObject.FindGameObjectWithTag("DataLogic").GetComponent <DataLogic>();
     //animation = transform.FindChild("Constructor").GetComponent<AnimationCharacter>();
     colision = transform.FindChild("Collider").GetComponent <BoxCollider>();
 }
コード例 #13
0
 public void RegMember(string nik, string nama, string cardID)
 {
     DataLogic.RegAnggota(nik, nama);
     if (cardID != string.Empty)
     {
         int stat = DataLogic.RegKartu(nik, nama, cardID, "USER"); //default role
     }
 }
コード例 #14
0
        public void TotalKonfirmasi()
        {
            int d = DataLogic.TotalKonfirmasi();

            Context.Response.Clear();
            Context.Response.ContentType = "application/text";
            Context.Response.Write(d);
        }
コード例 #15
0
        public DataTable GetNikNamaDekstop()
        {
            DataTable d = DataLogic.GetDataNikNama();

            return(d);
            //string JSONString = string.Empty;
            //JSONString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
        }
コード例 #16
0
        public AlgorithmController(IConfiguration configuration, IHostingEnvironment env, IOptions <TwilioConfiguration> twilioConfig)
        {
            var context = new DissertationContext(configuration, env);

            _algorithm    = new AlgorithmLogic();
            _data         = new DataLogic(context);
            _other        = new OtherLogic();
            _twilioConfig = twilioConfig.Value;
        }
コード例 #17
0
        public static IEnumerable <Tournament> GetTournaments(int?id, int?countryId)
        {
            var SportAndCountryTournaments = DataLogic.GetSportTournaments().Where(x => x.CountryId == countryId && x.SportId == id);
            var countriesTournament        = from tournament in DataLogic.GetAllTournament()
                                             where SportAndCountryTournaments.Any(events => events.TournamentId == tournament.TournamentId)
                                             select tournament;

            return(countriesTournament);
        }
コード例 #18
0
        public void QueryTest()
        {
            var dal = new DataLogic <Manage_Type>();
            var ss  = dal.Query();

            ss = ss.Where(x => x.TypeName.Length > 3);

            Assert.IsNull(ss);
        }
コード例 #19
0
        public ActionResult Index()
        {
            TipsData emTipsData = DataLogic.GetRattSvarEntity();

            Random rand = new Random();

            ViewBag.Number = rand.Next(999).ToString();

            return(View(emTipsData));
        }
コード例 #20
0
        public void GetResetData()
        {
            DataTable d          = DataLogic.GetResetData();
            string    JSONString = string.Empty;

            JSONString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            Context.Response.Write("{\"data\": " + JSONString + "}");
        }
コード例 #21
0
        public void RemoveTest()
        {
            var dal   = new DataLogic <Manage_Type>();
            var model = dal.Query(x => x.Path == "jkjk").First();

            dal.Remove(model);
            var res = dal.SaveChange();

            Assert.IsTrue(res.Key, res.Value);
        }
コード例 #22
0
        public ActionResult Comment(TipsComment model)
        {
            var success = DataLogic.SaveComment(model);

            ModelState.Clear();

            ViewBag.ThankYouForYourComment = "Tack för din kommentar!";

            return(View());
        }
コード例 #23
0
 // Use this for initialization
 void Start()
 {
     screen        = State.START;
     loadingScreen = GameObject.FindGameObjectWithTag("LoadingScreen").
                     GetComponent <LoadingScreen>();
     dataLogic = GameObject.FindGameObjectWithTag("DataLogic").
                 GetComponent <DataLogic>();
     down     = false;
     controls = false;
     credits  = false;
 }
コード例 #24
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            try
            {
                string   dirFullPath = HttpContext.Current.Server.MapPath("~/Images/");
                string   tgl         = context.Request["id"];
                string[] files;
                string   gambar;
                int      numFiles;
                files    = System.IO.Directory.GetFiles(dirFullPath);
                numFiles = files.Length;
                numFiles = numFiles + 1;
                string str_image = "";
                string stat      = "0";

                foreach (string s in context.Request.Files)
                {
                    HttpPostedFile file          = context.Request.Files[s];
                    string         fileName      = file.FileName;
                    string         fileExtension = file.ContentType;
                    if (!string.IsNullOrEmpty(fileName))
                    {
                        fileExtension = Path.GetExtension(fileName);
                        str_image     = "Gambar_" + numFiles.ToString() + DateTime.Now.ToString("yyyyMMddHHmmss") + fileExtension;
                        string pathToSave_100 = HttpContext.Current.Server.MapPath("~/Images/") + str_image;

                        gambar = DataLogic.getGambar(tgl);

                        if (gambar != "")
                        {
                            var pathToDelete = HttpContext.Current.Server.MapPath("~/Images/") + gambar;
                            File.Delete(pathToDelete);
                            file.SaveAs(pathToSave_100);
                        }
                        else
                        {
                            file.SaveAs(pathToSave_100);
                        }
                        DataLogic.InsertGambar(str_image, tgl);
                        stat = "1";
                    }
                }
                //  database record update logic here  ()

                //context.Response.Write(str_image);
                context.Response.Clear();
                context.Response.ContentType = "application/text";
                context.Response.Write(stat);
            }
            catch (Exception ac)
            {
            }
        }
コード例 #25
0
        public void SearchNik(string nik)
        {
            string nama = DataLogic.CariNik(nik);

            string n          = string.Empty;
            string JSONString = string.Empty;

            Context.Response.Clear();
            Context.Response.ContentType = "application/text";
            Context.Response.Write(nama);
        }
コード例 #26
0
        public void RecapOrder()
        {
            string    periode    = HttpContext.Current.Session["PERIODRECAP"].ToString();;
            DataTable d          = DataLogic.RecapOrder(periode);
            string    n          = string.Empty;
            string    JSONString = string.Empty;

            JSONString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            Context.Response.Write("{\"data\": " + JSONString + "}");
        }
コード例 #27
0
ファイル: StudentLogic.cs プロジェクト: keizer619/practical01
 public DataTable GetStudent()
 {
     try
     {
         DataLogic dl = new DataLogic();
         return(dl.GetStudent());
     }
     catch (Exception exc)
     {
         throw exc;
     }
 }
コード例 #28
0
        public void GetMenuBooking()
        {
            string    pernr      = Session["NIK"].ToString();
            DataTable d          = DataLogic.GetAllMenuBooking(pernr);
            string    n          = string.Empty;
            string    JSONString = string.Empty;

            JSONString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            Context.Response.Write("{\"data\": " + JSONString + "}");
        }
コード例 #29
0
        public void GetMenu()
        {
            string    Period     = HttpContext.Current.Session["PERIODMENU"].ToString();;
            DataTable d          = DataLogic.GetAllMenu(Period);
            string    n          = string.Empty;
            string    JSONString = string.Empty;

            JSONString = Newtonsoft.Json.JsonConvert.SerializeObject(d);
            Context.Response.Clear();
            Context.Response.ContentType = "application/json";
            Context.Response.Write("{\"data\": " + JSONString + "}");
        }
コード例 #30
0
        public ActionResult SignUp(int ID)
        {
            if (ID != 0)
            {
                CustomerDataModel customer = DataLogic.GetCustomer(ID);
                ViewBag.Message = "Update Customer";
                return(View(customer));
            }

            ViewBag.Message = "Add New Customer";

            return(View());
        }