当前位置: 首页>>代码示例>>C#>>正文


C# PersistentManager.Commit方法代码示例

本文整理汇总了C#中THOK.Util.PersistentManager.Commit方法的典型用法代码示例。如果您正苦于以下问题:C# PersistentManager.Commit方法的具体用法?C# PersistentManager.Commit怎么用?C# PersistentManager.Commit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在THOK.Util.PersistentManager的用法示例。


在下文中一共展示了PersistentManager.Commit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddMix

        public int AddMix(string billNo, DataRow newRow)
        {
            int result = 1;
            using (PersistentManager pm = new PersistentManager())
            {
                ProductStateDao psDao = new ProductStateDao();
                try
                {
                    pm.BeginTransaction();
                    result = psDao.UpdateMix(billNo, newRow["MIXID"].ToString(), Convert.ToDouble(newRow["QUANTITY"]));
                    if (result != 1)
                        throw new Exception("����������Ϊ1");

                    result = psDao.UpdateMixID(billNo, newRow["PRODUCTCODE"].ToString(), newRow["ITEMNO"].ToString(), newRow["MIXID"].ToString());
                    if (result != 1)
                        throw new Exception("����������Ϊ1");

                    pm.Commit();
                }
                catch
                {
                    pm.Rollback();
                }
            }
            return result;
        }
开发者ID:SaintLoong,项目名称:PFK,代码行数:26,代码来源:ProductStateDal.cs

示例2: DeleteFormula

        public void DeleteFormula(string formulaCode)
        {
            using (PersistentManager pm = new PersistentManager())
            {
                FormulaDao formulaDao = new FormulaDao();
                ScheduleDao scheduleDao = new ScheduleDao();
                try
                {
                    pm.BeginTransaction();

                    if (scheduleDao.Find(formulaCode) == 0)
                    {
                        formulaDao.DeleteDetail(formulaCode);
                        formulaDao.DeleteMaster(formulaCode);
                    }
                    else
                        throw new Exception("��ǰ�䷽�����������ƻ��Ѱ�");

                    pm.Commit();
                }
                catch (Exception e)
                {
                    pm.Rollback();
                    throw new Exception(e.Message);
                }
            }
        }
开发者ID:SaintLoong,项目名称:PFK,代码行数:27,代码来源:FormulaDal.cs

示例3: AddBill

        public void AddBill(DataRow masterRow, string userID, DataTable detailTable)
        {
            using (PersistentManager pm = new PersistentManager())
            {
                try
                {
                    pm.BeginTransaction();
                    string billNo = palletDao.FindNewBillNo(masterRow["BILLDATE"].ToString());

                    masterRow["BILLNO"] = billNo;
                    //���뵥������
                    palletDao.InsertMaster(masterRow, userID);

                    //���뵥����ϸ��
                    palletDao.InsertDetail(billNo, detailTable);

                    pm.Commit();
                }
                catch (Exception e)
                {
                    pm.Rollback();
                    throw new Exception(e.Message);
                }
            }
        }
开发者ID:SaintLoong,项目名称:PFK,代码行数:25,代码来源:PalletDal.cs

示例4: AddBill3

        public void AddBill3(DataRow masterRow, DataTable detailTable)
        {
            using (PersistentManager pm = new PersistentManager())
            {
                try
                {
                    BillDao billDao = new BillDao();
                    ProductStateDao stateDao = new ProductStateDao();

                    pm.BeginTransaction();

                    string billNo = billDao.FindNewBillNo("P", masterRow["BILLDATE"].ToString());

                    masterRow["BILLNO"] = billNo;
                    //���뵥������
                    billDao.InsertMaster(masterRow);

                    stateDao.Insert(billNo, detailTable);
                    pm.Commit();
                }
                catch (Exception e)
                {
                    pm.Rollback();
                    throw new Exception(e.Message);
                }
            }
        }
开发者ID:SaintLoong,项目名称:PFK,代码行数:27,代码来源:BillDal.cs

示例5: CancelTask

        public void CancelTask(string billNo)
        {
            using (PersistentManager pm = new PersistentManager())
            {
                TaskDao taskDao = new TaskDao();
                BillDao billDao = new BillDao();
                CellDao cellDao = new CellDao();

                try
                {
                    pm.BeginTransaction();

                    int count = taskDao.FindExecutingTask(billNo);
                    if (count != 0)
                        throw new Exception("����δִ�л�ִ���е���ҵ��");

                    if (cellDao.Update(billNo) > 0)
                    {
                        taskDao.Backup(billNo);
                        taskDao.Delete(billNo);
                        billDao.UpdateMasterState(billNo, "6");//����Ϊȡ��
                    }
                    else
                        throw new Exception("�õ���ȫ����ҵ�����");

                    pm.Commit();
                }
                catch (Exception e)
                {
                    pm.Rollback();
                    throw new Exception(e.Message);
                }

            }
        }
