public void AddThoiGianHoatDongCuaShop(ThoiGianHoatDongCuaShop dm) { en.AddObject("ThoiGianHoatDongCuaShop", dm); }
public void InsertThoiGianHoatDongCuaShop(FormCollection collection, int QLSHOP_ID) { var sp = new ThoiGianHoatDongCuaShop(); if (collection["hinhthuc"] == "tinhphi") { var GetQL = QLGDKSRes.GetQLGiaDangKyShop(int.Parse(collection["giaca"])); var TongCong = float.Parse(collection["SoNgayThangNam_"+collection["giaca"]])* GetQL.Gia; sp.TongTien = TongCong; sp.Gia = GetQL.Gia; sp.SoNgayThangNam = float.Parse(collection["SoNgayThangNam_" + collection["giaca"]]); } IFormatProvider provider = new System.Globalization.CultureInfo("en-CA", true); String datetime = collection["datePicker"]; DateTime dt = DateTime.Parse(datetime, provider, System.Globalization.DateTimeStyles.NoCurrentDateDefault); sp.NgayBatDau = dt; sp.Account_ID = 1; sp.QLSHOP_ID = QLSHOP_ID; sp.NgayTao = DateTime.Now; sp.TrangThai = collection["hinhthuc"]; QLSHOPRes.AddThoiGianHoatDongCuaShop(sp); QLSHOPRes.Save(); }