本文整理汇总了C#中SharedDbConnectionScope类的典型用法代码示例。如果您正苦于以下问题:C# SharedDbConnectionScope类的具体用法?C# SharedDbConnectionScope怎么用?C# SharedDbConnectionScope使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SharedDbConnectionScope类属于命名空间,在下文中一共展示了SharedDbConnectionScope类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CapnhatSoluong
public static ActionResult CapnhatSoluong(long id, int soluongngay,byte cachtinhsoluong)
{
try
{
using (var scope = new TransactionScope())
{
using (var sh = new SharedDbConnectionScope())
{
new Update(NoitruPhanbuonggiuong.Schema)
.Set(NoitruPhanbuonggiuong.Columns.SoLuong).EqualTo(soluongngay)
.Set(NoitruPhanbuonggiuong.Columns.CachtinhSoluong).EqualTo(cachtinhsoluong)
.Where(NoitruPhanbuonggiuong.Columns.Id).IsEqualTo(id).Execute();
}
scope.Complete();
return ActionResult.Success;
}
}
catch (Exception exception)
{
Utility.CatchException(exception);
return ActionResult.Error;
}
}
示例2: TongHopChiPhi
/// <summary>
///
/// </summary>
/// <param name="objPatientExam"></param>
/// <param name="Khoanoitru_tonghop">true= Khoa nội trú tự chốt dữ liệu;fasle= Khoa tổng hợp chốt dữ liệu</param>
/// <returns></returns>
public static ActionResult TongHopChiPhi(KcbLuotkham objPatientExam,short idKhoanoitru, bool Khoanoitru_tonghop)
{
try
{
using (var scope = new TransactionScope())
{
using (var sh = new SharedDbConnectionScope())
{
new Update(KcbLuotkham.Schema)
.Set(KcbLuotkham.Columns.TrangthaiNoitru).EqualTo(Utility.Int32Dbnull(objPatientExam.TrangthaiNoitru))
.Set(KcbLuotkham.Columns.TthaiThopNoitru).EqualTo(Utility.Int32Dbnull(objPatientExam.TthaiThopNoitru))
.Set(KcbLuotkham.Columns.NguoiSua).EqualTo(globalVariables.UserName)
.Set(KcbLuotkham.Columns.NgaySua).EqualTo(DateTime.Now)
.Where(KcbLuotkham.Columns.MaLuotkham).IsEqualTo(objPatientExam.MaLuotkham)
.And(KcbLuotkham.Columns.IdBenhnhan)
.IsEqualTo(Utility.Int32Dbnull(objPatientExam.IdBenhnhan))
.Execute();
SPs.NoitruChotdulieuravien(objPatientExam.MaLuotkham, objPatientExam.IdBenhnhan, idKhoanoitru, Utility.Bool2byte(Khoanoitru_tonghop), (byte)(Utility.Byte2Bool(KcbLuotkham.Columns.TthaiThopNoitru) ? 1 : 0)).Execute();
}
scope.Complete();
return ActionResult.Success;
}
}
catch (Exception ex)
{
return ActionResult.Error;
}
}
示例3: ChuyenPhong
public static ActionResult ChuyenPhong(long IdKham,string LydoChuyen, DmucDichvukcb objDichvuKcb)
{
try
{
ActionResult _ActionResult = ActionResult.Success;
using (var Scope = new TransactionScope())
{
using (var dbScope = new SharedDbConnectionScope())
{
new Update(KcbDangkyKcb.Schema)
.Set(KcbDangkyKcb.Columns.IdPhongkham).EqualTo(objDichvuKcb.IdPhongkham)
.Set(KcbDangkyKcb.Columns.IdDichvuKcb).EqualTo(objDichvuKcb.IdDichvukcb)
.Set(KcbDangkyKcb.Columns.IdKieukham).EqualTo(objDichvuKcb.IdKieukham)
.Set(KcbDangkyKcb.Columns.TenDichvuKcb).EqualTo(objDichvuKcb.TenDichvukcb)
.Set(KcbDangkyKcb.Columns.NgayDangky).EqualTo(globalVariables.SysDate)
.Set(KcbDangkyKcb.Columns.NguoiChuyen).EqualTo(globalVariables.UserName)
.Set(KcbDangkyKcb.Columns.NgayChuyen).EqualTo(globalVariables.SysDate)
.Set(KcbDangkyKcb.Columns.LydoChuyen).EqualTo(LydoChuyen)
.Set(KcbDangkyKcb.Columns.TrangthaiChuyen).EqualTo(1)
.Where(KcbDangkyKcb.Columns.IdKham).IsEqualTo(IdKham)
.Execute();
}
Scope.Complete();
return ActionResult.Success;
}
}
catch (Exception ex)
{
Utility.ShowMsg("Lỗi khi chuyển đối tượng:\n"+ex.Message);
return ActionResult.Exception;
}
}
示例4: On_ActionAdd
protected override void On_ActionAdd(object sender, EventArgs e)
{
if (AppContext.Context.CompanyType == CompanyType.MealCompany)
{
txtMessage.InnerHtml = "阁下的商家类型无权使用此功能";
return;
}
if (!ValidateData( ))
{
txtMessage.InnerHtml = "保存失败!";
return;
}
try
{
using (TransactionScope ts = new TransactionScope( ))
{
using (SharedDbConnectionScope ss = new SharedDbConnectionScope( ))
{
SaveData( );
OrderBLL.UpdateBalance( );
ts.Complete( );
}
}
txtMessage.InnerHtml = "保存成功!";
ResetField( );
}
catch (Exception ex)
{
Logging.Log("FinanceCash->On_ActionAdd", ex, true);
txtMessage.InnerHtml = ex.Message;
}
}
示例5: UpdateDynamicValues
public ActionResult UpdateDynamicValues(List<DynamicValue> lstValues)
{
try
{
using (var scope = new TransactionScope())
{
using (var sp = new SharedDbConnectionScope())
{
foreach (DynamicValue _object in lstValues)
{
if (_object.Id > 0)
{
_object.MarkOld();
_object.IsNew = false;
_object.Save();
}
else//Insert
{
_object.IsNew = true;
_object.Save();
}
}
}
scope.Complete();
return ActionResult.Success;
}
}
catch (Exception exception)
{
Utility.ShowMsg(exception.Message);
return ActionResult.Error;
}
}
示例6: On_ActionEdit
protected override void On_ActionEdit(object sender, EventArgs e)
{
using (TransactionScope ts = new TransactionScope( ))
{
using (SharedDbConnectionScope ss = new SharedDbConnectionScope( ))
{
try
{
if (CompanyBLL.IsMaxPointLevel(CurrentUser.CompanyId.Value, 0))
txtMessage.InnerHtml = "累计赠送的积分已经超过500,须进行积分结算后才能继续操作系统";
else if (formView.Save<SysCompanyAd>(AdsID) == 0)
{
ts.Complete( );
txtMessage.InnerHtml = "保存成功";
//formView.ClearValue( );
}
else
txtMessage.InnerHtml = "保存失败";
}
catch (Exception ex)
{
Logging.Log("CompanyAdsEdit->On_ActionEdit", ex, true);
txtMessage.InnerHtml = ex.Message;
}
}
}
On_ActionQuery(sender, e);
}
示例7: CHOT_CAPPHAT
public ActionResult CHOT_CAPPHAT(List<int> lstIDDonthuoc, DateTime Ngay_Chot)
{
int v_intResult;
ActionResult actResult;
try
{
using (var scope = new TransactionScope())
{
using (var dbscope = new SharedDbConnectionScope())
{
TLichsuChotthuoc _newItem = new TLichsuChotthuoc();
_newItem.NgayChot = Ngay_Chot;
_newItem.NguoiChot = globalVariables.UserName;
_newItem.IsNew = true;
_newItem.Save();
object obj = TLichsuChotthuoc.CreateQuery().GetMax("ID_CHOT");
TPhieuXuatthuocBenhnhanCollection vCollection = new TPhieuXuatthuocBenhnhanCollection();
v_intResult = new Update(TPhieuXuatthuocBenhnhan.Schema.TableName).Set(TPhieuXuatthuocBenhnhan.NgayChotColumn).EqualTo(Ngay_Chot)
.Set(TPhieuXuatthuocBenhnhan.IdChotColumn).EqualTo(Utility.Int32Dbnull(obj, -1))
.Where(TPhieuXuatthuocBenhnhan.NgayChotColumn).IsNull()
.And(TPhieuXuatthuocBenhnhan.IdDonthuocColumn).In(lstIDDonthuoc)
.Execute();
}
scope.Complete();
return ActionResult.Success;
}
}
catch (Exception ex)
{
Utility.ShowMsg("Lỗi:\n" + ex.ToString());
return ActionResult.Error;
}
}
示例8: Capnhattrangthaithanhtoan
public ActionResult Capnhattrangthaithanhtoan(long IdThanhtoan)
{
try
{
using (var scope = new TransactionScope())
{
using (var dbscope = new SharedDbConnectionScope())
{
new Update(KcbThanhtoan.Schema)
.Set(KcbThanhtoan.Columns.NguoiIn).EqualTo(globalVariables.UserName)
.Set(KcbThanhtoan.Columns.NgayIn).EqualTo(globalVariables.SysDate)
.Set(KcbThanhtoan.Columns.TrangthaiIn).EqualTo(1)
.Where(KcbThanhtoan.Columns.IdThanhtoan).IsEqualTo(IdThanhtoan).Execute();
}
scope.Complete();
return ActionResult.Success;
}
}
catch (Exception exception)
{
log.InfoException("Ban ra loi exception=", exception);
return ActionResult.Error;
}
}
示例9: On_ActionEdit
protected override void On_ActionEdit(object sender, EventArgs e)
{
if (!CompanyBLL.CheckIsOwnerUser(UserID, CurrentUser.CompanyId.Value))
{
txtMessage.InnerHtml = "你无权编辑非本店会员";
goto lbl_end;
}
if (UserID == CurrentUser.Id)
{
txtMessage.InnerHtml = "此账号为系统内置账号,不能修改.";
goto lbl_end;
}
using (TransactionScope ts = new TransactionScope( ))
{
using (SharedDbConnectionScope ss = new SharedDbConnectionScope( ))
{
if (formView.Save<SysMember>(UserID) == 0)
{
if(isChangePhoneNum)
{
UcFormView.FormViewRow phone = formView.GetViewRow(SysMember.MemberPhoneNumberColumn);
CompanyBLL.UpdateUserPhone(phone.ParamValue, phone.DbValue);
}
ts.Complete( );
txtMessage.InnerHtml = "保存成功!";
}
else
txtMessage.InnerHtml = "保存失败";
}
}
lbl_end:
On_ActionQuery(sender, e);
}
示例10: UpdateBienLaiHoaDon
/// <summary>
/// hàm thực hiệnv iệc update thông tin của biên lại hóa đơn
/// </summary>
/// <param name="objhoalog"></param>
/// <param name="objPayment"></param>
/// <param name="HOADON_CAPPHAT_ID"></param>
/// <returns></returns>
public ActionResult UpdateBienLaiHoaDon(HoadonLog objhoalog, KcbThanhtoan objPayment, int HOADON_CAPPHAT_ID)
{
try
{
using (var Scope = new TransactionScope())
{
using (var dbScope = new SharedDbConnectionScope())
{
objhoalog.IdThanhtoan = Utility.Int32Dbnull(objPayment.IdThanhtoan);
objhoalog.IdBenhnhan = Utility.Int32Dbnull(objPayment.IdBenhnhan);
objhoalog.MaLuotkham = Utility.sDbnull(objPayment.MaLuotkham);
objhoalog.MaNhanvien = globalVariables.UserName;
objhoalog.NgayIn = globalVariables.SysDate;
objhoalog.TrangThai = 0;
objhoalog.IsNew = true;
objhoalog.Save();
new Update(HoadonCapphat.Schema)
.Set(HoadonCapphat.Columns.SerieHientai).EqualTo(objhoalog.Serie)
.Set(HoadonCapphat.Columns.TrangThai).EqualTo(1)
.Where(HoadonCapphat.Columns.IdCapphat).IsEqualTo(HOADON_CAPPHAT_ID).
Execute();
}
Scope.Complete();
return ActionResult.Success;
}
}
catch (Exception exception)
{
return ActionResult.Error;
}
}
示例11: NoptienTamung
public static bool NoptienTamung(NoitruTamung objTamung)
{
try
{
using (var scope = new TransactionScope())
{
using (var sh = new SharedDbConnectionScope())
{
objTamung.Save();
KcbLuotkham objKcbLuotkham = Utility.getKcbLuotkham(objTamung.IdBenhnhan, objTamung.MaLuotkham);
if (objKcbLuotkham != null)
{
objKcbLuotkham.IsNew = false;
objKcbLuotkham.MarkOld();
if (Utility.ByteDbnull(objKcbLuotkham.TrangthaiNoitru, 0) == 1)
{
objKcbLuotkham.TrangthaiNoitru = 2;
objKcbLuotkham.Save();
}
}
}
scope.Complete();
}
return true;
}
catch (Exception ex)
{
return false;
}
}
示例12: ChuyentoanboVTTHvaogoi
public ActionResult ChuyentoanboVTTHvaogoi(long IdDonthuoc,int id_goi)
{
try
{
using (var scope = new TransactionScope())
{
using (var sh = new SharedDbConnectionScope())
{
new Update(KcbDonthuoc.Schema)
.Set(KcbDonthuoc.Columns.IdGoi).EqualTo(id_goi)
.Set(KcbDonthuoc.Columns.TrongGoi).EqualTo(1)
.Where(KcbDonthuoc.Columns.IdDonthuoc).IsEqualTo(IdDonthuoc).Execute();
new Update(KcbDonthuocChitiet.Schema)
.Set(KcbDonthuocChitiet.Columns.IdGoi).EqualTo(id_goi)
.Set(KcbDonthuocChitiet.Columns.TrongGoi).EqualTo(1)
.Where(KcbDonthuocChitiet.Columns.IdDonthuoc).IsEqualTo(IdDonthuoc).Execute();
}
scope.Complete();
return ActionResult.Success;
}
}
catch (Exception exception)
{
log.Error("loi trong qua trinh xoa phieu dieu tri {0}", exception.ToString());
return ActionResult.Error;
}
}
示例13: DanhdautrangthaiTiem
public ActionResult DanhdautrangthaiTiem(KcbDonthuocChitiet objChitiet, long _IdKham, bool Da_tiem)
{
try
{
using (var scope = new TransactionScope())
{
using (var sh = new SharedDbConnectionScope())
{
if (objChitiet != null)
{
objChitiet.IsNew = false;
objChitiet.DaDung = Utility.Bool2byte(Da_tiem);
objChitiet.MarkOld();
objChitiet.Save();
}
else
{
new Update(KcbDonthuocChitiet.Schema)
.Set(KcbDonthuocChitiet.Columns.DaDung).EqualTo(Utility.Bool2byte(Da_tiem))
.Where(KcbDonthuocChitiet.Columns.IdKham).IsEqualTo(_IdKham)
.Execute();
}
}
scope.Complete();
return ActionResult.Success;
}
}
catch (Exception exception)
{
log.Error("Loi trong qua trinh chuyen vien khoi noi tru {0}", exception);
return ActionResult.Error;
}
}
示例14: On_ActionDelete
protected override void On_ActionDelete(object sender, EventArgs e)
{
TransactionScope ts = new TransactionScope( );
SharedDbConnectionScope ss = new SharedDbConnectionScope( );
try
{
int cashID = Utilities.ToInt(EVENTARGUMENT);
string message;
if (OrderBLL.DeleteMemberCash(cashID, AppContext.Context.Company, out message))
{
OrderBLL.UpdateBalance( );
ts.Complete( );
}
txtMessage.InnerHtml = message;
}
catch (Exception ex)
{
Logging.Log("FinanceList->On_ActionDelete", ex, true);
txtMessage.InnerHtml = ex.Message;
}
finally
{
ss.Dispose( );
ts.Dispose( );
}
On_ActionQuery(sender, e);
}
示例15: Capnhatgia
public static ActionResult Capnhatgia(long id, decimal don_gia, byte cachtinh_gia)
{
try
{
using (var scope = new TransactionScope())
{
using (var sh = new SharedDbConnectionScope())
{
new Update(NoitruPhanbuonggiuong.Schema)
.Set(NoitruPhanbuonggiuong.Columns.DonGia).EqualTo(don_gia)
.Set(NoitruPhanbuonggiuong.Columns.CachtinhGia).EqualTo(cachtinh_gia)
.Where(NoitruPhanbuonggiuong.Columns.Id).IsEqualTo(id).Execute();
}
scope.Complete();
return ActionResult.Success;
}
}
catch (Exception exception)
{
Utility.CatchException(exception);
return ActionResult.Error;
}
}