Exemplo n.º 1
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hi.Model.YZT_Contract model, SqlTransaction Tran)
 {
     return(dal.Update(model, Tran));
 }
Exemplo n.º 2
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Hi.Model.YZT_Contract model, SqlTransaction Tran)
 {
     return(dal.Add(model, Tran));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Hi.Model.YZT_Contract model)
 {
     return(dal.Add(model));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hi.Model.YZT_Contract model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 5
0
    /// <summary>
    /// 上传合同
    /// </summary>
    /// <param name="Name"></param>
    /// <param name="vDate"></param>
    public void insertContract(string Name, string txtForceDate, string txtInvalidDate)
    {
        string         json = "";
        SqlTransaction tran = null;

        if (!string.IsNullOrWhiteSpace(Name))
        {
            try
            {
                tran = SqlHelper.CreateStoreTranSaction();
                DateTime time = DateTime.Now;
                Hi.Model.YZT_Contract contractModel = new Hi.Model.YZT_Contract();
                contractModel.contractNO   = "";
                contractModel.contractDate = time;
                contractModel.DisID        = KeyID;
                contractModel.CState       = 3;//线下合同
                contractModel.ForceDate    = Convert.ToDateTime(txtForceDate);
                contractModel.InvalidDate  = Convert.ToDateTime(txtInvalidDate);
                contractModel.Remark       = "线下合同";
                contractModel.CreateDate   = DateTime.Now;
                contractModel.CreateUserID = UserID;
                contractModel.dr           = 0;
                contractModel.ts           = DateTime.Now;
                contractModel.modifyuser   = UserID;
                contractModel.CompID       = CompID;
                int Cid = new Hi.BLL.YZT_Contract().Add(contractModel, tran);
                Hi.Model.YZT_Annex annexModel = new Hi.Model.YZT_Annex();
                annexModel.fcID         = Convert.ToInt32(Cid);
                annexModel.type         = 10;
                annexModel.fileName     = Name;
                annexModel.fileAlias    = "3";
                annexModel.validDate    = Convert.ToDateTime(txtInvalidDate);
                annexModel.CreateDate   = time;
                annexModel.dr           = 0;
                annexModel.ts           = time;
                annexModel.modifyuser   = UserID;
                annexModel.CreateUserID = UserID;
                int count = new Hi.BLL.YZT_Annex().Add(annexModel, tran);
                tran.Commit();
                if (count > 0)
                {
                    json = "{\"ret\":\"ok\"}";
                }
                else
                {
                    json = "{\"ret\":\"上传失败\"}";
                }
            }
            catch (Exception e)
            {
                tran.Rollback();
                json = "{\"ret\":\"" + e.Message + "\"}";
            }
        }
        else
        {
            json = "{\"ret\":\"附件不能为空!\"}";
        }
        Response.Write(json);
        Response.End();
    }