开发者ID:SaintLoong,项目名称:PFK,代码行数:35,代码来源:TaskDal.cs

示例6: CancelTaskIn

        public void CancelTaskIn(string billNo)
        {
            using (PersistentManager pm = new PersistentManager())
            {
                TaskDao taskDao = new TaskDao();
                BillDao billDao = new BillDao();
                CellDao cellDao = new CellDao();
                ScheduleDao scheduleDao = new ScheduleDao();
                ProductStateDao productStateDao = new ProductStateDao();

                try
                {
                    pm.BeginTransaction();

                    int count = taskDao.FindExecutingTask(billNo);
                    if (count != 0)
                        throw new Exception("����δִ�л�ִ���е���ҵ��");

                    taskDao.Backup(billNo);
                    taskDao.Delete(billNo);
                    billDao.UpdateMasterState(billNo, "6");//����Ϊȡ��
                    productStateDao.Delete(billNo);
                    //�������ⵥ���̰����������������ƻ�ISOUTΪ�����
                    scheduleDao.UpdateIsIn(billNo);

                    pm.Commit();
                }
                catch (Exception e)
                {
                    pm.Rollback();
                    throw new Exception(e.Message);
                }

            }
        }
开发者ID:SaintLoong,项目名称:PFK,代码行数:35,代码来源:TaskDal.cs

示例7: SaveParameter

 public void SaveParameter(Dictionary<string, string> parameters)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         try
         {
             SysSystemParameterDao parameterDao = new SysSystemParameterDao();
             pm.BeginTransaction();
             foreach (string key in parameters.Keys)
             {
                 parameterDao.UpdateEntity(key, parameters[key]);
             }
             pm.Commit();
         }
         catch
         {
             pm.Rollback();
         }
     }
 }
开发者ID:Guoyingbin,项目名称:THOK.SortingSystem,代码行数:20,代码来源:SysParameterDal.cs

示例8: ClearFormula

 public void ClearFormula(string scheduleNo, string formulaCode)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         ScheduleDao scheduleDao = new ScheduleDao();
         FormulaDao formulaDao = new FormulaDao();
         try
         {
             pm.BeginTransaction();
             formulaDao.PlusUseCount(formulaCode);
             scheduleDao.UpdateFormula(scheduleNo, "");
             pm.Commit();
         }
         catch (Exception e)
         {
             pm.Rollback();
             throw new Exception(e.Message);
         }
     }
 }
开发者ID:SaintLoong,项目名称:PFK,代码行数:20,代码来源:ScheduleDal.cs

示例9: DeleteBill

        public void DeleteBill(string billNo)
        {
            using (PersistentManager pm = new PersistentManager())
            {
                try
                {
                    pm.BeginTransaction();

                    palletDao.DeleteMaster(billNo);
                    palletDao.DeleteDetail(billNo);

                    pm.Commit();
                }
                catch (Exception e)
                {
                    pm.Rollback();
                    throw new Exception(e.Message);
                }
            }
        }
开发者ID:SaintLoong,项目名称:PFK,代码行数:20,代码来源:PalletDal.cs

示例10: AddBill

        public void AddBill(DataRow masterRow, DataTable detailTable, Dictionary<string, DataTable> productState, string prefix, string billDate)
        {
            using (PersistentManager pm = new PersistentManager())
            {
                try
                {
                    BillDao billDao = new BillDao();
                    ProductStateDao stateDao = new ProductStateDao();
                    ScheduleDao scheduleDao = new ScheduleDao();

                    pm.BeginTransaction();
                    string billNo = billDao.FindNewBillNo(prefix, billDate);

                    masterRow["BILLNO"] = billNo;
                    //���뵥������
                    billDao.InsertMaster(masterRow);

                    //���뵥����ϸ��
                    billDao.InsertDetail(billNo, detailTable);

                    if (productState != null)
                    {
                        //����ProductState��
                        int itemNo = 1;
                        foreach (DataTable stateTable in productState.Values)
                        {
                            stateDao.Insert(masterRow["SCHEDULENO"].ToString(),
                                        billNo,
                                        stateTable,
                                        ref itemNo);
                        }
                    }
                    pm.Commit();
                }
                catch (Exception e)
                {
                    pm.Rollback();
                    throw new Exception(e.Message);
                }
            }
        }
开发者ID:SaintLoong,项目名称:PFK,代码行数:41,代码来源:BillDal.cs

示例11: AddUnit

 public void AddUnit(DataRow row)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         try
         {
             pm.BeginTransaction();
             UnitDao unitDao = new UnitDao();
             if (unitDao.FindUnit(row["UNITCODE"].ToString()) == 0)
                 unitDao.InsertUnit(row);
             else
                 throw new Exception("������λ�Ѵ��ڣ����������롣");
             pm.Commit();
         }
         catch (Exception e)
         {
             pm.Rollback();
             throw new Exception(e.Message);
         }
     }
 }
开发者ID:SaintLoong,项目名称:PFK,代码行数:21,代码来源:UnitDal.cs

示例12: AddUnitClass

 public void AddUnitClass(string classCode, string className, string memo)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         try
         {
             pm.BeginTransaction();
             UnitDao unitDao = new UnitDao();
             if (unitDao.FindUnitClass(classCode) == 0)
                 unitDao.InsertUnitClass(classCode, className, memo);
             else
                 throw new Exception("������λ����Ѵ��ڣ����������롣");
             pm.Commit();
         }
         catch (Exception e)
         {
             pm.Rollback();
             throw new Exception(e.Message);
         }
     }
 }
开发者ID:SaintLoong,项目名称:PFK,代码行数:21,代码来源:UnitDal.cs

示例13: AddBillType

 public void AddBillType(string billCode, string billName, int billType, int taskLevel, string memo)
 {
     using (PersistentManager pm = new PersistentManager())
     {
         try
         {
             pm.BeginTransaction();
             BillTypeDao billTypeDao = new BillTypeDao();
             if (billTypeDao.Find(billCode) == 0)
                 billTypeDao.Insert(billCode, billName, billType, taskLevel, memo);
             else
                 throw new Exception("��Ʒ�Ѵ��ڣ����������롣");
             pm.Commit();
         }
         catch (Exception e)
         {
             pm.Rollback();
             throw new Exception(e.Message);
         }
     }
 }
开发者ID:SaintLoong,项目名称:PFK,代码行数:21,代码来源:BillTypeDal.cs

示例14: ClearBillNo

        public void ClearBillNo(string scheduleNo, string billNo)
        {
            using (PersistentManager pm = new PersistentManager())
            {
                ScheduleDao scheduleDao = new ScheduleDao();
                BillDao billDao = new BillDao();
                ProductStateDao stateDao = new ProductStateDao();
                try
                {
                    pm.BeginTransaction();

                    DataTable billTable = billDao.FindMaster(billNo);
                    if (billTable.Rows.Count != 0)
                    {
                        if (billTable.Rows[0]["STATE"].ToString() == "1")
                        {
                            billDao.DeleteDetail(billNo);
                            billDao.DeleteMaster(billNo);
                            stateDao.Delete(billNo);
                            scheduleDao.UpdateBillNo(scheduleNo, "");
                        }
                        else
                            throw new Exception("����״̬Ϊ'���'�����ܽ����������");
                    }
                    else
                        throw new Exception(string.Format("���ݱ��Ϊ'{0}'�ĵ��ݲ����ڡ�", billNo));

                    pm.Commit();
                }
                catch (Exception e)
                {
                    pm.Rollback();
                    throw new Exception(e.Message);
                }
            }
        }
开发者ID:SaintLoong,项目名称:PFK,代码行数:36,代码来源:ScheduleDal.cs

示例15: SendBill

        public void SendBill(string oriBillNo, string sysDate, string userID, string status)
        {
            using (PersistentManager pm = new PersistentManager())
            {
                try
                {
                    BillDao billDao = new BillDao();
                    ProductStateDao stateDao = new ProductStateDao();

                    pm.BeginTransaction();

                    string billNo = billDao.FindNewBillNo("P", sysDate);

                    billDao.UpdateMasterState(oriBillNo, "5", "SENDER", userID, "SENDDATE", sysDate);
                    billDao.SendMaster(billNo, sysDate, oriBillNo, userID, status);

                    DataTable detailTable = stateDao.Find(oriBillNo);
                    billDao.InsertDetail(billNo, detailTable);

                    if (status == "1")//���ⵥ
                    {
                        billDao.InsertDetail("T" + billNo, detailTable);
                        stateDao.Send("T" + billNo, oriBillNo);
                    }

                    //DataTable cigaretteTable = stateDao.FindCigarette(oriBillNo);
                    //stateDao.UpdateCigarette(oriBillNo, cigaretteTable);

                    stateDao.UpdateBarcode2(oriBillNo);
                    stateDao.Send(billNo, oriBillNo);

                    pm.Commit();
                }
                catch (Exception e)
                {
                    pm.Rollback();
                    throw new Exception(e.Message);
                }
            }
        }
开发者ID:SaintLoong,项目名称:PFK,代码行数:40,代码来源:BillDal.cs


注:本文中的THOK.Util.PersistentManager.Commit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。